Skip to content

Error when running Demo Notebooks #55

@MatthiasHerp

Description

@MatthiasHerp

Hello,

I'm aiming at using you package to rebuild the Photografik image analysis from the following paper: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2976021

In Running your demo code in the Notebook Detectorexample.ipynb I stumbled upon the following error(I got the same error in other notebooks ) when running:

Code:
num_regions, features_standard, features_poly = sr.binary_mask2ellipse_features(regions, min_square=False)

Error:

ValueError Traceback (most recent call last)
in ()
----> 1 num_regions, features_standard, features_poly = sr.binary_mask2ellipse_features(regions, min_square=False)
2 print("number of features per saliency type: ", num_regions)
3 sr.visualize_ellipses(regions["holes"], features_standard["holes"])
4 sr.visualize_ellipses(regions["islands"], features_standard["islands"])
5 sr.visualize_ellipses(regions["indentations"], features_standard["indentations"])

/opt/anaconda3/envs/salre/lib/python3.5/site-packages/salientregions/helpers.py in binary_mask2ellipse_features(regions, connectivity, min_square)
492 # print "Saliency type: ", saltype
493 num_regions_s, features_standard_s, features_poly_s = binary_mask2ellipse_features_single(regions[saltype],
--> 494 connectivity=connectivity, saliency_type=region2int[saltype], min_square=min_square)
495 num_regions[saltype] = num_regions_s
496 # print "Number of regions for that saliency type: ", num_regions_s

/opt/anaconda3/envs/salre/lib/python3.5/site-packages/salientregions/helpers.py in binary_mask2ellipse_features_single(binary_mask, connectivity, saliency_type, min_square)
348 binary_mask2 = binary_mask.copy()
349 _, contours, hierarchy = cv2.findContours(
--> 350 binary_mask2, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE)
351
352 indices_regions = np.where(hierarchy[0,:, 3] == -1)[0]

ValueError: not enough values to unpack (expected 3, got 2)

I would be glad for any assistance you can provide.

Greetings

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions