Color feature extraction method and device and storage medium

By identifying and separating image separation elements in the image and extracting their color features, the problem of difficulty in extracting image details in the prior art is solved, and accurate description and extraction of local color information of the image is realized.

CN120070915APending Publication Date: 2025-05-30BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311630630.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-30
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The prior art is difficult to effectively extract the detailed color features in the image and cannot accurately reflect the local color information of the image.

Method used

By identifying and separating image separation elements in the image, and extracting the corresponding color features of these elements, including image contrast, color richness, and pixel standard deviation.

Benefits of technology

The precise acquisition of the color features corresponding to each image separation element in the image is achieved, and the precision and accuracy of color feature extraction is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070915A_ABST
    Figure CN120070915A_ABST
Patent Text Reader

Abstract

The invention relates to a color feature extraction method and device and a storage medium. The color feature extraction method comprises the steps that an image to be subjected to color feature extraction is acquired, image separation elements in the image are recognized, and the image separation elements are preset different color areas used for performing color separation on the image. The image separation elements are separated from the image, the image separation elements and an image background are obtained, and the image background is a remaining area after the image separation elements are removed from the image. And respectively extracting color features corresponding to the image separation elements. According to the method and the device, the color features of the specific elements in the image can be extracted, more accurate color feature extraction operation can be realized, more accurate data can be obtained, and more requirements can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing, and in particular, to a method, apparatus, and storage medium for extracting color features. Background Art

[0002] The color feature extraction technology is a method for extracting color information from images, mainly used in the fields of image processing, computer vision, and machine learning. This technology can be used for tasks such as image retrieval, object detection, and image classification, and is one of the important research directions in the field of image processing.

[0003] In the related art, by obtaining the visual features of the entire image to describe the overall distribution of the color features in the image, the detailed color features of the image cannot be reflected. Summary of the Invention

[0004] To overcome the problems existing in the related art, the present disclosure provides a method, apparatus, and storage medium for extracting color features.

[0005] According to the first aspect of the embodiments of the present disclosure, a method for extracting color features is provided, including:

[0006] Obtain an image to be subjected to color feature extraction, and identify image separation elements in the image, where the image separation elements are preset different color regions for separating the color of the image; separate the image separation elements in the image, and respectively extract the color features corresponding to the image separation elements.

[0007] In one implementation, the method further includes:

[0008] Save the extracted color features, and create a correspondence between the color features and the image separation elements.

[0009] In one implementation, the color features include at least one of the following:

[0010] Image contrast; color richness; pixel standard deviation.

[0011] In one implementation, the color features include image contrast, and the extracting the color features corresponding to the image separation elements includes:

[0012] Obtain the image separation element region of the image separation element in the image, and for each pixel point in the image separation element region, respectively determine the first gray value of the pixel point and the second gray value of the four-neighbor pixel points of the pixel point; based on the first gray value and the second gray value, determine the image contrast corresponding to the image separation element.

[0013] In one implementation, the color feature includes the pixel standard deviation. Extracting the color feature corresponding to the image separation element includes:

[0014] Obtain the image separation element area of the image separation element in the image, determine the gray values of each pixel point in the image separation element area, and the average value of the gray values of each pixel point; determine the square of the difference between each pixel point gray value and the average value as the pixel standard deviation corresponding to the image separation element.

[0015] In one implementation, the color feature includes color richness. Extracting the color feature corresponding to the image separation element includes:

[0016] Obtain the image separation element area of the image separation element in the image, and determine the red channel information, green channel information, and blue channel information of the image separation element area in the red, green, and blue color spaces; determine the color richness of the image separation element based on the brightness characteristics of the red channel information, green channel information, and blue channel information.

[0017] In one implementation, the method further includes:

[0018] Determine the color feature value corresponding to the extracted color feature, and determine the color feature interval where the value of the color feature is located. The color feature interval is an interval containing a continuous range of color feature values; based on the name of the interval where the value of the color feature is located, replace the value of the color feature.

[0019] According to the second aspect of the embodiments of the present disclosure, there is provided a color feature extraction device, including:

[0020] An acquisition unit for acquiring an image to be subjected to color feature extraction and identifying the image separation elements in the image. The image separation elements are preset different color regions for color separation of the image; a processing unit for separating the image separation elements in the image and respectively extracting the color features corresponding to the image separation elements.

[0021] In one implementation, the processing unit is further configured to:

