How can I count the number of pixels in an image that satisfy a certain condition?

1 回表示 (過去 30 日間)
Mitra Bapat
Mitra Bapat 2015 年 2 月 11 日
回答済み: Adam 2015 年 2 月 11 日
I am doing a project based on image processing. My image is in double format. I need to count the number of pixels in an image which satisfy a condition. For example, I need to count the number of pixels whose values are greater than say 0.1... And then I need to store that number in a variable for further processing. Please help me out. Thank you.

回答 (1 件)

Adam
Adam 2015 年 2 月 11 日
res = nnz( im > 0.1 );

カテゴリ

Help Center および File ExchangeImage Filtering and Enhancement についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by