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

Error with skimage #8

Open
sweta-lab opened this issue Mar 22, 2021 · 3 comments
Open

Error with skimage #8

sweta-lab opened this issue Mar 22, 2021 · 3 comments

Comments

@sweta-lab
Copy link

Error: 'image' and 'label' must be the same shape
While using the label2rgb function. The labels have (x,y,3) dimensions. How is that possible?

@ahmetozlu
Copy link
Owner

Can you share stack-trace, please?

@JuanJo57
Copy link

JuanJo57 commented Jun 9, 2021

Hi, maybe this helps:

Traceback (most recent call last):
  File "...deteccionFirma.py", line 86, in FiltradoFirmas
    image_label_overlay = label2rgb(blobs_labels, image=img)
  File "...\AppData\Roaming\Python\Python38\site-packages\skimage\_shared\utils.py", line 66, in fixed_func
    return func(*args, **kwargs)
  File "...\AppData\Roaming\Python\Python38\site-packages\skimage\color\colorlabel.py", line 113, in label2rgb
    return _label2rgb_overlay(label, image, colors, alpha, bg_label,
  File "...\AppData\Roaming\Python\Python38\site-packages\skimage\color\colorlabel.py", line 162, in _label2rgb_overlay
    raise ValueError("`image` and `label` must be the same shape")
ValueError: `image` and `label` must be the same shape

@seanbenhur
Copy link

seanbenhur commented Sep 9, 2021

While reading the image, did you read same way as in code?
img = cv2.imread(image_path, 0)

if you remove 0, you will get this error

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

4 participants