[0022] Save the extracted color features and create a correspondence between the color features and the image separation elements.

[0023] In one implementation, the color feature includes at least one of the following:

[0024] Image contrast; color richness; pixel standard deviation.

[0025] In one implementation, the color feature includes image contrast, and the processing unit extracts the color feature corresponding to the image separation element in the following manner:

[0026] Obtain the image separation element area of the image separation element in the image, and for each pixel point in the image separation element area, respectively determine the first gray value of the pixel point and the second gray values of the four neighboring pixel points of the pixel point; Based on the first gray value and the second gray values, determine the image contrast corresponding to the image separation element.

[0027] In one implementation, the color feature includes pixel standard deviation, and the processing unit extracts the color feature corresponding to the image separation element in the following manner:

[0028] Obtain the image separation element area of the image separation element in the image, and determine the gray values of each pixel point in the image separation element area, and the mean value of the gray values of each pixel point; Determine the square of the difference between the gray value of each pixel point and the mean value as the pixel standard deviation corresponding to the image separation element.

[0029] In one implementation, the color feature includes color richness, and the processing unit extracts the color feature corresponding to the image separation element in the following manner:

[0030] Obtain the image separation element area of the image separation element in the image, and determine the red channel information, green channel information, and blue channel information of the image separation element area in the red-green-blue color space; Based on the brightness characteristics of the red channel information, the green channel information, and the blue channel information, determine the color richness of the image separation element.

[0031] In one implementation, the processing unit is further configured to:

[0032] Determine the color feature value corresponding to the extracted color feature, and determine the color feature interval in which the value of the color feature is located, where the color feature interval is an interval containing a continuous range of color feature values;

[0033] Replace the value of the color feature based on the name of the interval in which the value of the color feature is located.

[0034] According to a third aspect of the embodiments of the present disclosure, there is provided a color feature extraction device, including:

[0035] A processor; a memory for storing processor-executable instructions; wherein, the processor is configured to: execute the color feature extraction method described in the first aspect or any one of the implementations of the first aspect.

[0036] According to a fourth aspect of the embodiments of the present disclosure, there is provided a storage medium storing instructions that, when executed by a processor of a terminal, enable the terminal to perform the method described in any item of the first aspect or any implementation manner of the first aspect.

[0037] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: By identifying and separating the image separation elements in the image and respectively extracting the color features of the image separation elements, it is possible to achieve the color features corresponding to each image separation element in the image, and accurately obtain the color features corresponding to the local content in the image. Compared with extracting the color features of the entire image, the color features can be extracted more precisely.

[0038] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure.

[0040] Figure 1 is a flowchart of a color feature extraction method shown according to an exemplary embodiment.

[0041] Figure 2 is a flowchart of a color feature extraction method shown according to an exemplary embodiment.

[0042] Figure 3 is a flowchart of an image contrast extraction method shown according to an exemplary embodiment.

[0043] Figure 4 is a flowchart of a pixel standard deviation extraction method shown according to an exemplary embodiment.

[0044] Figure 5 is a flowchart of a color richness extraction method shown according to an exemplary embodiment.

[0045] Figure 6 is a flowchart of a color feature division method shown according to an exemplary embodiment.

[0046] Figure 7 is a schematic diagram of a commodity color feature extraction method process shown according to an exemplary embodiment.

[0047] Figure 8a is a schematic diagram of a commodity color feature extraction result shown according to an exemplary embodiment.

[0048] Figure 8b It is a schematic diagram showing the extraction result of the color feature of a commodity according to an exemplary embodiment.

[0049] Figure 8c It is a schematic diagram showing the extraction result of the color feature of a commodity according to an exemplary embodiment.

[0050] Figure 9 It is a block diagram of a color feature extraction device according to an exemplary embodiment.

[0051] Figure 10 It is a block diagram of a device for color feature extraction according to an exemplary embodiment. Detailed implementation manners

[0052] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all the implementation manners consistent with the present disclosure.

[0053] In the drawings, the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The described embodiments are some embodiments of the present disclosure, rather than all the embodiments. The embodiments described below by referring to the drawings are exemplary and are intended to explain the present disclosure, and should not be construed as a limitation to the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present disclosure without creative efforts belong to the scope of protection of the present disclosure. The embodiments of the present disclosure will be described in detail below with reference to the drawings.

