i try to use bwlabel, but there error that i can't fix

7 visualizaciones (últimos 30 días)
ElizabethR
ElizabethR el 1 de Mzo. de 2016
Comentada: Image Analyst el 2 de Mzo. de 2016
>> BW=imread('b.jpg');
>> L=bwlabel(BW);
Error using bwlabel
Expected input number 1, BW, to be two-dimensional.
...
please help

Respuesta aceptada

Walter Roberson
Walter Roberson el 2 de Mzo. de 2016
jpg files are almost always RGB images even if they look like black and white. You need to rgb2gray() the content and perhaps im2bw() the result.

Más respuestas (1)

Image Analyst
Image Analyst el 1 de Mzo. de 2016
You call it BW but it's most likely not a binary image. It's probably gray scale or color. You need to binarize your grayscale image first. For example threshold it
grayImage = imread(filename);
BW = grayImage < 100;
  2 comentarios
ElizabethR
ElizabethR el 2 de Mzo. de 2016
thank you so much .. but, how to calculate the wide of object in binary image ?

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by