How to detect the Sun from the space sky in OpenCv?

前端 未结 3 2014
庸人自扰
庸人自扰 2020-12-09 06:21

I need to detect the Sun from the space sky.

These are examples of the input images:

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-09 06:30

    Color Segmentation Approach

    Do a color segmentation on the images to identify objects on the black background. You may identify the sun according to its area (given this uniquely identifies it, resp. don't varies largely accross images). A more sophisticated approach could compute image moments, e.g. hu moments of the objects. See this page for these features.

    Use a classification algorithm of your choice to do the actual classification of the objects found. The most simple approach is to manually specify thresholds, resp. value ranges that turn out to work for all(most) of your object/image combinations.

    You may compute the actual position from the raw moments, as for the circular sun the position is equal to the center of mass

    Centroid: {x, y } = { M10/M00, M01/M00 }
    

    Edge Map Approach

    Another option would be a circle hough transformation of the edge map, this will hopefully return some candidate circles (by position and radius). You may select the sun-circle according to the radius you expect (if you are lucky there is at most one).

提交回复
热议问题