[0054] The color feature extraction method provided by the embodiments of the present disclosure is applied to the field of computer vision. The color feature extraction method provided by the embodiments of the present disclosure is mainly used to quantify the color features corresponding to at least one image separation element in an image respectively. With the rapid growth of the number of digital images, it becomes particularly important to manage and retrieve images effectively. Among them, Content-Based Image Retrieval (CBIR) has become one of the research hotspots in the field of multimedia retrieval. In CBIR, the feature extraction and representation of images are key steps, and the color feature is one of the most important features of images.

[0055] In the related art, the color features of an entire image are extracted through a color histogram or color moments to capture the overall color distribution of the image, and the information content included in the image is represented based on the overall color features of the image. However, in the related art, obtaining the overall color distribution of the image ignores the spatial information in the image, and it is impossible to extract the image features of local parts of the image. Moreover, the features currently used to represent images often cannot accurately reflect the color information of the image, and cannot meet the requirements for accurate classification and retrieval of images based on the color features corresponding to the image separation elements.

[0056] In view of this, embodiments of the present disclosure provide a color feature extraction method, which determines image separation elements for color feature extraction in an image and combines the image separation elements for color feature extraction to improve the accuracy of color feature extraction.

[0057] For example, the color features corresponding to each image separation element in the image are extracted by combining the image separation elements and a color feature quantization algorithm. In one implementation, the image separation elements in the image are obtained, and the color features corresponding to the image separation elements are obtained based on the feature quantization algorithm, so as to achieve the extraction of the color features in each image separation element in the image. Further, a color information description can be performed on the extracted color features.

[0058] Figure 1 is a flowchart of a color feature extraction method shown according to an exemplary embodiment. As Figure 1 shown, it includes the following steps S11 and step S12.

[0059] In step S11, an image to be subjected to color feature extraction is obtained, and the image separation elements in the image are recognized.

[0060] In the embodiments of the present disclosure, the image separation elements are preset different color regions for color separation of the image. The image separation elements can be set according to actual needs, and different corresponding image separation elements can be set for the same image. For example, for image A to be subjected to color feature extraction, the corresponding separation elements can be set as element A1, element A2, and element A3, and element A1, element A2, and element A3 in image A are recognized. It is also possible to set the corresponding separation elements as element A4, element A5, and element A6, and element A4, element A5, and element A6 in image A are recognized.

[0061] In step S12, the image separation elements are separated in the image, and the color features corresponding to the image separation elements are respectively extracted.

[0062] In the embodiments of the present disclosure, separating the image separation elements in an image can be achieved by classifying the pixels of each image separation element and separating the image separation elements in the image based on the pixel types. Separating the image separation elements in the image can also be performed using a deep learning model learned based on a large amount of image data to separate the image separation elements in the image. It should be understood that the above methods for separating the image separation elements in the image are only for illustrative purposes, and the embodiments of the present disclosure do not limit the manner of separating the image based on the image separation elements.

[0063] In the embodiments of the present disclosure, color feature extraction can be performed on a combination of multiple image separation elements in an image. For example, if the image separation elements in the image are element A1, element A2, and element A3, color extraction can be performed on the image content corresponding to element A1 and element A2 to obtain the color features corresponding to element A1 and element A2.

[0064] In the embodiments of the present disclosure, by separating the image to be color feature extracted based on the image separation elements and separately extracting the color features corresponding to each image separation element, it is possible to extract the color features of the local regions of the image to be color feature extracted, improving the fineness of color feature extraction.

[0065] In the embodiments of the present disclosure, after obtaining the color features corresponding to the image separation elements, a correspondence relationship between each image separation element and the color features can be established to facilitate searching for the image separation elements based on the color features.

[0066] Figure 2 is a flowchart of a color feature extraction method shown according to an exemplary embodiment. As Figure 2 shown, it includes the following steps S21, step S22, and step S23.

[0067] Figure 2 The steps in S21 and S22 in Figure 1 are the same as the steps in S11 and S12 in

[0068] and will not be elaborated here. Reference can be made to the relevant descriptions in the above embodiments. Only the differences will be described below.

[0069] In the embodiments of the present disclosure, a database or file capable of storing the image separation elements, color features, and the correspondence relationship between the color features and most of the image separation elements can be created for storage. Among them, there can be multiple types of color features. Therefore, an image separation element can have multiple corresponding color features. Based on the multiple color features and the corresponding image separation elements, it is possible to describe the image separation elements from multiple dimensions.

