Undefined function or variable 'segPic'.

조회 수: 2 (최근 30일)
vetri veeran
vetri veeran 2014년 10월 27일
댓글: Geoff Hayes 2014년 10월 27일
My code is
din=imread('Pic1.jpg');
[rows, columns, numberOfColorBands] = size(din)
if numberOfColorBands > 1 din = din(:, :, 2); % Take green channel.
end
figure(1); imshow(din) figure(2); imhist(din)
BW = roicolor(din, 75, 255); figure(3), imshow(BW)
dout = double(din < 70);
grass = double(segPic == 0)*100; figure (3); imagesc(grass)
road = double(bwareaopen(segPic, 1000))*255; figure(4); imshow(road)
tree = + road; figure(3); imagesc(tree); axis image axis off
I am getting an error as,
Undefined function or variable 'segPic'.
Error in segmentation1 (line 24) grass = double(segPic == 0)*100;
  댓글 수: 1
Geoff Hayes
Geoff Hayes 2014년 10월 27일
Vetri - the error message is telling you that you haven't defined the variable (or function) segPic before trying to use it. Your code seems to suggest that this is a matrix and that you wish to find all zeros in it. What are you assuming that segPic is (segmented picture?) and what are you attempting?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by