フィルターのクリア

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 Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by