How do I determine the percentage of pixels of a certain colour range within an area in my image?
2 ビュー (過去 30 日間)
古いコメントを表示
I am trying to determine the percentage of pixels of a certain colour range within an area in my image.
I have already turned the image to HSI to to then find a range of intensity in which the clouds would appear as. I now want to find out what percentage of cloud (range of intensity) is within a certain region i.e. around the sun.
This in order to then use this information in an if statement to determine if a white is present within a specified region of the image.
Any help would be appreciated.

0 件のコメント
採用された回答
Matt J
2017 年 9 月 10 日
編集済み: Matt J
2017 年 9 月 10 日
intensity = HSIimage(:,:,3);
map= (intensity>=lowerlimit & intensity<=upperlimit);
percentage=sum(map(:))/numel(map)*100;
その他の回答 (1 件)
Image Analyst
2017 年 9 月 11 日
I don't think your algorithm is very robust. I suggest you follow the papers of researchers who have successfully found clouds and published their algorithms. See articles on cloud detection in Vision Bib:
16.6.2.12 Tracking for Weather, Clouds
2 件のコメント
Image Analyst
2017 年 9 月 11 日
編集済み: Image Analyst
2017 年 9 月 11 日
Try the colorcloud() function. Also try the classification Learner App on the Apps tab. Also try the Color Thresholder on the Apps tab.
And see my color segmentation demos on my File Exchange http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862&sort=downloads_desc
参考
カテゴリ
Help Center および File Exchange で Image Processing and Computer Vision についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!