How to convert figure in matlab to object? -
sorry if question wasn't understood...i try clarify describing problem...
i have object (in binary image) curvey , long. want plot line top point lowest point after either fill enclosed area between curve , straight line measure area or finding distance between every point in curve , line same purpose... know easy plot line using plot follow:
imshow(fnnshrink) hold on plot([tlx , brx ],[tly ,bry],'-', 'markerfacecolor' , 'b') hold off
which give me nice colored line (in figure of matlab), problem couldnot perform measurment on line (its showing only). when trying handler 1 of friend here told me, still give me length of line (not helpful). 1 of solution tried make line self setting pixel 1 using line equation , create new object line in image follow:
m = (tly - bry) / (tlx - brx); % same = tlx : 1 : brx fnnshrink(round(m * (i - tlx) + tly) , round(i)) = 1; ftest(round(m * (i - tlx) + tly) , round(i)) = 1; end
this solution work in image if distance (between upper point , lower one) (on x-axis) relatively big, problem when distance small (slope negative) got discrete line , not continuous 1 (group of points between upper , lower points)... problem.. , please me if can...
actually, imshow, plotting function in matlab, not show plot. returns handle (the matlab equivalent of pointer) object created. so, need
new_object = imshow(...)
instead of imshow
Comments
Post a Comment