[0070] In the embodiments of the present disclosure, the color feature includes at least one of the following: image contrast; color richness; pixel standard deviation. It should be understood that, in addition to the above color features, other color features can also be used as additional color features, for example, purity, brightness, hue, and lightness, etc.

[0071] In the embodiments of the present disclosure, by using image contrast, color richness, pixel standard deviation, etc. as color features, the accuracy of the description of the color features of the image to be extracted with color features can be improved.

[0072] In the embodiments of the present disclosure, the image contrast in the color feature of the image separation element is determined based on the gray values of all pixels in the corresponding image separation element region and the gray values of the pixels in the four-neighborhood corresponding to each pixel.

[0073] Figure 3 is a flowchart of an image contrast extraction method shown according to an exemplary embodiment, as Figure 3 shown, including the following steps S31 and step S32.

[0074] In step S31, obtain the image separation element region of the image separation element in the image, and for each pixel point in the image separation element region, respectively determine the first gray value of the pixel point and the second gray value of the pixel points in the four-neighborhood of the pixel point.

[0075] In the embodiments of the present disclosure, if the image separation element region is in color, the image separation element region can be first converted into a grayscale image to facilitate obtaining the gray values corresponding to each pixel point. The four-neighborhood pixel points are the pixel points adjacent to the top, bottom, left, and right of the pixel point corresponding to the first gray value. It should be understood that if there is a missing pixel point in the four-neighborhood of a certain pixel point, the gray value of the missing pixel point is set to a default value. Among them, the default value of the gray value is a preset value.

[0076] In step S32, based on the first gray value and the second gray value, determine the image contrast corresponding to the image separation element.

[0077] In the embodiments of the present disclosure, the image contrast corresponding to the image separation element can be obtained by calculating the difference between the first gray value and the corresponding second gray value.

[0078] For example, for a certain pixel point in the image separation element region, assume that the gray value of this pixel point is a, and the gray values of the pixel points above, below, left, and right are b, c, e, and f respectively. Then the variance between the gray value (the first gray value) corresponding to this pixel point and the gray values (the second gray values) of the pixel points in the four-neighborhood can be used to represent the difference between the first gray value and the corresponding second gray value, that is, by calculating (a - b) 2 +(a - c)2 +(a - d) 2 +(a - f) 2 Obtain the variance corresponding to this pixel, and use the same method to obtain the variances corresponding to each pixel in the image separation element region, and obtain the image contrast of the image separation element through the sum of the variances corresponding to each pixel. It should be understood that the above-mentioned obtaining of the image contrast corresponding to the image separation element is only for illustrative purposes, and other values that can represent the difference between the first gray value and the corresponding second gray value can also be used as the image contrast.

[0079] In the embodiments of the present disclosure, the image contrast corresponding to the image separation element obtained based on the first gray value and the second gray value can better reflect the contrast situation in the image separation element region, and can also reflect the disorder degree or complexity of the image texture in the image separation element region.

[0080] In the embodiments of the present disclosure, the pixel standard deviation in the color feature of the image separation element is determined based on the gray average value of all pixels and the gray value of each pixel in the corresponding image separation element region.

[0081] Figure 4 is a flowchart of a pixel standard deviation extraction method shown according to an exemplary embodiment, as Figure 4 shown, including the following steps S41 and step S42.

[0082] In step S41, obtain the image separation element region of the image separation element in the image, and determine the gray values of each pixel in the image separation element region and the average value of the gray values of each pixel.

[0083] In the embodiments of the present disclosure, obtain the gray values of each pixel included in the image separation element region corresponding to the image separation element, and calculate the average value of the gray values of each pixel in the image separation element region.

[0084] In step S42, square the difference between each pixel gray value and the average value, and determine it as the pixel standard deviation corresponding to the image separation element.

[0085] In the embodiments of the present disclosure, sum the squares of the differences between each pixel gray value and the average value, and then take the square root of the sum to obtain the pixel standard deviation corresponding to the image separation element. For example, assume that there are n pixel points in the image separation element region corresponding to an image separation element, and the gray values of the pixel points are g 1 、g 2 ……g n , and the average value of the pixel point gray values is h, then the pixel standard deviation corresponding to the image separation element is

[0086] In the embodiments of the present disclosure, by obtaining the pixel standard deviation of the image separation element region, the gray-level distribution of the image separation element region and the information content included can be significantly reflected.

