MATLAB: Using color channel to find blue sky in a image.

cloudscolor segmentationimage analysisimage processingImage Processing Toolboximage segmentationsky

I want to design a angirithm to determine if an image has blue sky, gray sky, or no sky. I want to use color channel and assumes sky is in the top of the image.
For example, This image has blue sky and the algorithm should return "blue sky".
This image has gray sky and the algorithm should return "gray sky".
This image has no sky and the algorithm should return "none".
Thanks a lot!

Best Answer

This is very easy. Any of my 3 color segmentation demos in my File Exchange should work. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862&sort=downloads_desc
You can also use the Color Thresholder on the Apps tab of the Tool ribbon.
You might also want to do a texture filter like stdfilt() to try to find relatively smooth areas of the image that are near the top of the image. Sky should be both fairly smooth in texture and fairly uniform in color, in most cases. Are you going to have to detect sky with isolated puffy white clouds in it? That could complicate things.
Related Question