Image color recognition method and clothing processing device

By combining the MSRCP algorithm and the KNN algorithm, the problem of inaccurate clothing color recognition in dark environments is solved, and accurate clothing color recognition and recommendation of appropriate washing programs are achieved, thereby improving the user experience.

CN115704150BActive Publication Date: 2025-09-16QINGDAO HAIER WASHING MASCH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110935683.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-16
Publication Date
2025-09-16
Estimated Expiration
2041-08-16

AI Technical Summary

Technical Problem

Existing color recognition methods are affected by ambient light in dark environments, resulting in inaccurate clothing color recognition, which in turn affects the selection of washing programs and reduces user experience.

Method used

The MSRCP algorithm is used to preprocess and restore the object image to remove the background influence. Then the KNN algorithm is used to analyze the RGB value of the restored image and the object color is determined in combination with the standard color of the database to avoid interference from environmental factors.

Benefits of technology

The accuracy and precision of image color recognition are improved, ensuring the accuracy of clothing color recognition, avoiding color mixing and damage of clothing, and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115704150B_ABST
    Figure CN115704150B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of smart home appliance technology, and specifically provides a method for recognizing image colors and a clothing processing device, aiming to solve the problem of inaccurate color recognition of existing items. To this end, the recognition method of the present invention includes the following steps: acquiring an item image; calling a first preset algorithm to restore the item image to obtain a restored image; calling a second preset algorithm to analyze the restored image; determining the item color based on the analysis results and multiple standard colors stored in a database, thereby effectively restoring the various colors in the item image and eliminating interference with image color recognition caused by environmental factors such as light intensity; calling the second preset algorithm to analyze the restored image, and based on the analysis results and in combination with multiple standard colors stored in the database, accurately identifying the item color in the restored image, accurately determining the item color, and improving the accuracy and precision of image color recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of smart home appliances, and specifically provides a method for recognizing image color and a clothing processing device. Background Art

[0002] As living standards improve, people's demands for smarter washing machines are increasing. For clothing, the most obvious characteristic is color. People expect washing machines to be even smarter, automatically acquiring attributes like color and recommending appropriate wash cycles and parameters based on the color of the clothing. This ensures not only cleans the clothes but also prevents damage, such as color transfer.

[0003] However, as the external environment changes during the image capture process, the captured image of the clothing is affected by external lighting and other factors, resulting in significant color differences between the imaged color and the actual color of the clothing. However, existing color recognition methods rely on images with normal colors, i.e., images captured after the capture and images with no significant color deviation from the clothing itself. When color recognition is performed based on the actual captured image, for example, images captured in dark scenes are affected by ambient light and cannot accurately identify the color of the clothing. This results in a deviation between the recognized color and the actual color of the clothing, which in turn leads to inappropriate recommended washing programs and a poor user experience.

[0004] Therefore, the art needs a new method for recognizing image color and a clothes treating device to solve the above problems. Summary of the Invention

[0005] The present invention aims to solve the above technical problem, that is, to solve the problem of inaccurate color recognition of existing objects.

[0006] In a first aspect, the present invention provides a method for identifying image color, comprising the following steps: acquiring an image of an object; reproducing the image of the object using a first preset algorithm to obtain a reproducing image; analyzing the reproducing image using a second preset algorithm; and determining the color of the object based on the analysis results and a plurality of standard colors stored in a database.

[0007] In the preferred technical solution of the above-mentioned identification method, the step of "calling the first preset algorithm to restore the object image to obtain a restored image" specifically includes: preprocessing the object image to obtain the main image of the object; calling the first preset algorithm to restore the main image to obtain a restored image.

[0008] In the preferred technical solution of the above-mentioned recognition method, the step of "preprocessing the object image to obtain the main image of the object" specifically includes: identifying the object in the object image and the coordinate position of the object in the image; and cutting out the main image from the object image according to the coordinate position to remove the background of the object image.