[0087] In the embodiments of the present disclosure, the color richness in the color feature of the image separation element is determined based on the R, G, and B channel information in the corresponding image separation element region.

[0088] Figure 5 It is a flowchart of a method for extracting color richness shown according to an exemplary embodiment, as Figure 5 shown, and includes the following steps S51 and S52.

[0089] In step S51, obtain the image separation element region of the image separation element in the image, and determine the red channel information, green channel information, and blue channel information of the image separation element region in the red-green-blue color space.

[0090] In the embodiments of the present disclosure, the red-green-blue color space can also be referred to as the RGB color space. Through the red channel information, green channel information, and blue channel information of the image separation element region in the red-green-blue color space, the corresponding red brightness value, green brightness value, and blue brightness value of each pixel point included in the image separation element region can be obtained.

[0091] In step S52, determine the color richness of the image separation element based on the brightness characteristics of the red channel information, green channel information, and blue channel information.

[0092] In the embodiments of the present disclosure, the corresponding red brightness value, green brightness value, and blue brightness value of each pixel point are obtained through the brightness characteristics of the red channel information, green channel information, and blue channel information, and the color richness corresponding to the image separation element is obtained based on the corresponding red brightness value, green brightness value, and blue brightness value of each pixel point.

[0093] In the embodiments of the present disclosure, the following method can be adopted to obtain the color richness corresponding to the image separation element based on the corresponding red brightness value, green brightness value, and blue brightness value of each pixel point: Denote the difference between the red brightness value and the green brightness value of the pixel point as the first data, and take half of the sum of the red brightness value and the green brightness value of the pixel point as the second data. Then, denote the difference between the second data and the blue brightness value as the third data. Respectively obtain the first data, second data, and third data corresponding to each pixel point in the image separation element region corresponding to the image separation element. Respectively obtain the mean and variance of the first data and the mean and variance of the third data of the pixel points in the image separation element region corresponding to the image separation element, and take the square root of the sum of the variance of the first data and the variance of the third data to obtain the fourth data, that is Sum the squares of the means of the first data and the third data and take the square root to obtain the fifth data, i.e., Based on the fourth data, the weight of the fourth data, and the fifth data, determine the color richness corresponding to the image separation element, i.e., color richness = weight of the fourth data × fourth data + fifth data.

[0094] In the embodiments of the present disclosure, the color richness determined by the brightness characteristics of the red channel information, green channel information, and blue channel information in the image separation element area can better reflect the fineness of the color types and can more accurately reflect the visual effect of the image separation element area.

[0095] In the embodiments of the present disclosure, the color characteristics can be divided into intervals according to the classification requirements to achieve a better classification effect.

[0096] Figure 6 It is a flowchart of a method for dividing color characteristics shown according to an exemplary embodiment, as Figure 6 shown, including the following steps S61 and S62.

[0097] In step S61, determine the color characteristic value corresponding to the extracted color characteristic and determine the color characteristic interval where the value of the color characteristic is located.

[0098] In the embodiments of the present disclosure, the color characteristic interval is an interval containing a continuous range of values of the color characteristic. For example, the image contrast is divided into a first interval, a second interval, and a third interval, and the corresponding names are low contrast, medium contrast, and high contrast respectively.

[0099] In step S62, based on the name of the interval where the value of the color characteristic is located, replace the value of the color characteristic.

[0100] In the embodiments of the present disclosure, detect the interval range where the value of the color characteristic is located, and use the name of this interval to replace the value of the color characteristic. For example, if the interval name for an image contrast of 0 - 100 is set as low contrast, then if it is detected that the image contrast corresponding to a certain image separation element is 50, then replace the image contrast corresponding to this image separation element with low contrast.

[0101] In the embodiments of the present disclosure, by dividing the values of the color characteristics into intervals, the fineness of the color characteristic classification can be selected according to the requirements for the color characteristics, and the efficiency of data statistics and aggregation can be improved.

[0102] Through the color characteristic extraction method provided by the embodiments of the present disclosure, it can be applied to the color extraction of various images and improve the accuracy of color characteristic extraction. Figure 7It is a schematic diagram of the process of a method for extracting the color characteristics of a commodity shown according to an exemplary embodiment.

