extract only white pixels from an image
2 次查看(过去 30 天)
显示 更早的评论
How can I extract mean and variance of only white pixels of an image?
0 个评论
回答(1 个)
Image Analyst
2019-12-28
编辑:Image Analyst
2019-12-28
What value do you consider "white"? Let's say it's 230. Then you can get a binary image
binaryImage = grayImage >= 230;
Now, exactly what does "extract" mean to you? You want to consider all the gray values in the binary image? If so do
maskMean = mean(grayImage(binaryImage));
maskSD = std(grayImage(binaryImage));
maskVar = var(grayImage(binaryImage));
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!