[0009] In the preferred technical solution of the above-mentioned identification method, the step of "cutting out the main image from the object image according to the coordinate position" specifically includes: cutting out the main image from the object image according to a preset method according to the coordinate position.

[0010] In the preferred technical solution of the above-mentioned identification method, the step of "calling a second preset algorithm to analyze the restored image" specifically includes: calling the second preset algorithm to analyze all RGB values ​​of the restored image to determine one of the all RGB values ​​as the primary RGB value; the step of "determining the color of the object based on the analysis results and multiple standard colors stored in the database" specifically includes: determining the color of the object based on the primary RGB value and the standard RGB values ​​of the multiple standard colors.

[0011] In the preferred technical solution of the above-mentioned identification method, the step of "determining the color of the object based on the main RGB value and the standard RGB values ​​of the multiple standard colors" specifically includes: calculating the similarity between the main RGB value and the standard RGB values ​​of the multiple standard colors respectively; and determining the color of the object based on the similarity.

[0012] In the preferred technical solution of the above-mentioned identification method, the step of "determining the color of the object based on the similarities" specifically includes: comparing all the calculated similarities, determining the maximum similarity based on the comparison results; and determining the standard color corresponding to the maximum similarity as the color of the object.

[0013] In the preferred technical solution of the above identification method, the similarity is represented by Euclidean distance or cosine distance.

[0014] In a preferred technical solution of the above identification method, the first preset algorithm is the MSRCP algorithm; and / or the second preset algorithm is the KNN algorithm.

[0015] In a second aspect, the present invention provides a clothing processing device, comprising: a processor; a memory for storing a plurality of program codes; the program codes are suitable for being loaded by the processor and executing any one of the identification methods described in the above preferred technical solutions.

[0016] In a preferred technical solution of the identification method of the present invention, an image of an object is acquired; a first preset algorithm is called to restore the image of the object to obtain a restored image; a second preset algorithm is called to analyze the restored image; and the color of the object is determined based on the analysis results and multiple standard colors stored in a database.

[0017] Compared with the technical solution in the prior art of directly determining the color of an object based on a captured image, the recognition method of the present invention, when identifying the color of an object, calls a first preset algorithm to restore the image of the object, which can effectively restore the various colors in the object image and eliminate the interference of environmental factors such as light intensity on image color recognition; calls a second preset algorithm to analyze the restored image, and based on the analysis results and combined with multiple standard colors stored in the database, can accurately identify the color of the object in the restored image, thereby accurately determining the color of the object and improving the accuracy and precision of image color recognition.

[0018] Furthermore, the object image is preprocessed to obtain the main image of the object, removing the influence of the background environment; then the first preset algorithm is called to restore the main image, which can more accurately restore the various colors in the object image, so that the colors in the restored image are infinitely close to the real colors, providing accurate image data for identifying the color of the object.

[0019] Furthermore, a second preset algorithm is called to analyze all RGB values ​​of the restored image to determine one of all RGB values ​​as the primary RGB value. The color of the object is determined based on the primary RGB value and the standard RGB values ​​of multiple standard colors. In this process, color recognition can be achieved without converting the color space, thereby avoiding color loss in the color recognition process, and being able to more accurately identify the image color, further improving the accuracy and precision of image color recognition.

[0020] Furthermore, the similarity between the main RGB value and the standard RGB values ​​of multiple standard colors is calculated respectively, and the color of the object is determined based on the similarity. That is, the color of the object can only be determined when the similarity meets the preset conditions, avoiding the occurrence of misidentification and further improving the accuracy and precision of image color recognition.

[0021] Furthermore, all the calculated similarities are compared, and the maximum similarity is determined based on the comparison results. The standard color corresponding to the maximum similarity is determined as the object color. In other words, the standard RGB value corresponding to the final determined object color has the greatest similarity with the main RGB value, and the colors of the two are closest, ensuring the accuracy and precision of the identified color.

