필터 지우기
필터 지우기

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.

채택된 답변

Matt J
Matt J 2017년 9월 10일
편집: Matt J 2017년 9월 10일
intensity = HSIimage(:,:,3);
map= (intensity>=lowerlimit & intensity<=upperlimit);
percentage=sum(map(:))/numel(map)*100;
  댓글 수: 8
Matt J
Matt J 2017년 9월 28일
편집: Matt J 2017년 9월 28일
map2= all(map,2);
percentage=sum(map2,1)/numel(map2)*100
where map is as before.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
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
Jayden  Hasemann
Jayden Hasemann 2017년 9월 11일
Thanks for that, I see you have a very in depth knowledge in DSP with matlab. do you have any examples of finding clusters of a certain range of intensities within an image?
Image Analyst
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.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by