count white pixels on each column of a binary image
Show older comments
I need to find the number of white pixels in each column and find the pixel position of column with minimum white pixels
Here is my image

I have done the following code,but it finds white pixels in each row.How can I modify this code to get the correct value
counts(size(topHalf,1):-1:1,:) = sum(topHalf == 1,2)
Accepted Answer
More Answers (0)
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!