[0022] In addition, the present invention also provides a washing machine, which includes a processor for executing various programs; and a memory for storing multiple programs; the program code is loaded by the processor and executes the recognition method of the present invention, which can accurately identify the image color and recommend a suitable washing program based on the identified color, thereby avoiding color bleeding of clothes and damage to clothes, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The identification method of the present invention will be described below with reference to the accompanying drawings and in combination with a washing machine, wherein:

[0024] Figure 1 It is the main flow chart of the identification method of the present invention;

[0025] Figure 2 is a flow chart of a method for restoring an object image according to the present invention;

[0026] Figure 3 is a flow chart of a method of analyzing a restored image and determining the color of an object based on the analysis result of the present invention;

[0027] Figure 4 The process of the method for determining the color of an object of the present invention is Figure 1 ;

[0028] Figure 5 The process of the method for determining the color of an object of the present invention is Figure 2 ;

[0029] Figure 6 It is a logic diagram of the identification method of the present invention. DETAILED DESCRIPTION

[0030] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are merely used to explain the technical principles of the present invention and are not intended to limit the scope of protection of the present invention. For example, although the present application is described in conjunction with a washing machine, the technical solution of the present invention is not limited thereto, and the recognition method can obviously also be applied to other technical fields applied to image recognition, such as dryers, integrated washing and drying machines, nursing machines, printing, e-commerce, product processing, etc., and such changes do not deviate from the principles and scope of the present invention.

[0031] It should be noted that, in the description of the present invention, the terms "first", "second", "third" and "fourth" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.

[0032] Furthermore, it should be noted that, in the description of the present invention, unless otherwise expressly specified or limited, the term "disposed" should be understood in a broad sense. For example, it can mean a fixed connection, a detachable connection, or an integral connection; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances.

[0033] Based on the technical problems raised in the background technology, the present invention provides a method for image color recognition, which aims to call a first preset algorithm to restore the image of an object, effectively restore the various colors in the object image, and eliminate the interference of environmental factors such as light intensity on image color recognition; call a second preset algorithm to analyze the restored image, and according to the analysis results and combined with multiple standard colors stored in the database, accurately identify the color of the object in the restored image, thereby accurately determining the color of the object, and improving the accuracy and precision of image color recognition.

[0034] See first Figure 1 , the identification method of the present invention is described. Figure 1 It is the main flow chart of the identification method of the present invention.

[0035] like Figure 1 As shown, the image color recognition method of the present invention includes the following steps:

[0036] S100, obtaining an image of an object;

[0037] S200, calling a first preset algorithm to restore the object image to obtain a restored image;

[0038] S300, calling a second preset algorithm to analyze the restored image;

[0039] S400: Determine the color of the object based on the analysis result and multiple standard colors stored in the database.

[0040] In step S100, an image of the object is captured by a camera or other photographing device.

[0041] Preferably, the first preset algorithm is the MSRCP algorithm. Using the MSRCP algorithm can accurately restore the object image, making the colors in the restored image infinitely close to the true colors. Alternatively, the first preset algorithm can also be another algorithm, such as the MSRCR algorithm, the SSR algorithm, or the MSR algorithm. Regardless of the algorithm used, the specific method for restoring the image corresponding to any algorithm does not constitute any limitation on the present invention.

[0042] Preferably, the second preset algorithm is a KNN algorithm. Using the KNN algorithm can accurately identify the color of objects in the restored image, thereby improving the accuracy and precision of image color recognition. Alternatively, the second preset algorithm may also employ other algorithms, such as an ANN algorithm, an LR algorithm, or a SVM algorithm. Regardless of the algorithm employed, the specific method of image analysis corresponding to any algorithm shall not constitute any limitation to the present invention.

[0043] Refer to the following Figure 2 , taking the MSRCP algorithm as an example, the method of restoring an object image of the present invention is described. Figure 2 It is a flow chart of the method for restoring an object image of the present invention.

