Error with skimage

#8 · open · 3 comments

View on GitHub ↗

sweta-lab

**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?

Comments

ahmetozlu

Can you share stack-trace, please?

JuanJo57

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

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