Filter löschen
Filter löschen

Number of ones

5 Ansichten (letzte 30 Tage)
Santhosh S
Santhosh S am 13 Apr. 2012
counting number of ones occured in labelled binary image for specific rows and storing the values in a vector like number of ones in x row

Antworten (2)

Andrei Bobrov
Andrei Bobrov am 13 Apr. 2012
out = sum(BW,2)

Image Analyst
Image Analyst am 13 Apr. 2012
Try this:
% Create a sample binary image.
binaryImage = logical(randi(2, [5 7])-1)
% Count the ones in each row.
numberOfOnesPerRow = sum(binaryImage, 2)

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by