[0044] like Figure 2 As shown, in step S200, the step of "calling the first preset algorithm to restore the object image to obtain a restored image" specifically includes:

[0045] S211, pre-processing the object image to obtain a main image of the object;

[0046] S212: Call the MSRCP algorithm to restore the main image to obtain a restored image.

[0047] In step S211, the object detection model preprocesses the object image to obtain a main image of the object. Specifically, the object detection model identifies the object in the image and its coordinate location within the image. Based on the coordinate location, the main image is captured from the object image to remove the background of the object image, thereby eliminating the influence of the background environment.

[0048] Furthermore, based on the coordinate positions, a pre-set method is used to capture the main image from the object image. The pre-set method may include setting a capture frame, moving the capture frame to a target position (i.e., the position indicated by the coordinate positions) based on the coordinate positions, and capturing the image within the capture frame at that time, with the captured image being the main image; or outlining the outline of the object based on the coordinate positions, capturing the image along the outline, with the captured image being the main image. Of course, the pre-set method is not limited to the methods listed above; any method adopted is sufficient as long as the main image can be captured from the image.

[0049] Preferably, the target detection model can be, but is not limited to, a RetinaNet model, an FCOS model, a Faster R-CNN model, an SPPNet model, an SSD model, a YOLO model, and the like.

[0050] In step S212, the MSRCP algorithm is called to restore the main image. Since the background of the object image is removed in step S211, the various colors in the object image can be more accurately restored during the image restoration process, especially for images taken in low-light environments. Of course, it can also be used to restore images taken in other environments, so that the colors in the restored image are infinitely close to the real colors, providing accurate image data for identifying the color of the object.

[0051] Refer to the following Figures 3 to 5 , taking the KNN algorithm as an example, the present invention describes the method for restoring an object image and determining the object color. Figure 3 is a flow chart of a method of analyzing a restored image and determining the color of an object based on the analysis result of the present invention;

[0052] Figure 4 The process of the method for determining the color of an object of the present invention is Figure 1 ; Figure 5 The process of the method for determining the color of an object of the present invention is Figure 2 .

[0053] like Figure 3 As shown, in step S300, the step of "calling the second preset algorithm to analyze the restored image" specifically includes:

[0054] S311 , calling a KNN algorithm to analyze all RGB values ​​of the restored image, so as to determine one of all RGB values ​​as a primary RGB value.

[0055] In step S311, the KNN algorithm divides the restored image into multiple clusters, for example, 3 clusters, 5 clusters, 10 clusters, or 15 clusters, counts the number of RGB values ​​identified in each cluster, compares the counted numbers, determines the maximum number, and determines the cluster corresponding to the maximum number as the target cluster; counts the probability of each RGB value in the target cluster, compares the counted probabilities, determines the maximum probability, and determines the RGB value corresponding to the maximum probability as the main RGB value.

[0056] The following is further explained using 3 clusters as an example.

[0057] Assume that 30 RGB values ​​are identified in the first cluster, 40 RGB values ​​are identified in the second cluster, and 50 RGB values ​​are identified in the third cluster. 30, 40, and 50 are compared. It is found that 50 is the largest number. The third cluster corresponding to the largest number is determined as the target cluster.

[0058] The probability of each RGB value in the third cluster is counted. For example, there are 4 RGB values ​​in the third cluster, among which the first RGB value appears 10 times, corresponding to a first probability of 20%; the second RGB value appears 20 times, corresponding to a second probability of 40%; the third RGB value appears 5 times, corresponding to a second probability of 10%; and the fourth RGB value appears 15 times, corresponding to a second probability of 30%. Comparing 10%, 20%, 30%, and 40%, it can be seen that 40% has the highest probability. The second RGB value corresponding to the highest probability is determined as the primary RGB value.

