Why my plot doesn't seem correct?
3 views (last 30 days)
Show older comments
Stelios Fanourakis on 10 Oct 2019
Commented: Stelios Fanourakis on 12 Oct 2019
I am using a binary image of white and black pixels (see attached image). I want to plot the white area of pixels so I am using a code to count from top white pixel to the last white pixel of the pic.
heights = zeros(1, columns);
for col = 1 : size(seg,2)
thisColumn = seg(:, col);
topRow = find(thisColumn, 1, 'first');
bottomRow = find(thisColumn, 1, 'last');
heights(col) = bottomRow - topRow; % Add 1 if you want.
But plot doesn't seem right (see attached image). it should had the form and shape of the white area of the image, means a rectangle with a steep bottom.
Any reason why plot doesn't seem correct?
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!