Patent Document ID: 10088600
Application ID: 14845859
Patent Flag: 1

Claim One:
1. A weather recognition method performed by a device based on image information detection, wherein the device comprises a processor, and the processor performs the steps of: obtaining an image to be detected; extracting multiple sets of first image features of the image to be detected with respect to different preset types of weather according to a number of first preset algorithms preset correspondingly for the different preset types of weather, wherein the preset types of weather comprise at least one of the following: clear day, rainy day, snowy day and smoggy day, each of which corresponds to a set of image features, and extracting image features of the image to be detected with respect to the clear day in the case that the preset types of weather comprise the clear day comprises: detecting a sky area in the image to be detected, extracting color information of the detected sky area, generating image features of a preset first dimension according to the extracted color information, determining the image features of the image to be detected with respect to the clear day according to the image features of the preset first dimension; extracting image features of the image to be detected with respect to the rainy day in the case that the preset types of weather comprise the rainy day comprises: obtaining high-frequency component information of the image to be detected according to a preset guided-filtering algorithm, performing a binarization processing for the obtained high-frequency component information, extracting HOG, Histogram of Oriented Gradient, features of the high-frequency component information after the binarization processing, matching templates in a preset HOG template set with the extracted HOG features according to a preset template sliding rule to obtain respective matching degrees, selecting HOG features corresponding to a third preset number of matching degrees from the extracted HOG features according to the matching results based on a descending order in which the matching degrees are arranged, generating image features of a preset third dimension according to the selected HOG features, determining the image features of the image to be detected with respect to the rainy day according to the image features of the preset third dimension; extracting image features of the image to be detected with respect to the snowy day in the case that the preset types of weather comprise the snowy day comprises: detecting pixels constituting a snowflake in the image to be detected, generating image features of a preset fourth dimension according to the detected pixels constituting a snowflake, determining the image features of the image to be detected with respect to the snowy day according to the image features of the preset fourth dimension; extracting image features of the image to be detected with respect to the smoggy day in the case that the preset types of weather comprise the smoggy day comprises: adjusting the size of the image to be detected according to a preset scale, dividing the size-adjusted image into image blocks of a preset size, obtaining dark channel information of each image block, generating image features of a preset fifth dimension according to the obtained dark channel information, determining the image features of the image to be detected with respect to the smoggy day according to the image features of the preset fifth dimension; inputting the extracted multiple sets of first image features to a preset multi-kernel classifier, and performing classification according to the inputted image features by means of the multi-kernel classifier and identifying the weather in which the image to be detected was taken by determining whether the data contained in the set of image features corresponding to a type of weather are within a preset range for this type of weather, wherein among the preset types of weather, the data contained in the set of image features corresponding to the same type of weather as the weather in which the image to be detected was taken are within the preset range for this type of weather, while the sets of image features corresponding to other types of weather are not within respective preset range for these types of weather; wherein the multi-kernel classifier is a classifier for the preset types of weather realized by: selecting a first preset number of image samples for the different preset types of weather in which the image was taken respectively; and for the image samples of each preset type of weather respectively, extracting the first image features of each image sample according to the first preset algorithm which corresponds to this preset type of weather; and performing machine learning for the extracted first image features according to a preset multi-kernel learning algorithm, after obtaining the image to be detected, the method further includes: obtaining second image features of the image to be detected with respect to image contrast and/or image saturation according to second preset algorithms; the multi-kernel classifier is realized by: selecting the first preset number of image samples for the different preset types of weather in which the image was taken respectively; and for the image samples of each preset type of weather respectively, extracting the first image features of each image sample according to the first preset algorithm which corresponds to this preset type of weather; obtaining the second image features of each of the selected image samples with respect to image contrast and/or image saturation, respectively, according to the second preset algorithms; and performing machine learning for the extracted first image features and for the obtained second image features according to the preset multi-kernel learning algorithm to realize the multi-kernel classifier for the preset types of weather.