[0059] It should be noted that the number of RGB values ​​listed above and the number of times each RGB value appears are only exemplary and not restrictive. In actual applications, those skilled in the art can count the number of RGB values ​​and the number of times each RGB value appears based on actual clothing pictures.

[0060] Continue reading Figure 3 In step S400, the step of "determining the color of the object based on the analysis results and multiple standard colors stored in the database" specifically includes:

[0061] S411 , determining the color of the object according to the main RGB value and the standard RGB values ​​of multiple standard colors.

[0062] During the color recognition process, the color of the object can be determined based on the main RGB value and the standard RGB values ​​of multiple standard colors. Color recognition can be achieved without the need for color space conversion, thereby avoiding color loss during the color recognition process, and being able to more accurately identify the image color, further improving the accuracy and precision of image color recognition.

[0063] The specific determination method is as follows:

[0064] like Figure 4 As shown, in step S411, the step of "determining the color of the object according to the main RGB value and the standard RGB values ​​of multiple standard colors" specifically includes:

[0065] S421, respectively calculating the similarity between the main RGB value and the standard RGB values ​​of multiple standard colors;

[0066] S422: Determine the color of the object based on the similarity.

[0067] The similarity is expressed by Euclidean distance; of course, the similarity can also be expressed by cosine distance.

[0068] The following is further explained using Euclidean distance as an example.

[0069] In step S421, assuming that three standard colors are stored in the database, each corresponding to a standard RGB value, the Euclidean distances between the primary RGB value and the standard RGB values ​​of the three standard colors are calculated. For example, the calculated Euclidean distances between the primary RGB value and the standard RGB values ​​of the three standard colors are 0.05, 0.2, and 0.3, respectively. Of course, each standard color may also correspond to multiple standard RGB values.

[0070] Of course, the number of standard RGB values ​​can also be other numbers such as 1366, 2000, 500 or 100 standard colors. Those skilled in the art can flexibly adjust and set the number of standard RGB values ​​according to actual usage requirements.

[0071] like Figure 5 As shown, in step S422, the step of "determining the color of the object based on the similarity" specifically includes:

[0072] S431, comparing all the calculated similarities, and determining the maximum similarity based on the comparison results;

[0073] S432: Determine the standard color corresponding to the maximum similarity as the object color.

[0074] In step S431, for example, the Euclidean distances calculated in step S421 are 0.05, 0.2, and 0.3, respectively. 0.05, 0.2, and 0.3 are compared, and it can be seen that 0.05 is the minimum Euclidean distance. Since the smaller the Euclidean distance, the greater the similarity, the similarity corresponding to the minimum Euclidean distance of 0.05 is the largest. The similarity corresponding to the minimum Euclidean distance of 0.05 is determined as the maximum similarity, for example, the maximum similarity is 95%.

[0075] In step S432 , the standard color corresponding to the maximum similarity of 95% (ie, the Euclidean distance of 0.05) is determined as the object color, for example, bright red.

[0076] In the above process, the standard RGB value corresponding to the object color finally determined has the greatest similarity with the main RGB value, and the colors of the two are closest, ensuring the accuracy and precision of the recognized color and avoiding misidentification.

[0077] It should be noted that the Euclidean distance, maximum similarity, and color corresponding to the maximum similarity listed above are merely exemplary and not restrictive. In practical applications, those skilled in the art can calculate the Euclidean distance based on actual object images and determine the maximum similarity and the color corresponding to the maximum similarity based on the Euclidean distance.

[0078] Refer to the following Figure 6, taking the MSRCP algorithm, KNN algorithm and three standard colors as examples, a possible control process of the present invention is introduced. Figure 6 It is a logic diagram of the recognition method of the present invention, wherein each standard color corresponds to a standard RGB value.

[0079] like Figure 6 As shown, a possible complete process of the identification method of the present invention is:

[0080] S501, capturing an image of an object using a camera;

[0081] S502: Preprocess the object image to obtain a main image of the object;

[0082] S503, calling the MSRCP algorithm to restore the subject image to obtain a restored image;