[0103] In Figure 7 The image for which color characteristics are to be extracted is a commodity advertisement image. The image separation elements include text, background, and commodity. The color characteristics include image contrast, color richness, pixel standard deviation, purity, brightness, hue, and lightness. Input the commodity advertisement image, and identify the text and commodity in the picture based on object detection. By erasing the text and commodity in the commodity advertisement image, the background is obtained. Respectively for the image separation elements in the commodity advertisement image, and respectively obtain the color characteristics corresponding to one or more of the image separation elements, that is, the color characteristics corresponding to the text, background, and commodity respectively, as well as the color characteristics corresponding to the text and background, background and commodity, text and commodity, and the color characteristics corresponding to the text, background, and commodity all together.

[0104] Through the color characteristic extraction method provided by the embodiments of the present disclosure, it can be applicable to the color characteristic extraction of various images for which color characteristics are to be extracted, and improve the accuracy and precision of color extraction. Figure 8a 、 Figure 8b And Figure 8c Are all schematic diagrams of the results of extracting the color characteristics of a commodity shown according to an exemplary embodiment.

[0105] In Figure 8a 、 Figure 8b And Figure 8c The image for which color characteristics are to be extracted is a commodity advertisement image, the color characteristic is purity, and the image separation elements include text, background, and commodity. Among them, Figure 8a 、 Figure 8b And Figure 8c The gray value in represents purity, and the lower the gray value, the lower the purity. By detecting the purity of all the image separation elements in Figure 8a 、 Figure 8b And Figure 8c That is, obtain the purity of all regions corresponding to the three image separation elements of text, background, and commodity. The interval name where the purity corresponding to Figure 8a Is located is called low purity, Figure 8b The interval name where the purity corresponding to is located is called medium purity, Figure 8c The interval name where the purity corresponding to is located is called high purity, then it is concluded that Figure 8a The purity of is low purity, Figure 8b The purity of is medium purity, Figure 8c The purity of is high purity.

[0106] In the embodiments of the present disclosure, by using an image to be subjected to color feature extraction based on image separation elements for separation, and respectively extracting the color features corresponding to one or more image separation elements. It is possible to perform color feature extraction on the local content of the image, and by obtaining color features such as the corresponding image contrast, color richness, and pixel standard deviation, etc., to accurately quantify the area corresponding to the image separation element, and to accurately describe the color features of the image.

[0107] Based on the same concept, the embodiments of the present disclosure also provide a color feature extraction device.

[0108] It can be understood that, in order to implement the above functions, the color feature extraction device provided by the embodiments of the present disclosure includes the corresponding hardware structure and / or software module for executing each function. Combining the units and algorithm steps of the various examples disclosed in the embodiments of the present disclosure, the embodiments of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving the hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to implement the described function, but such implementation should not be considered to exceed the scope of the technical solution of the embodiments of the present disclosure.

[0109] Figure 9 is a block diagram of a color feature extraction device 100 shown according to an exemplary embodiment. Referring to Figure 9 , the device includes an acquisition unit 101, a separation unit 102, and a processing unit 103.

[0110] The acquisition unit 101 is configured to acquire an image to be subjected to color feature extraction, and identify the image separation elements in the image, where the image separation elements are preset different color regions for color separation of the image.

[0111] The separation unit 102 is configured to separate the image separation elements in the image to obtain the image separation elements and the image background, where the image background is the remaining region in the image after removing the image separation elements.

[0112] The processing unit 103 is configured to respectively extract the color features corresponding to the image separation elements.

[0113] In one embodiment, the processing unit 103 is further configured to:

[0114] Save the extracted color features, and create a correspondence between the color features and most of the image separation elements.

[0115] In one embodiment, the color features include at least one of the following:

[0116] Image contrast; color richness; pixel standard deviation.

[0117] In one embodiment, the color feature includes image contrast, and the processing unit extracts the color feature corresponding to the image separation element in the following manner:

[0118] Obtain the image separation element area of the image separation element in the image, and for each pixel point in the image separation element area, respectively determine the first gray value of the pixel point and the second gray values of the four neighboring pixel points of the pixel point; based on the first gray value and the second gray values, determine the image contrast corresponding to the image separation element.

[0119] In one embodiment, the color feature includes pixel standard deviation. Extracting the color feature corresponding to the image separation element includes:

[0120] Obtain the image separation element area of the image separation element in the image, and determine the gray values of each pixel point in the image separation element area and the mean value of the gray values of each pixel point; determine the square of the difference between each pixel point gray value and the mean value as the pixel standard deviation corresponding to the image separation element.

