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

조회 수: 4 (최근 30일)
ElizabethR
ElizabethR 2016년 3월 1일
댓글: Image Analyst 2016년 3월 2일
>> BW=imread('b.jpg');
>> L=bwlabel(BW);
Error using bwlabel
Expected input number 1, BW, to be two-dimensional.
...
please help

채택된 답변

Walter Roberson
Walter Roberson 2016년 3월 2일
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.

추가 답변 (1개)

Image Analyst
Image Analyst 2016년 3월 1일
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
ElizabethR
ElizabethR 2016년 3월 2일
thank you so much .. but, how to calculate the wide of object in binary image ?
Image Analyst
Image Analyst 2016년 3월 2일
See my Image Segmentation Tutorial. It will show you how. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

댓글을 달려면 로그인하십시오.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by