[0083] S504: Calling a KNN algorithm to analyze all RGB values ​​of the restored image to determine one of the RGB values ​​as a primary RGB value;

[0084] S505, respectively calculating the similarity between the main RGB value and the standard RGB values ​​of three standard colors, namely S1, S2 and S3;

[0085] S506: Compare S1, S2 and S3, and determine the maximum similarity S according to the comparison result. max ;

[0086] S507, will be with S max The corresponding standard color is determined as the item color.

[0087] It should be pointed out that the above embodiment is only a preferred embodiment of the present invention and is only used to illustrate the principle of the method of the present invention. It is not intended to limit the scope of protection of the present invention. In actual applications, those skilled in the art can allocate the above functions to different steps as needed, that is, decompose or combine the steps in the embodiment of the present invention. For example, the steps of the above embodiment can be combined into one step, or further divided into multiple sub-steps to complete all or part of the functions described above. The names of the steps involved in the embodiments of the present invention are only for distinguishing the steps and are not considered to be limitations of the present invention.

[0088] In addition, the present invention also provides a washing machine, which includes a processor and a memory, wherein the memory is used to store multiple program codes; wherein the program codes are loaded by the processor and execute any one of the identification methods in the above-mentioned embodiments.

[0089] The camera and database are both installed on the washing machine. When the washing machine needs to identify the color of clothing, the camera can capture an image of the clothing. The program is loaded by the processor based on the image of the clothing captured by the camera and executes any of the recognition methods in the above embodiments. This accurately identifies the color of the image and recommends an appropriate washing program based on the identified color, thereby preventing color transfer and damage to the clothing, thereby improving the user experience.

[0090] Thus far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection of the present invention.

Claims

1. A method for identifying image color, characterized in that: The identification method comprises the following steps: Get the item image; Retrieving a first preset algorithm to restore the image of the object to obtain a restored image; Retrieving a second preset algorithm to analyze the restored image; Determine the color of the object based on the analysis results and multiple standard colors stored in the database; The calling of a second preset algorithm to analyze the restored image includes: Call the KNN algorithm to divide the restored image into multiple clusters, count the number of RGB values ​​identified in each cluster, compare the counted numbers, determine the maximum number, and determine the cluster corresponding to the maximum number as the target cluster; count the probability of each RGB value in the target cluster, compare the counted probabilities, determine the maximum probability, and determine the RGB value corresponding to the maximum probability as the main RGB value; Determining the color of the object based on the analysis results and multiple standard colors stored in the database includes: respectively calculating similarities between the main RGB value and standard RGB values ​​of the plurality of standard colors; Comparing all the calculated similarities, and determining the maximum similarity according to the comparison results; The standard color corresponding to the maximum similarity is determined as the object color.

2. The identification method according to claim 1, characterized in that The step of “retrieving the first preset algorithm to restore the object image to obtain a restored image” specifically includes: Preprocessing the object image to obtain a main image of the object; The first preset algorithm is called to restore the subject image to obtain a restored image.

3. The identification method according to claim 2, characterized in that The step of "preprocessing the object image to obtain a main image of the object" specifically includes: Identifying an object in the object image and the coordinate position of the object in the image; The main image is captured from the object image according to the coordinate position to remove the background of the object image.

4. The identification method according to claim 3, characterized in that The step of “cutting out the subject image from the object image according to the coordinate position” specifically includes: According to the coordinate position, the main body image is captured from the object image according to a preset method.

5. The identification method according to claim 1, characterized in that The similarity is represented by Euclidean distance or cosine distance.

6. A clothes processing device, comprising: processor; A memory, for storing a plurality of program codes; It is characterized in that the program code is suitable for being loaded by the processor and executing the identification method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Washing machine and method, and device for recognizing colors of clothes in washing machine

    CN105839355A

  • Identification device of clothes color in washing machine and washing machine with same

    CN105841817A