[0121] In one embodiment, the color feature includes color richness. Extracting the color feature corresponding to the image separation element includes:

[0122] Obtain the image separation element area of the image separation element in the image, and determine the red channel information, green channel information, and blue channel information of the image separation element area in the red-green-blue color space; based on the brightness features of the red channel information, green channel information, and blue channel information, determine the color richness of the image separation element.

[0123] In one embodiment, the processing unit 103 is further configured to:

[0124] Determine the color feature value corresponding to the extracted color feature, and determine the color feature interval where the value of the color feature is located. The color feature interval is an interval that includes a continuous range of color feature values; based on the name of the interval where the value of the color feature is located, replace the value of the color measurement feature.

[0125] Regarding the device in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be elaborated here.

[0126] Figure 10 It is a block diagram of a device 200 for color feature extraction shown according to an exemplary embodiment. For example, the device 200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0127] Reference Figure 10 Figure 10 , the apparatus 200 may include one or more of the following components: a processing component 202, a memory 204, a power component 206, a multimedia component 208, an audio component 210, an input / output (I / O) interface 212, a sensor component 214, and a communication component 216.

[0128]

[0128] The processing component 202 generally controls the overall operation of the apparatus 200, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 202 may include one or more processors 220 to execute instructions to complete all or part of the steps of the above-described methods. In addition, the processing component 202 may include one or more modules to facilitate interaction between the processing component 202 and other components. For example, the processing component 202 may include a multimedia module to facilitate interaction between the multimedia component 208 and the processing component 202.

[0129]

[0129] The memory 204 is configured to store various types of data to support the operation of the apparatus 200. Examples of such data include instructions for any application or method operating on the apparatus 200, contact data, phone book data, messages, pictures, videos, and the like. The memory 204 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0130]

[0130] The power component 206 provides power to the various components of the apparatus 200. The power component 206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 200.

[0131] The multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of the touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 208 includes a front camera and / or a rear camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0132] The audio component 210 is configured to output and / or input audio signals. For example, the audio component 210 includes a microphone (MIC) that is configured to receive external audio signals when the device 200 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 204 or transmitted via the communication component 216. In some embodiments, the audio component 210 further includes a speaker for outputting audio signals.

[0133] The I / O interface 212 provides an interface between the processing component 202 and a peripheral interface module, and the peripheral interface module can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power button, and a lock button.

[0134] The sensor component 214 includes one or more sensors for providing a status assessment of various aspects of the device 200. For example, the sensor component 214 can detect the on / off state of the device 200, the relative positioning of components, such as the display and the keypad of the device 200. The sensor component 214 can also detect a change in the position of the device 200 or a component of the device 200, the presence or absence of user contact with the device 200, the orientation or acceleration / deceleration of the device 200, and the temperature change of the device 200. The sensor component 214 can include a proximity sensor that is configured to detect the presence of nearby objects without any physical contact. The sensor component 214 can also include a light sensor, such as a CMOS or a CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 214 can further include an acceleration sensor, a gyro sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0135] The communication component 216 is configured to facilitate communication between the device 200 and other devices in a wired or wireless manner. The device 200 may access a communication standard-based wireless network, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 216 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0136] In an exemplary embodiment, the device 200 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described method.

[0137] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as the memory 204 including instructions, and the above instructions can be executed by the processor 220 of the device 200 to complete the above method. For example, the non-transitory computer-readable storage medium may be a ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0138] It can be understood that "a plurality of" in the present disclosure means two or more, and other quantifiers are similar thereto. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. The singular forms of "a", "the", and "said" are also intended to include the plural forms unless the context clearly indicates otherwise.

[0139] It can be further understood that the terms "first", "second", etc. are used to describe various information, but this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other and do not represent a specific order or importance. In fact, the expressions such as "first" and "second" can be used interchangeably. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.

[0140] It can be further understood that, unless otherwise specified, "connection" includes both direct connection without other components between two elements and indirect connection with other elements between two elements.

[0141] It can be further understood that although operations are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be construed as requiring these operations to be performed in the specific order shown or in a serial order, or requiring all the operations shown to obtain the desired result. In certain environments, multitasking and parallel processing may be advantageous.

[0142] Other embodiments of the present disclosure will be readily contemplated by those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed in the present disclosure.

