Borrar filtros
Borrar filtros

Number of ones

5 visualizaciones (últimos 30 días)
Santhosh S
Santhosh S el 13 de Abr. de 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

Respuestas (2)

Andrei Bobrov
Andrei Bobrov el 13 de Abr. de 2012
out = sum(BW,2)

Image Analyst
Image Analyst el 13 de Abr. de 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)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by