Calculate the mean of nonzero pixels and set a threshold
이전 댓글 표시
I previously asked how to calculate the mean of nonzero pixels using my binary mask.
The way I did that was m = mean(volume(mask)).
Now, I would also like to exclude the pixels within the mask with values <0.001.
Can someone help with that?
답변 (1개)
Ilian
2020년 4월 8일
If you just have a threshold, you don't even need to ceate an explicit mask:
m = mean(volume(volume>=0.001)); % average of all values (0.001 or above) in volume
카테고리
도움말 센터 및 File Exchange에서 Image Thresholding에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!