How to mark the (last row,this column) of finding the highest white pixels through each column.
Show older comments

the code for find the white pixels through each column,and mark into the point.
true
BWImage=imread('BWImage.png');
>> row=find(sum(BWImage,2)==0,1,'last')+1;
col=find(BWImage(row,:)~=0);
row=row*ones(size(col));
Points=[row(:) col(:)];
imshow(BWImage)
hold on
plot(Points(:,2),Points(:,1),'rs','MarkerSize',10)
how to mark both point of the row found and lastRow,this Column?(both red and green mark)

2 Comments
Image Analyst
on 3 May 2015
Where are the green marks? If they're not at the very last row, then where are they?
Nurul Najmah
on 3 May 2015
Edited: Nurul Najmah
on 3 May 2015
Answers (1)
Image Analyst
on 3 May 2015
First get the size of your binary image:
[rows, columns] = size(binaryImage);
The last row is the value in "rows".
8 Comments
Nurul Najmah
on 3 May 2015
Edited: Nurul Najmah
on 4 May 2015
Nurul Najmah
on 4 May 2015
Edited: Nurul Najmah
on 4 May 2015
Image Analyst
on 4 May 2015
The last point is x=Points(1,2) and y = rows, like I said before. Do you have some doubt that the last row is at the bottom of the image and that it will have a value of "rows" which is the number of rows in that image that you got from the size() function? If so, why do you doubt it?
Nurul Najmah
on 4 May 2015
Nurul Najmah
on 4 May 2015
Image Analyst
on 4 May 2015
I still don't understand why you don't see that the last white row is at the bottom of the image. I mean, where else do you think it would be - in the middle of the image?
Nurul Najmah
on 4 May 2015
Nurul Najmah
on 4 May 2015
Categories
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!