필터 지우기
필터 지우기

Number of ones

조회 수: 5 (최근 30일)
Santhosh S
Santhosh S 2012년 4월 13일
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

답변 (2개)

Andrei Bobrov
Andrei Bobrov 2012년 4월 13일
out = sum(BW,2)

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

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by