The invention provides a method for identifying the clouds and
sky of a
sky image based on an improved k-means clustering
algorithm. The method comprises the steps of extracting red channel values R, green channel values G, blue channel values B from the
sky image to form a red channel value
R matrix, a green channel value G matrix, a blue channel value B matrix and an R / B*100 matrix, and extracting a
characteristic matrix; determining an initial clustering number and an initial clustering center; based on the improved k-means clustering
algorithm, clustering according to the initial clustering center, thus obtaining a new clustering center; and clustering according to the new clustering center, determining the type of an area to which each pixel point belongs according to the clustering result, and drawing a cloud and sky identification image. According to the method for identifying the clouds and sky of the sky
image based on the improved k-means clustering
algorithm, the extracting effect is stable; the three color components are used as a whole for clustering, and the R / B*100
column vector with high cloud and sky
contrast ratio is also added, so that compared with the method of using a global threshold to perform cloud and sky identification on a
gray level image only, the method for identifying the clouds and sky of the sky
image based on the improved k-means clustering algorithm is greatly improved in
adaptive capacity in
image identification and can solve the problem of poor
adaptation in the prior art.