please help , how to solve this error code

조회 수: 3 (최근 30일)
KURNIAWAN
KURNIAWAN 2012년 7월 1일
i wanna find coordinate of edge corner of label image,,
i have problem , i already process my image : http://tinypic.com/view.php?pic=2czer0o&s=6
and then this my image after process label : http://tinypic.com/view.php?pic=fbgcbm&s=6
but have message error :
? ?? Function 'find' is not defined for values of class 'cell'. Error in ==> mathcorner at 67 upperLeftCornerX = find(B(1,:), 1, 'first');
error found when i tried to find corner coordintae of label image .. this my label code :
[B,L] = bwboundaries(g,'holes');
% Display the label matrix and draw each boundary
imshow(label2rgb(L, @jet, [.1 .1 .1]))
hold on
for k = 1:length(B)
boundary = B{k};
plot(boundary(:,2), boundary(:,1), 'w', 'LineWidth', 1)
end
%find coorndinate ,,
upperLeftCornerX = find(B(1,:), 1, 'first');
upperRightCornerX = find(B(1,:), 1, 'last');
lowerLeftCornerX = find(B(end,:), 1, 'first');
lowerRightCornerX = find(B(end,:), 1, 'last');
upperLeftCornerX
upperRightCornerX
lowerLeftCornerX
lowerRightCornerX

채택된 답변

Malcolm Lidierth
Malcolm Lidierth 2012년 7월 1일
Use
{}
to access the cell contents not
()
as in the lines above with
B{k}

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by