A color recognition system and a color recognition method thereof
By combining multi-color LED lighting and black and white industrial cameras, light source switching and image processing methods are adopted to solve the problems of high cost, high complexity and slow recognition speed of existing color recognition systems, and efficient and accurate color recognition is achieved.
Patent Information
- Application Number
- CN202510067229.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-04-08
AI Technical Summary
The existing color recognition system is costly, complex and slow to recognize, which cannot meet the real-time requirements of industrial applications.
A color recognition system combining multi-color LED lighting and black and white industrial cameras is used to identify the color band colors through light source switching and image processing.
It significantly reduces equipment investment, simplifies the system structure, improves identification speed and accuracy, and can meet the real-time needs of industrial applications.
Smart Images

Figure CN119779481A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of color recognition, and in particular to a base color recognition system and a recognition method thereof. Background Art
[0002] Color recognition plays an important role in the textile, packaging and printing industries. Existing technologies usually use color cameras and complex image processing algorithms for color recognition. This traditional recognition system has the following disadvantages: first, it is expensive. The price of color cameras and related processing equipment increases the investment of the overall system; second, the system is complex and difficult to integrate and maintain; finally, the processing speed is slow and cannot meet the real-time requirements of some industrial applications.
[0003] In view of the problems of the prior art, the present invention aims to provide a new color recognition system and method, which solves the problems of high cost, high complexity and slow recognition speed by combining multi-color LED lighting and black and white industrial cameras. Summary of the invention
[0004] In order to achieve the purpose of the present invention, the technical solution adopted by the present invention is: a color recognition system, comprising: Light source array: lamps are arranged as light sources; A ribbon conveying device, used for conveying the ribbon through the detection area; A black and white camera is installed above the detection area to shoot the color strip at a fixed angle; The control system is responsible for controlling the light sources of different colors to illuminate in sequence and triggering the black and white camera to take pictures; The image processing unit analyzes the image taken by the black and white camera and identifies the color of the color band by comparing the brightness changes under different light sources.
[0005] Preferably, the light source includes: a multi-color LED lamp or a monochromatic light source with different wavelengths.
[0006] Preferably, a recognition method of a color recognition system comprises: S1: Start the system, initialize the control system and camera; S2: light source switching and taking pictures; S3: Image processing; S4: Output recognition results.
[0007] Preferably, the light source switching and photographing include: S201: The three LED lights are turned on at the same time, and the black and white camera takes a picture to obtain an image under white light; S202: Turn on the red LED light, take a photo with the black and white camera, and obtain an image under red light; S203: Turn on the green LED light, take a picture with the black and white camera, and obtain an image under green light; S204: Light up the blue LED light, take a picture with the black and white camera, and obtain an image under the blue light; S205: The four images are taken as a group of data for subsequent image processing.
[0008] Preferably, the image processing includes: S301: Extracting the color band area: extracting the color band area in the white light image; according to the image processing method, the image segmentation technology may be used to identify and extract the area of the color band part; S302: Statistical ribbon gray value: According to the ribbon area obtained in the white light image, calculate the extreme or average gray value of the ribbon portion in each image; S303: Obtaining the grayscale change value of the color band: subtracting the average grayscale value of the color band area under different color lights from the average grayscale value of the color band area under white light; S304: Obtaining the color of the color band: The color of the color mark can be determined by the change in the grayscale value of the color mark under different lighting.
[0009] Preferably, the grayscale value extreme value or average value of the color band part in each image is calculated: Among them, under white light irradiation, the average gray value of the color band area is P w ; Under red light, the average gray value of the color band area is P r ; Under green light, the average gray value of the color band area is P g ; Under blue light, the average gray value of the color band area is P b .
[0010] Preferably, the grayscale value change value includes: Among them, the grayscale change value of the color band under red light and white light is D r =|P r -P w |; The grayscale change value of the color band under green light and white light is Dg=|P g -P w |; The grayscale change value of the color band under blue light and white light is Db=|P b -P w |.
[0011] Preferably, the determination of the change in the color scale value can be performed in the following manner: First, find the maximum value among the grayscale value changes, denoted as Dmax. Then, calculate the differences between Dmax and the grayscale value changes under the three kinds of light illuminations to obtain: The difference between the grayscale value of the color band under red light illumination and D max is S r = D max - D r ; The difference between the grayscale value of the color band under green light illumination and D max is S g = D max - D g ; The difference between the grayscale value of the color band under blue light illumination and D max is S b = D max - D b ; And compare the result with the set threshold T. If the value of S under a certain light illumination is greater than T, then this color is one of the component colors of the color band.
[0012] Preferably, if the change in the grayscale value of the color band under a certain light illumination is significantly lower than the changes in the grayscale values under the other two light illuminations, that is, there is S > T under a certain light illumination, it can be considered that the color of the color band is the color of this light; If the changes in the grayscale values of the color band under two light illuminations are not much different and are significantly lower than the change in the grayscale value under the last light illumination, and there is S > T under these two light illuminations at this time, then it can be considered that the color band is a mixed color of these two light colors; If S is less than T in the color band area under all three light illuminations, that is, S r < T, S g < T, S b < T, then it can be judged whether the color band is white or black according to the size of the average grayscale value of the color band area.
[0013] Compared with the prior art, the beneficial effects of the present invention are: 1. Using a black and white camera to replace a high - cost color camera significantly reduces the equipment investment.
[0014] 2. Simplify the system: By reducing the need for complex image - processing algorithms, the system is more concise and easy to use, improving the processing speed and the convenience of maintenance and operation.
[0015] 3. Improve the recognition speed and accuracy: Multiple light source illuminations and image comparisons make the recognition result more accurate and better meet the requirements of industrial applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1This is a control flow chart of the recognition method of the color recognition system in the present invention; Figure 2 This is a diagram showing the effect of white light irradiation under white color-coded paper in an embodiment of the present invention; Figure 3 This is a diagram showing the effect of red light irradiation under white color-coded paper in an embodiment of the present invention; Figure 4 This is a diagram showing the effect of green light irradiation under white color-coded paper in an embodiment of the present invention; Figure 5 This is a diagram showing the effect of blue light irradiation under white color-coded paper in an embodiment of the present invention; Figure 6 This is a diagram showing the effect of white light irradiation under black color-coded paper in an embodiment of the present invention; Figure 7 This is a diagram showing the effect of red light irradiation under black color-coded paper in an embodiment of the present invention; Figure 8 This is a diagram showing the effect of green light irradiation under black color-coded paper in an embodiment of the present invention; Fig. 9 This is a diagram showing the effect of blue light irradiation under black color-coded paper in an embodiment of the present invention. DETAILED DESCRIPTION
[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0018] Example: like Figures 1 to 3 As shown, the present invention provides a technical solution: a color recognition system, including: a light source array: lamps are arranged as light sources; the light source array uses multi-color LED light source array: LED lamps of multiple colors such as red, green, and blue are used as light sources, arranged in rows or matrices.
[0019] The light source array can also use monochromatic light sources of different wavelengths combined with multiple black and white cameras for parallel shooting, or use other types of light sources (such as white light LEDs plus filters) to achieve similar recognition purposes.
[0020] A ribbon conveying device, used for conveying the ribbon through the detection area; A black and white camera is installed above the detection area to shoot the color strip at a fixed angle; The control system is responsible for controlling the light sources of different colors to illuminate in sequence and triggering the black and white camera to take pictures; The image processing unit analyzes the image taken by the black and white camera and identifies the color of the color band by comparing the brightness changes under different light sources.
[0021] A recognition method of a color recognition system, comprising: S1: Start the system, initialize the control system and camera; S2: light source switching and taking pictures; Among them, light source switching and taking pictures include: S201: The three LED lights are turned on at the same time, and the black and white camera takes a picture to obtain an image under white light; S202: Turn on the red LED light, take a photo with the black and white camera, and obtain an image under red light; S203: Turn on the green LED light, take a picture with the black and white camera, and obtain an image under green light; S204: Light up the blue LED light, take a picture with the black and white camera, and obtain an image under the blue light; S205: The four images are taken as a group of data for subsequent image processing.
[0022] S3: Image processing; Among them, image processing includes: S301: Extract the color band area: extract the color band area in the white light image. According to the image processing method, the image segmentation technology can be selected to identify and extract the area of the color band part; S302: Statistical ribbon gray value: According to the ribbon area obtained in the white light image, calculate the extreme or average gray value of the ribbon portion in each image; Among them, under white light irradiation, the average gray value of the color band area is P w ; Under red light, the average gray value of the color band area is P r ; Under green light, the average gray value of the color band area is P g ; Under blue light, the average gray value of the color band area is P b ; S303: Obtaining the grayscale change value of the color band: subtracting the average grayscale value of the color band area under different color lights from the average grayscale value of the color band area under white light; Among them, the grayscale change value of the color band under red light and white light is D r =|P r -P w |; The grayscale change value of the color band under green light and white light is Dg=|P g -P w |; The gray-scale change value Db of the color band under blue light and white light irradiation is Db = |P b - P w |.
[0023] S304: Obtain the color of the color band: The color of the color target can be judged by the change in the gray-scale value of the color target under different light irradiations.
[0024] The judgment of the change magnitude of the color target value can be carried out in the following way: First, find the maximum value in the gray-scale change values, denoted as Dmax. Then, calculate the difference between Dmax and the gray-scale change values under the irradiation of three kinds of lights to obtain: The difference between the gray-scale value of the color band under red light irradiation and D max is S r = D max - D r ; The difference between the gray-scale value of the color band under green light irradiation and D max is S g = D max - D g ; The difference between the gray-scale value of the color band under blue light irradiation and D max is S b = D max - D b ; And compare the result with the set threshold T. If the value of S under a certain light irradiation is greater than T, then this color is one of the component colors of the color band.
[0025] If the change in the gray-scale value of the color band under a certain light irradiation is significantly lower than the change in the gray-scale values under the irradiation of the other two lights, that is, there is S > T under a certain light irradiation, it can be considered that the color of the color band is the color of this light; for example, S r > T, S g < T, S b < T, it can be considered that the color band is red.
[0026] If the change in the gray-scale value of the color band under the irradiation of two lights is not much different and is significantly lower than the change in the gray-scale value under the irradiation of the last light, at this time, there is S > T under the irradiation of two lights, then it can be considered that the color band is a mixed color of these two light colors; for example, S r < T, S g > T, S b > T, it can be considered that the color band is a mixed color of green and blue, that is, cyan.
[0027] If S is less than T in the color band area under the irradiation of all three lights, that is, S r < T, S g < T, S b<T, the color ribbon can be determined as white or black according to the average gray value of the color ribbon area.
[0028] Taking the color label paper with red, green, and blue color labels on a white background as an example: As Figure 2 described, under white light illumination: The characteristics of the color ribbon are more obvious under white light illumination. The area of the color ribbon part can be identified and extracted through image segmentation technology, and the gray values of each color ribbon area can be obtained.
[0029] As Figure 3 shown, under red light illumination, since the red color ribbon has the strongest ability to reflect red light, the extreme value change of the gray value of the red color ribbon area is not obvious, while the extreme value changes of the gray values of the other two color ribbon areas are obvious because they absorb red light.
[0030] As Figure 4 、 Figure 5 shown, under green light and blue light illumination, there are obvious extreme value changes in the gray values of the corresponding color ribbon areas. The change in the gray value of the red color ribbon area under red light is significantly smaller than the change in the gray value under the illumination of the other two lights. Based on this, it can be determined as the red color ribbon.
[0031] As Figures 6 to 9 shown, the color label paper on a black background can also detect the color of the color label according to the change in the gray value of the color label area: The change in the gray value of the red color ribbon area under red light is significantly smaller than the change in the gray value under the illumination of the other two lights. Based on this, it can be determined as the red color ribbon S4: Output the recognition result: Display or transmit the recognition result.
[0032] The embodiments disclosed in the present invention are preferred embodiments, but not limited thereto. Those of ordinary skill in the art can easily understand the spirit of the present invention based on the above embodiments and make different extensions and changes. As long as they do not depart from the spirit of the present invention, they are within the protection scope of the present invention.
Claims
1. A color recognition system, characterized in that: include: Light source array: lamps are arranged as light sources; A ribbon conveying device, used for conveying the ribbon through the detection area; A black and white camera is installed above the detection area to shoot the color strip at a fixed angle; The control system is responsible for controlling the light sources of different colors to illuminate in sequence and triggering the black and white camera to take pictures; The image processing unit analyzes the image taken by the black and white camera and identifies the color of the color band by comparing the brightness changes under different light sources.
2. The color recognition system according to claim 1, characterized in that: Light sources include: Multi-color LED lights or monochromatic light sources of different wavelengths.
3. A recognition method for the color recognition system according to any one of claims 1 to 2, characterized in that: include: S1: Start the system, initialize the control system and camera; S2: light source switching and taking pictures; S3: Image processing; S4: Output recognition results.
4. The recognition method of the color recognition system according to claim 3, characterized in that: The light source switching and photographing include: S201: The three LED lights are turned on at the same time, and the black and white camera takes a picture to obtain an image under white light; S202: Turn on the red LED light, take a photo with the black and white camera, and obtain an image under red light; S203: Turn on the green LED light, take a picture with the black and white camera, and obtain an image under green light; S204: Light up the blue LED light, take a picture with the black and white camera, and obtain an image under the blue light; S205: The four images are taken as a group of data for subsequent image processing.
5. The recognition method of the color recognition system according to claim 4, characterized in that: The image processing comprises: S301: extracting the color band area: extracting the color band area in the white light image; According to the image processing method, one may choose to identify and extract the area of the ribbon portion by image segmentation techniques; S302: Statistical ribbon gray value: According to the ribbon area obtained in the white light image, calculate the extreme or average gray value of the ribbon portion in each image; S303: Obtaining the grayscale change value of the color band: subtracting the average grayscale value of the color band area under different color lights from the average grayscale value of the color band area under white light; S304: Obtaining the color of the color band: The color of the color mark can be determined by the change in the grayscale value of the color mark under different lighting.
6. The recognition method of the color recognition system according to claim 5, characterized in that: The calculation of the grayscale extreme value or average value of the color band part in each image is as follows: Among them, under white light irradiation, the average gray value of the color band area is P w ; Under red light, the average gray value of the color band area is P r ; Under green light, the average gray value of the color band area is P g ; Under blue light, the average gray value of the color band area is P b .
7. The recognition method of the color recognition system according to claim 6, characterized in that: The gray value change value include: Among them, the grayscale change value of the color band under red light and white light is D r =|P r -P w |; The grayscale change value of the color band under green light and white light is Dg=|P g -P w |; The grayscale change value of the color band under blue light and white light is Db=|P b -P w |.
8. The recognition method of the color recognition system according to claim 7, characterized in that: The determination of the change in the color scale value can be performed in the following manner: First, find the maximum value of the gray value change, recorded as Dmax, and then use Dmax and the gray value change under the three types of light to calculate the difference: The gray value of the color band under red light illumination and D max The difference is S r =D max -D r ; The gray value of the color band under green light and D max The difference is S g =D max -D g ; The gray value of the color band under blue light and D max The difference is S b =D max -D b ; The result is compared with the set threshold T. If the value of S under a certain lighting condition is greater than T, then the color is one of the component colors of the color band.
9. The recognition method of the color recognition system according to claim 8, characterized in that: If the grayscale value change of the color band under a certain light is significantly lower than the grayscale value change of the other two lights, that is, S>T exists under a certain light, the color of the color band can be considered to be the color of the light; If the grayscale value changes of the color band under the two lights are not much different and are significantly lower than the grayscale value changes under the last light, then S > T exists under the two lights, and the color band can be considered to be a mixture of the two lights. If the S values in the ribbon areas under the illumination of all three lights are all less than T, that is, S r < T, S g < T, S b < T, then it can be determined whether the ribbon is white or black according to the average gray value of the ribbon area.