Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Doloresru opened this issue Oct 18, 2019 · 2 comments
Closed

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

Doloresru opened this issue Oct 18, 2019 · 2 comments

Comments

@Doloresru
Copy link

When i use the Python package the same as the given demo ,I met a error as:
File "E:/Pycharm project/maching learning/HW2/Try.py", line 10, in
cnts,d_factor = tl.locate_tissue_cnts(slide_path,max_img_size=2048,smooth_sigma=13,thresh_val=0.80,min_tissue_size=10000)
File "C:\Users\17807\AppData\Roaming\Python\Python37\site-packages\tissueloc\locate_tissue.py", line 146, in locate_tissue_cnts
cnts = find_tissue_cnts(bw_remove)
File "C:\Users\17807\AppData\Roaming\Python\Python37\site-packages\tissueloc\locate_tissue.py", line 103, in find_tissue_cnts
method=cv2.CHAIN_APPROX_NONE)
ValueError: not enough values to unpack (expected 3, got 2)

How can I solve this error? thanks first!

@PingjunChen
Copy link
Owner

I believe the reason should be the version of OpenCV. The output parameters of cv2.findContours is changed. Please use the version specified in the requirements, namely opencv-python==3.4.4.19.

Sorry for the late reply.

@PingjunChen
Copy link
Owner

PingjunChen commented Feb 25, 2020

Thanks for the question. The package now is updated to version 2.1.0, which uses OpenCV-4.1.2.30, in which two values would return from function findContours instead of three in OpenCV-3.xx. I believe your problem would be resolved using OpenCV-4.xx and tissueloc-2.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants