Color recognition method and device, electronic equipment and storage medium

By using different exposure times to acquire images and performing feature value analysis in the object recognition system, the problem of low efficiency and accuracy in object color recognition is solved, and efficient and accurate automated color recognition is achieved.

CN114677527BActive Publication Date: 2026-04-24SHENZHEN UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN UNIV
Filing Date
2022-03-21
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing technologies for color recognition of objects are inefficient and inaccurate, especially for mixed colors, which are difficult to identify, resulting in low efficiency and accuracy for manual recognition.

Method used

By controlling a preset camera to acquire initial images of an object at different exposure times, object region detection and pixel sampling are performed to obtain feature values. Color recognition is then achieved using cluster analysis and feature vector calculation, and automated processing is realized in conjunction with a collection device.

Benefits of technology

It improves the efficiency and accuracy of color recognition, reduces the amount of data to be processed, and achieves automated, efficient, and accurate color recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114677527B_ABST
    Figure CN114677527B_ABST
Patent Text Reader

Abstract

The present application relates to the field of artificial intelligence, and discloses a color recognition method, comprising: controlling a preset camera to collect a first initial image and a second initial image of a to-be-classified article based on a first exposure time and a second exposure time; performing article region detection processing on the first initial image and the second initial image to obtain a first region image and a second region image; performing pixel point sampling processing on the first region image and the second region image to obtain a first pixel point set and a second pixel point set, obtaining a first feature value of each pixel point in the first pixel point set and a second feature value of each pixel point in the second pixel point set; and performing color recognition on the to-be-classified article based on the first feature value and the second feature value to obtain a color recognition result. The present application also provides a color recognition device, an electronic device and a storage medium. The present application improves the color recognition efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence, and more particularly to a color recognition method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the development of technology, there are more and more items, and the colors of these items are becoming increasingly diverse. People's demand for color recognition of items is growing. For example, color recognition of waste textiles can be used to recycle fibers of different colors based on the color recognition results, achieving the goal of recycling and reuse.

[0003] Currently, color recognition of objects is typically performed manually. However, manual recognition is inefficient and inaccurate. Furthermore, the presence of mixed colors within the same object (e.g., red and yellow mixed in different proportions) increases the difficulty of color recognition, further reducing the efficiency and accuracy of manual methods. Therefore, a color recognition method is urgently needed to improve both efficiency and accuracy. Summary of the Invention

[0004] In view of the above, it is necessary to provide a color recognition method, device, electronic device and storage medium, with the aim of improving the efficiency and accuracy of color recognition.

[0005] The color recognition method provided by this invention includes:

[0006] When the item to be sorted is detected to have arrived at the preset position of the conveyor, the preset camera is controlled to acquire the first initial image and the second initial image of the item to be sorted based on the first exposure time and the second exposure time, respectively.

[0007] Item region detection processing is performed on the first initial image and the second initial image respectively to obtain the first region image and the second region image;

[0008] Pixel sampling processing is performed on the first region image and the second region image respectively to obtain a first pixel set and a second pixel set. The first feature value of each pixel in the first pixel set and the second feature value of each pixel in the second pixel set are obtained.

[0009] The color of the item to be classified is identified based on the first feature value and the second feature value to obtain the color recognition result.

[0010] Optionally, when the item to be classified is detected to have arrived at a preset position on the conveying device, the preset camera is controlled to acquire a first initial image and a second initial image of the item to be classified based on a first exposure time and a second exposure time, respectively, including:

[0011] When the item to be sorted is detected to have arrived at the preset position of the conveying device, the stop time of the conveying device and the first start time of the preset camera are determined, and the first exposure time and the second exposure time of the preset camera are obtained.

[0012] The operation of the conveying device shall be stopped at the specified stop time;

[0013] Based on the first start-up time and the first exposure time, the preset camera is controlled to acquire the first initial image of the item to be classified.

[0014] Based on the second exposure time, the preset camera is controlled to acquire a second initial image of the item to be classified.

[0015] Optionally, the step of performing color recognition on the item to be classified based on the first feature value and the second feature value to obtain a color recognition result includes:

[0016] The initial color category of the item to be classified is determined based on the first feature value;

[0017] If the initial color category is any color category in the preset color category set, then the initial color category is taken as the target color category of the item to be classified.

[0018] If the initial color category does not belong to any color category in the preset color category set, then the target color category of the item to be classified is determined based on the second feature value.

[0019] Optionally, determining the initial color category of the item to be classified based on the first feature value includes:

[0020] Perform cluster analysis on the first feature value to obtain the third feature value of each cluster center;

[0021] Calculate the initial feature mean based on the third feature value, and calculate the feature vector corresponding to the first region image based on the third feature value and the initial feature mean.

[0022] Obtain the standard vector corresponding to each color category at the first exposure time, and calculate the similarity value between the feature vector and the standard vector corresponding to each color category.

[0023] The initial color category of the item to be classified is determined based on the similarity value.

[0024] Optionally, calculating the feature vector corresponding to the first region image based on the third feature value and the initial feature mean includes:

[0025] Calculate the distance between the third feature value of each cluster center and the initial feature mean;

[0026] Denoising is performed based on the distance value, and the feature vector corresponding to the first region image is calculated based on the denoising result.

[0027] Optionally, after obtaining the color recognition result, the method further includes:

[0028] Based on the color recognition results, determine the collection device corresponding to the item to be classified, and calculate the second start-up time and collection time of the collection device;

[0029] The collection device is activated at the second start time, and the collection device is controlled to collect the items to be sorted during the collection time.

[0030] Optionally, the end of the conveying device is provided with an end detector and an end collection device, and the method further includes:

[0031] The end-point detector is controlled to detect whether there are items to be sorted at the end of the conveying device;

[0032] If so, the items to be sorted will be collected into the end collection device.

[0033] To address the above problems, the present invention also provides a color recognition device, the device comprising:

[0034] The acquisition module is used to control the preset camera to acquire a first initial image and a second initial image of the item to be classified based on a first exposure time and a second exposure time when the item to be classified is detected to have arrived at the preset position of the conveying device.

[0035] The detection module is used to perform object region detection processing on the first initial image and the second initial image respectively to obtain the first region image and the second region image;

[0036] The sampling module is used to perform pixel sampling processing on the first region image and the second region image respectively to obtain a first pixel set and a second pixel set, and to obtain a first feature value of each pixel in the first pixel set and a second feature value of each pixel in the second pixel set.

[0037] The identification module uses a pre-defined feature value and a second feature value to perform color identification on the item to be classified, and obtains the color identification result.

[0038] To address the above problems, the present invention also provides an electronic device, the electronic device comprising:

[0039] At least one processor; and,

[0040] A memory communicatively connected to the at least one processor; wherein,

[0041] The memory stores a color recognition program that can be executed by the at least one processor, the color recognition program being executed by the at least one processor to enable the at least one processor to perform the above-described color recognition method.

[0042] To address the aforementioned problems, the present invention also provides a computer-readable storage medium storing a color recognition program, which can be executed by one or more processors to implement the aforementioned color recognition method.

[0043] Compared to existing technologies, this invention first controls a preset camera to acquire a first initial image and a second initial image of the item to be classified based on a first exposure time and a second exposure time, respectively. Next, item region detection processing is performed on the first initial image and the second initial image, respectively, to obtain a first region image and a second region image. Then, pixel sampling processing is performed on the first region image and the second region image, respectively, to obtain a first pixel set and a second pixel set. A first feature value is obtained for each pixel in the first pixel set, and a second feature value is obtained for each pixel in the second pixel set. Finally, color recognition is performed on the item to be classified based on the first feature value and the second feature value to obtain the color recognition result. This invention reduces the amount of data to be processed and improves color recognition efficiency by sampling the images; it improves color recognition accuracy by using the first and second feature values. Therefore, this invention improves both the efficiency and accuracy of color recognition. Attached Figure Description

[0044] Figure 1 This is a schematic flowchart of a color recognition method provided in an embodiment of the present invention;

[0045] Figure 2 This is a schematic diagram of a color recognition device according to an embodiment of the present invention;

[0046] Figure 3 This is a schematic diagram of the structure of an electronic device that implements a color recognition method according to an embodiment of the present invention.

[0047] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0048] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0049] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0050] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.

[0051] It should be noted that the descriptions involving "first," "second," etc., in this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.

[0052] This invention provides a color recognition method. (Refer to...) Figure 1 The diagram shown is a schematic flowchart of a color recognition method according to an embodiment of the present invention. This method can be executed by an electronic device, which can be implemented in software and / or hardware.

[0053] In this embodiment, the color recognition method includes the following steps S1-S4:

[0054] S1. When the item to be classified is detected to have arrived at the preset position of the conveying device, the preset camera is controlled to acquire the first initial image and the second initial image of the item to be classified based on the first exposure time and the second exposure time, respectively.

[0055] In this embodiment, the items to be sorted are conveyed by a conveying device, with a certain distance between each pair of items on the conveying device. During the conveying process, image acquisition, pixel sampling, and color recognition are performed on the items to be sorted. The items to be sorted can be batches of waste textiles, and the preset camera can be an industrial camera.

[0056] The conveying device includes a drive motor, a frequency converter, driven rollers, and a conveyor belt. The conveyor belt can be a chain conveyor, a belt conveyor, or a combination of multiple methods. The speed of the conveyor belt can be controlled by the frequency converter.

[0057] The distance between every two items to be sorted on the conveyor belt can be determined based on the time required for color recognition. If the time from when the preset camera captures an image to when the color category of the item to be sorted is t, then the distance between every two items to be sorted is d >= vt, where v is the speed of the conveyor belt.

[0058] When the item to be classified is detected to have arrived at the preset position of the conveying device, the preset camera is controlled to acquire a first initial image and a second initial image of the item to be classified based on a first exposure time and a second exposure time, respectively, including the following steps A11-A14:

[0059] A11. When the items to be sorted are detected to have arrived at the preset position of the conveying device, the stop time of the conveying device and the first start time of the preset camera are determined, and the first exposure time and the second exposure time of the preset camera are obtained.

[0060] In this embodiment, the position of the item to be classified on the conveyor is detected by a laser detection transmitter. When the item to be classified reaches a preset position (for example, 2 meters away from the preset camera), the stopping time of the conveyor and the first start time of the preset camera are determined according to the position of the item to be classified, the running speed of the conveyor belt and the position of the preset camera. The stopping time is less than or equal to the first start time, so that the item to be classified stops exactly at the optimal shooting position of the preset camera, and a complete and clear image of the item to be classified can be captured.

[0061] To ensure the accuracy of position detection of items to be sorted, laser detection sensors can be installed in a through-beam manner, with the installation height determined based on the height of the conveyor belt and the items to be sorted.

[0062] In this embodiment, the first exposure time is shorter than the second exposure time. The first initial image captured based on the first exposure time is more suitable for light color recognition scenarios, while the second initial image captured based on the second exposure time is more suitable for dark color recognition scenarios.

[0063] A12. Stop the operation of the transmission device at the stop time;

[0064] A13. Based on the first start-up time and the first exposure time, control the preset camera to acquire the first initial image of the item to be classified;

[0065] In this embodiment, the optimal value of the first exposure time is determined according to the experimental verification method, and the first exposure time can be 600ms.

[0066] A14. Based on the second exposure time, control the preset camera to acquire a second initial image of the item to be classified.

[0067] According to experimental verification, the second exposure time can be 1500ms.

[0068] In another embodiment of the present invention, a lighting source is also provided next to the preset camera to avoid inaccurate images captured by the preset camera due to insufficient light. The lighting source may be a strip light source, a ring light source, or a planar light source, etc.

[0069] After the method controls the preset camera to acquire a second initial image of the item to be classified based on the second exposure time, the method further includes:

[0070] Restart the transmission device.

[0071] S2. Perform object region detection processing on the first initial image and the second initial image respectively to obtain the first region image and the second region image.

[0072] In this embodiment, the object regions in the first initial image and the second initial image are detected by contour detection methods to obtain the first region image and the second region image. The contour detection methods include various detection methods such as Canny operator, Sobel operator, Rewitt operator, Roberts operator, Robinson operator, Laplace operator, and Log operator.

[0073] S3. Perform pixel sampling processing on the first region image and the second region image respectively to obtain a first pixel set and a second pixel set, and obtain the first feature value of each pixel in the first pixel set and the second feature value of each pixel in the second pixel set.

[0074] In this embodiment, a variable step size method is used to sample pixels in the first region image and the second region image. For example, for row pixels in the image, the 5th, 8th, 10th, ... pixels are sampled respectively, and for column pixels, the 3rd, 4th, 6th, ... pixels are sampled respectively.

[0075] For the first region image and the second region image, the same pixels can be sampled, or different pixels can be sampled.

[0076] In this embodiment, the first and second feature values ​​can be obtained based on the R, G, and B values ​​in the RGB color space. For example, the first and second feature values ​​can be vectors.<R,G,B> For characterization, color spaces such as HSV and LAB can also be used instead of RGB color space.

[0077] S4. Based on the first feature value and the second feature value, perform color recognition on the item to be classified to obtain the color recognition result.

[0078] The step of performing color recognition on the item to be classified based on the first feature value and the second feature value to obtain the color recognition result includes the following steps B11-B13:

[0079] B11. Determine the initial color category of the item to be classified based on the first feature value;

[0080] Determining the initial color category of the item to be classified based on the first feature value includes the following steps C11-C14:

[0081] C11. Perform cluster analysis on the first feature value to obtain the third feature value of each cluster center;

[0082] In this embodiment, the k-means clustering algorithm is used to perform cluster analysis on the first feature value. The number of clusters C >> the number of color types. For example, S can be set to 100, and the third feature value of these 100 cluster centers is obtained.

[0083] C12. Calculate the initial feature mean based on the third feature value, and calculate the feature vector corresponding to the first region image based on the third feature value and the initial feature mean;

[0084] The formula for calculating the initial feature mean is:

[0085]

[0086] Where U is the initial feature mean, G i V represents the number of pixels in the i-th cluster. i Let be the third feature value of the i-th cluster center, and C be the total number of clusters.

[0087] The calculation of the feature vector corresponding to the first region image based on the third feature value and the initial feature mean includes the following steps D11-D12:

[0088] D11. Calculate the distance between the third feature value of each cluster center and the initial feature mean;

[0089] The distance value can be a Euclidean distance, a cosine distance, a Manhattan distance, a Chebyshev distance, or a Hamming distance.

[0090] D12. Perform denoising processing based on the distance value, and calculate the feature vector corresponding to the first region image based on the denoising processing result.

[0091] If there are 100 distance values, they are statistically analyzed to obtain a distance value distribution map. The distance values ​​at both ends of the distance value distribution map are removed as noise. For example, if 10% of the distance values ​​at both ends are removed, 90 distance values ​​remain. The average of the third feature values ​​of the cluster centers corresponding to these 90 distance values ​​is calculated to obtain the feature vector corresponding to the first region image.

[0092] C13. Obtain the standard vector corresponding to each color category at the first exposure time, and calculate the similarity value between the feature vector and the standard vector corresponding to each color category respectively;

[0093] In this embodiment, multiple sample images acquired by a preset camera at the first exposure time are analyzed in advance to obtain a standard vector corresponding to each color category at the first exposure time.

[0094] C14. Determine the initial color category of the item to be classified based on the similarity value.

[0095] In this embodiment, the similarity value can be a cosine distance value, and the color category corresponding to the smallest cosine distance value is taken as the initial color category of the item to be classified.

[0096] B12. If the initial color category is any color category in the preset color category set, then the initial color category shall be used as the target color category of the item to be classified.

[0097] In this embodiment, the color category in the preset color category set is the light color category.

[0098] B13. If the initial color category does not belong to any color category in the preset color category set, then the target color category of the item to be classified is determined based on the second feature value.

[0099] If the initial color category is not a light color, for example, if the initial color category is black or dark blue, then the second region image is used to perform color recognition on the items to be classified. The process of color recognition using the second region image is similar to the process of color recognition using the first region image. The difference is that the standard vector is the standard vector of each color category corresponding to the second exposure time.

[0100] After obtaining the color recognition result, the method further includes the following steps E11-E12:

[0101] E11. Determine the collection device corresponding to the item to be classified based on the color recognition result, and calculate the second start-up time and collection time of the collection device;

[0102] In this embodiment, each color category corresponds to a collection device. Each collection device includes a collection bucket, a baffle, a baffle rotation mechanism, and a baffle plate. Each collection device is located at a different position on the conveyor belt (e.g., located on one side of the conveyor belt, or distributed on both sides of the conveyor belt). Adjacent collection devices are separated by baffle plates.

[0103] Once the color category of the item to be sorted corresponds to the collection device, the collection device can be started immediately or after a delay. That is, the second start time of the collection device can be less than or equal to a preset time threshold (e.g., less than 3 seconds). Then, the collection time of the collection device is calculated based on the location of the collection device, the location of the item to be sorted, and the running speed of the conveyor belt.

[0104] E12. Activate the collection device at the second start time, and control the collection device to collect the items to be classified during the collection time.

[0105] The initial state of the baffle in the collection device is parallel to the conveyor belt. At the second start time, the collection device corresponding to the color category of the items to be classified is activated, and its baffle rotation mechanism is activated, rotating the baffle so that it is perpendicular to the conveyor belt. During the collection time, the baffle rotation mechanism is controlled to rotate, collecting the items to be classified into the corresponding collection bin. In this embodiment, after collecting the items to be classified into the collection bin, the collection device is reset so that the baffle remains parallel to the conveyor belt. In another embodiment, the collection operation and the reset operation can be performed together. For example, when the items to be classified reach the area where the collection device is located, the baffle rotation mechanism is controlled to reset, rotating the baffle from a vertical state to a horizontal state. During the rotation, the items to be classified are pushed into the collection bin, and when the rotation ends, the baffle is parallel to the conveyor belt.

[0106] The lever rotation mechanism can be implemented using pneumatic (e.g., cylinder) or electric (e.g., motor) methods.

[0107] The end of the conveying device is provided with an end detector and an end collection device, and the method further includes the following steps F11-F12:

[0108] F11. Control the end detector to detect whether there are items to be sorted at the end of the conveying device;

[0109] In this embodiment, an end detector and an end collection device are provided at the end of the conveying device (i.e., after the collection device corresponding to each color category). The end detector can be a laser detection sensor, and the end collection device has the same structure as the collection device corresponding to each color category.

[0110] F12. If so, the items to be classified shall be collected into the end collection device.

[0111] If there are items to be sorted at the end of the conveyor, it means that the items have not been collected into the collection device corresponding to their color category, so they are collected into the end collection device.

[0112] After collecting the items to be sorted into the terminal collection device, the method further includes:

[0113] If the number of items to be classified collected by the terminal collection device exceeds a quantity threshold within a preset time period, a warning message is sent to a preset client.

[0114] For example, if the number of items to be sorted collected by the end-of-line collection device exceeds 20 within half an hour, it indicates that the system is malfunctioning. An early warning message can be sent to the administrator's corresponding client to remind them to inspect and adjust the system.

[0115] As described in the above embodiments, the color recognition method proposed in this invention firstly controls a preset camera to acquire a first initial image and a second initial image of the item to be classified based on a first exposure time and a second exposure time, respectively. Next, item region detection processing is performed on the first initial image and the second initial image to obtain a first region image and a second region image, respectively. Then, pixel sampling processing is performed on the first region image and the second region image to obtain a first pixel set and a second pixel set. A first feature value for each pixel in the first pixel set and a second feature value for each pixel in the second pixel set are obtained. Finally, color recognition is performed on the item to be classified based on the first feature value and the second feature value to obtain the color recognition result. This invention reduces the amount of data to be processed and improves color recognition efficiency by sampling the image; it improves color recognition accuracy by using the first and second feature values. Therefore, this invention improves both the efficiency and accuracy of color recognition.

[0116] like Figure 2 The diagram shown is a schematic diagram of a color recognition device provided in an embodiment of the present invention.

[0117] The color recognition device 100 of this invention can be installed in an electronic device. Depending on the functions implemented, the color recognition device 100 may include a data acquisition module 110, a detection module 120, a sampling module 130, and a recognition module 140. The module described in this invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and which are stored in the memory of the electronic device.

[0118] In this embodiment, the functions of each module / unit are as follows:

[0119] The acquisition module 110 is used to control the preset camera to acquire a first initial image and a second initial image of the item to be classified based on a first exposure time and a second exposure time when the item to be classified is detected to have arrived at the preset position of the conveying device.

[0120] When the item to be classified is detected to have arrived at the preset position of the conveying device, the preset camera is controlled to acquire a first initial image and a second initial image of the item to be classified based on a first exposure time and a second exposure time, respectively, including the following steps A21-A24:

[0121] A21. When the items to be sorted are detected to have arrived at the preset position of the conveying device, the stop time of the conveying device and the first start time of the preset camera are determined, and the first exposure time and the second exposure time of the preset camera are obtained.

[0122] A22. Stop the operation of the conveying device at the stop time;

[0123] A23. Based on the first start-up time and the first exposure time, control the preset camera to acquire the first initial image of the item to be classified;

[0124] A24. Based on the second exposure time, control the preset camera to acquire a second initial image of the item to be classified.

[0125] After the preset camera acquires a second initial image of the item to be classified based on the second exposure time, the acquisition module 110 is further configured to:

[0126] Restart the transmission device.

[0127] The detection module 120 is used to perform object region detection processing on the first initial image and the second initial image respectively to obtain the first region image and the second region image.

[0128] The sampling module 130 is used to perform pixel sampling processing on the first region image and the second region image respectively to obtain a first pixel set and a second pixel set, and to obtain a first feature value of each pixel in the first pixel set and a second feature value of each pixel in the second pixel set.

[0129] The recognition module 140 is used to perform color recognition on the item to be classified based on the first feature value and the second feature value, and obtain the color recognition result.

[0130] The step of performing color recognition on the item to be classified based on the first feature value and the second feature value to obtain the color recognition result includes the following steps B21-B23:

[0131] B21. Determine the initial color category of the item to be classified based on the first feature value;

[0132] B22. If the initial color category is any color category in the preset color category set, then the initial color category shall be used as the target color category of the item to be classified.

[0133] B23. If the initial color category does not belong to any color category in the preset color category set, then the target color category of the item to be classified is determined based on the second feature value.

[0134] Determining the initial color category of the item to be classified based on the first feature value includes the following steps C21-C24:

[0135] C21. Perform cluster analysis on the first feature value to obtain the third feature value of each cluster center;

[0136] C22. Calculate the initial feature mean based on the third feature value, and calculate the feature vector corresponding to the first region image based on the third feature value and the initial feature mean;

[0137] C23. Obtain the standard vector corresponding to each color category at the first exposure time, and calculate the similarity value between the feature vector and the standard vector corresponding to each color category respectively;

[0138] C24. Determine the initial color category of the item to be classified based on the similarity value.

[0139] The calculation of the feature vector corresponding to the first region image based on the third feature value and the initial feature mean includes the following steps D21-D22:

[0140] D21. Calculate the distance between the third feature value of each cluster center and the initial feature mean;

[0141] D22. Perform denoising processing based on the distance value, and calculate the feature vector corresponding to the first region image based on the denoising processing result.

[0142] After obtaining the color recognition result, the recognition module is further configured to perform the following steps E21-E22:

[0143] E21. Determine the collection device corresponding to the item to be classified based on the color recognition result, and calculate the second start-up time and collection time of the collection device;

[0144] E22. Activate the collection device at the second start time, and control the collection device to collect the items to be classified during the collection time.

[0145] The end of the conveying device is provided with an end detector and an end collection device, and the identification module 140 is also used to implement the following steps F21-F22:

[0146] F21. Control the end detector to detect whether there are items to be sorted at the end of the conveying device;

[0147] F22. If so, the items to be classified shall be collected into the end collection device.

[0148] After the items to be sorted are collected into the terminal collection device, the identification module 140 is further configured to:

[0149] If the number of items to be classified collected by the terminal collection device exceeds a quantity threshold within a preset time period, a warning message is sent to a preset client.

[0150] like Figure 3 The diagram shown is a structural schematic of an electronic device that implements a color recognition method according to an embodiment of the present invention.

[0151] The electronic device 1 is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. The electronic device 1 can be a computer, a single network server, a server group composed of multiple network servers, or a cloud based on cloud computing, which is a type of distributed computing consisting of a super virtual computer composed of a group of loosely coupled computers.

[0152] In this embodiment, the electronic device 1 includes, but is not limited to, a memory 11, a processor 12, and a network interface 13 that can be interconnected via a system bus. The memory 11 stores a color recognition program 10, which can be executed by the processor 12. Figure 3Only the electronic device 1 with components 11-13 and color recognition program 10 is shown. Those skilled in the art will understand that... Figure 3 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0153] The memory 11 includes RAM and at least one type of readable storage medium. The RAM provides a cache for the operation of the electronic device 1; the readable storage medium can be a non-volatile storage medium such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the readable storage medium can be an internal storage unit of the electronic device 1, such as the hard disk of the electronic device 1; in other embodiments, the non-volatile storage medium can also be an external storage device of the electronic device 1, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 1. In this embodiment, the readable storage medium of the memory 11 is typically used to store the operating system and various application software installed on the electronic device 1, such as storing the code of the color recognition program 10 in one embodiment of the present invention. Furthermore, the memory 11 can also be used to temporarily store various types of data that have been output or will be output.

[0154] In some embodiments, processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. Processor 12 is typically used to control the overall operation of the electronic device 1, such as performing control and processing related to data interaction or communication with other devices. In this embodiment, processor 12 is used to run program code stored in memory 11 or process data, such as running color recognition program 10.

[0155] The network interface 13 may include a wireless network interface or a wired network interface, which is used to establish a communication connection between the electronic device 1 and the client (not shown in the figure).

[0156] Optionally, the electronic device 1 may further include a user interface, which may include a display, an input unit such as a keyboard, and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device 1 and to display a visual user interface.

[0157] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.

[0158] The color recognition program 10 stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When run in the processor 12, it can implement the above-mentioned color recognition method.

[0159] Specifically, the processor 12's implementation method for the aforementioned color recognition program 10 can be found in [reference needed]. Figure 1 The descriptions of the relevant steps in the corresponding embodiments are not repeated here.

[0160] Furthermore, if the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be non-volatile or otherwise. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).

[0161] The computer-readable storage medium stores a color recognition program 10, which can be executed by one or more processors to implement the above-described color recognition method.

[0162] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0163] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0164] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0165] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0166] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.

[0167] The blockchain referred to in this invention is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.

[0168] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. The term "second class" is used to indicate names and does not indicate any specific order.

[0169] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A color recognition method, characterized in that, The method includes: When the item to be classified is detected to have reached the preset position of the conveyor, the stop time of the conveyor and the first start time of the preset camera are determined. The first exposure time and the second exposure time of the preset camera are obtained. The operation of the conveyor is stopped at the stop time. Based on the first start time and the first exposure time, the preset camera is controlled to acquire the first initial image of the item to be classified. Based on the second exposure time, the preset camera is controlled to acquire the second initial image of the item to be classified. The first exposure time is the exposure time for light color recognition scenes, and the second exposure time is the exposure time for dark color recognition scenes. After the first initial image and the second initial image are acquired, the conveyor is restarted to acquire the initial image of the next item to be classified. The interval between every two items to be classified on the conveyor is determined according to the estimated time of color recognition. Item region detection processing is performed on the first initial image and the second initial image respectively to obtain the first region image and the second region image; Pixel sampling processing is performed on the first region image and the second region image respectively to obtain a first pixel set and a second pixel set. The first feature value of each pixel in the first pixel set and the second feature value of each pixel in the second pixel set are obtained. Cluster analysis is performed on the first feature value to obtain the third feature value of each cluster center. An initial feature mean is calculated based on the third feature value. The distance between the third feature value of each cluster center and the initial feature mean is calculated. Denoising processing is performed based on the distance value, and a feature vector corresponding to the first region image is calculated based on the denoising result. A standard vector corresponding to each color category at the first exposure time is obtained. The similarity value between the feature vector and the standard vector corresponding to each color category is calculated. The initial color category of the item to be classified is determined based on the similarity value. If the initial color category is any color category in the light color category set, then the initial color category is taken as the target color category of the item to be classified. If the initial color category does not belong to any color category in the light color category set, then the target color category of the item to be classified is determined based on the second feature value. The formula for calculating the initial feature mean is: Where U is the initial feature mean. Let be the number of pixels in the i-th cluster. Let be the third feature value of the i-th cluster center, and C be the total number of clusters.

2. The color recognition method as described in claim 1, characterized in that, After obtaining the color recognition result, the method further includes: Based on the color recognition results, determine the collection device corresponding to the item to be classified, and calculate the second start-up time and collection time of the collection device; The collection device is activated at the second start time, and the collection device is controlled to collect the items to be sorted during the collection time.

3. The color recognition method as described in claim 1, characterized in that, The end of the conveying device is provided with an end detector and an end collection device, and the method further includes: The end-point detector is controlled to detect whether there are items to be sorted at the end of the conveying device; If so, the items to be sorted will be collected into the end collection device.

4. A color recognition device, characterized in that, The device includes: The acquisition module is used to determine the stop time of the conveyor and the first start time of the preset camera when the detected item to be classified arrives at the preset position of the conveyor, acquire the first exposure time and the second exposure time of the preset camera, stop the operation of the conveyor at the stop time, control the preset camera to acquire the first initial image of the item to be classified based on the first start time and the first exposure time, control the preset camera to acquire the second initial image of the item to be classified based on the second exposure time, wherein the first exposure time is the exposure time for light color recognition scene, the second exposure time is the exposure time for dark color recognition scene, and restart the conveyor after the first initial image and the second initial image are acquired. The interval distance between every two items to be classified on the conveyor is determined according to the estimated time of color recognition. The detection module is used to perform object region detection processing on the first initial image and the second initial image respectively to obtain the first region image and the second region image; The sampling module is used to perform pixel sampling processing on the first region image and the second region image respectively to obtain a first pixel set and a second pixel set, and to obtain a first feature value of each pixel in the first pixel set and a second feature value of each pixel in the second pixel set. The identification module is used to perform cluster analysis on the first feature value to obtain the third feature value of each cluster center, calculate the initial feature mean based on the third feature value, calculate the distance between the third feature value of each cluster center and the initial feature mean, perform denoising processing based on the distance value, calculate the feature vector corresponding to the first region image based on the denoising processing result, obtain the standard vector corresponding to each color category corresponding to the first exposure time, calculate the similarity value between the feature vector and the standard vector corresponding to each color category, determine the initial color category of the item to be classified based on the similarity value, if the initial color category is any color category in the light color category set, then the initial color category is taken as the target color category of the item to be classified; if the initial color category does not belong to any color category in the light color category set, then the target color category of the item to be classified is determined based on the second feature value. The formula for calculating the initial feature mean is: Where U is the initial feature mean. Let be the number of pixels in the i-th cluster. Let be the third feature value of the i-th cluster center, and C be the total number of clusters.

5. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a color recognition program that can be executed by the at least one processor, the color recognition program being executed by the at least one processor to enable the at least one processor to perform the color recognition method as described in any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a color recognition program, which can be executed by one or more processors to implement the color recognition method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Color recognition method based on improved SLIC super-pixel segmentation algorithm

    CN105354599A

  • Visual detection method for products with different shades of colors

    CN108051453A

  • Clothing color analysis method and system, storage medium and computer equipment

    CN114092572A