[0143] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A method for extracting color features, characterized in that, comprising: Obtaining an image to be subjected to color feature extraction, and identifying image separation elements in the image, where the image separation elements are preset different color regions for performing color separation on the image; Separating the image separation elements in the image, and respectively extracting the color features corresponding to the image separation elements.

2. The method according to claim 1, characterized in that, the method further comprises: Saving the extracted color features, and creating a correspondence between the color features and the image separation elements.

3. The method according to claim 1 or 2, characterized in that, the color features include at least one of the following: Image contrast; Color richness; Pixel standard deviation.

4. The method according to claim 3, characterized in that, the color features include image contrast, and the extracting the color features corresponding to the image separation elements includes: Obtaining the image separation element region of the image separation element in the image, and for each pixel point in the image separation element region, respectively determining a first gray value of the pixel point and a second gray value of the four-neighbor pixel points of the pixel point; Based on the first gray value and the second gray value, determining the image contrast corresponding to the image separation element.

5. The method according to claim 3, characterized in that, the color features include pixel standard deviation, and the extracting the color features corresponding to the image separation elements includes: Obtaining the image separation element region of the image separation element in the image, and determining the gray values of each pixel point in the image separation element region and the mean value of the gray values of each pixel point; Determining the square of the difference between each pixel point gray value and the mean value as the pixel standard deviation corresponding to the image separation element.

6. The method according to claim 3, characterized in that, the color features include color richness, and the extracting the color features corresponding to the image separation elements includes: Obtaining the image separation element region of the image separation element in the image, and determining the red channel information, green channel information, and blue channel information of the image separation element region in the red-green-blue color space; Based on the brightness characteristics of the red channel information, the green channel information, and the blue channel information, determining the color richness of the image separation element.

7. The color feature extraction method according to claim 1, characterized in that, the method further comprises: Determining the color feature values corresponding to the extracted color features, and determining the color feature interval in which the values of the color features are located, where the color feature interval is an interval containing a continuous range of color feature values; Based on the name of the interval in which the values of the color features are located, replacing the values of the color features.

8. A color feature extraction device, characterized in that, comprising: An obtaining unit for obtaining an image to be subjected to color feature extraction, and identifying image separation elements in the image, where the image separation elements are preset different color regions for performing color separation on the image; A processing unit, configured to separate the image separation elements from the image and extract the color features corresponding to the image separation elements respectively.

9. The apparatus according to claim 8, wherein, the processing unit is further configured to: save the extracted color features and create a correspondence between the color features and the image separation elements.

10. The apparatus according to claim 8 or 9, wherein, the color features include at least one of the following: image contrast; color richness; pixel standard deviation.

11. The apparatus according to claim 10, wherein, the color features include image contrast, and the processing unit extracts the color features corresponding to the image separation elements in the following manner: obtain the image separation element region of the image separation element in the image, and for each pixel point in the image separation element region, respectively determine the first gray value of the pixel point and the second gray values of the four neighboring pixel points of the pixel point; based on the first gray value and the second gray values, determine the image contrast corresponding to the image separation element.

12. The apparatus according to claim 10, wherein, the color features include pixel standard deviation, and the processing unit extracts the color features corresponding to the image separation elements in the following manner: obtain the image separation element region of the image separation element in the image, and determine the gray values of each pixel point in the image separation element region and the mean value of the gray values of each pixel point; determine the square of the difference between each pixel point gray value and the mean value as the pixel standard deviation corresponding to the image separation element.

13. The apparatus according to claim 10, wherein, the color features include color richness, and the processing unit extracts the color features corresponding to the image separation elements in the following manner: obtain the image separation element region of the image separation element in the image, and determine the red channel information, green channel information, and blue channel information of the image separation element region in the red-green-blue color space; based on the brightness characteristics of the red channel information, the green channel information, and the blue channel information, determine the color richness of the image separation element.

14. The color feature extraction apparatus according to claim 8, wherein, the processing unit is further configured to: determine the color feature values corresponding to the extracted color features and determine the color feature interval in which the values of the color features are located, the color feature interval being an interval containing a continuous range of color feature values; replace the values of the color features based on the name of the interval in which the values of the color features are located.

15. A color feature extraction apparatus, wherein, comprises: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to: execute the method according to any one of claims 1 to 7.

16. A storage medium, wherein, Instructions are stored in the storage medium, and when the instructions in the storage medium are executed by a processor of a terminal, the terminal is enabled to execute the method according to any one of claims 1 to 7.