Color code sensor
By combining linear array sensing technology and RGB three-color light emission, the light intensity and proportion are determined using the triangular distance measurement principle, the problem of low recognition accuracy of traditional color standard sensors at large distances is solved, and the color standard detection with high tolerance and high sensitivity is achieved, which improves production efficiency and product quality.
Patent Information
- Application Number
- CN202510179087.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-05-13
AI Technical Summary
When the target distance changes greatly, traditional color standard sensors are difficult to take into account large distance tolerance and accurate color recognition, resulting in misjudgment or reduced sensitivity, affecting production efficiency and product quality.
Linear array sensing technology is used to combine RGB three-color light emission, and triangular distance measurement principle is used to determine the ratio of light intensity and light intensity, so as to achieve stable detection of color marks within a wide distance range.
It realizes stable color standard detection over a wide distance range, with high tolerance and high sensitivity, improving production efficiency and product quality.
Smart Images

Figure CN119984513A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sensors, and in particular to a color code sensor. Background Art
[0002] Color Mark Sensor is an automated detection tool used to detect the position of color marks on the surface of products or to distinguish between different color marks. It is widely used in packaging, printing, food, medicine and other industries.
[0003] Traditional color mark sensors usually use single-point photodiode (PD) detection technology, with red / green / blue (RGB) three-color light sources to illuminate the target in turn, and receive the intensity of reflected light to distinguish different colors. When the distance between the target and the sensor changes significantly, or the target surface vibrates, the intensity of the reflected light will fluctuate significantly with the change in distance, which will seriously affect the accuracy of color recognition.
[0004] Therefore, in order to ensure the detection accuracy, the measurement distance must be fixed and the distance change of the target must be within a certain range (for example, the amplitude of the tag during operation cannot be too large). However, in practical applications, this limitation is often difficult to meet. Especially in some complex industrial automation scenarios, the distance change of the target object may be large and difficult to predict. At this time, it is difficult for traditional color mark sensors to take into account both "large distance tolerance" and "accurate color recognition". When the target distance changes greatly, misjudgment or reduced sensitivity often occurs, thus affecting production efficiency and product quality. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a color mark sensor.
[0006] The technical problem solved by the present invention can be achieved by adopting the following technical solutions:
[0007] A color mark sensor, comprising:
[0008] A light source module, the light source module is used to emit light of different colors in sequence;
[0009] The linear array sensor module is used to generate light signals corresponding to light of different colors according to the light spots formed by the reflection of light of different colors;
[0010] The processing module is respectively connected to the light source module and the linear array sensor module, and is used to determine the light intensity and light intensity ratio of each color according to the light signals corresponding to the various color lights, and compare the light intensity and light intensity ratio of each color with the corresponding preset standard thresholds to determine the detection result.
[0011] Preferably, the colors of the light are red, green and blue;
[0012] The light source module is used to emit red light, green light and blue light in sequence, wherein the red light forms a red light spot on the linear array sensor module, the green light forms a green light spot on the linear array sensor module, and the blue light forms a blue light spot on the linear array sensor module.
[0013] Preferably, the light intensity is the maximum value of the voltage formed on the multiple pixel receiving tubes of the linear array sensor module by the corresponding color light.
[0014] Preferably, the light intensity ratio is the proportion of the light intensity of the corresponding color light in the sum of the light intensities of all color lights, wherein the light intensity is the maximum value of the voltage formed by the corresponding color light on multiple pixel receiving tubes of the linear array sensor module.
[0015] Preferably, the light intensity ratio is the proportion of the light intensity of the corresponding color light in the sum of the light intensities of all color lights, wherein the light intensity sum is the sum of the voltages formed by the corresponding color light on all pixel receiving tubes of the linear array sensor module.
[0016] Preferably, the detection result includes whether there is an object to be detected between the color mark sensor and the background;
[0017] The processing module comprises:
[0018] The detection unit is used to determine the detection result of the existence of the target to be detected between the color mark sensor and the background when the difference between any one of the light intensity of each color and the light intensity ratio and the standard threshold exceeds the corresponding preset threshold.
[0019] Preferably, the detection result further includes distance information of the target to be detected relative to the color mark sensor when the target to be detected exists between the color mark sensor and the background;
[0020] The processing module also includes:
[0021] The distance information calculation unit is used to determine the centroid of the light spot according to the light intensity corresponding to each color light when it is determined that there is a target to be detected between the color mark sensor and the background, and determine the distance information of the target to be detected relative to the color mark sensor according to the centroid of the light spot.
[0022] Preferably, the processing module further includes:
[0023] The initialization unit is used to measure and record the light intensity and light intensity ratio corresponding to the light spot formed by the reflection of various color lights by the target as the standard threshold, wherein the target has a preset initialization distance relative to the color mark sensor.
[0024] Preferably, the processing module further includes:
[0025] A calibration unit is connected to the distance information calculation unit and is used to correct the standard threshold corresponding to the light intensity and the light intensity ratio according to the distance information and a preset initialization distance.
[0026] Preferably, the color of the light is white.
[0027] The advantages or beneficial effects of the technical solution of the present invention are:
[0028] The present invention combines linear array sensing technology with the emission of light of different colors and utilizes the principle of triangulation to determine light intensity and light intensity ratio, thereby achieving stable detection of color standards over a wide range of distances, having both high tolerance and high sensitivity, and improving production efficiency and product quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 This is a schematic diagram of the overall structure of a color mark sensor in a preferred embodiment of the present invention;
[0030] Figure 2 This is a schematic diagram of different distances between the target to be detected and the color mark sensor in a preferred embodiment of the present invention;
[0031] Figure 3 FIG. 4 is a schematic diagram of the relationship between the centroid of the light spot and the distance information in a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0032] 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.
[0033] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0034] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, but they are not intended to limit the present invention.
[0035] See also Figure 1 and Figure 2In a preferred embodiment of the present invention, based on the above problems existing in the prior art, a color mark sensor is provided, comprising:
[0036] Light source module 1, the light source module is used to emit light of different colors in sequence;
[0037] Linear array sensor module 2, used to generate light signals corresponding to light of different colors according to light spots formed by reflection of light of different colors;
[0038] The processing module 3 is connected to the light source module 1 and the linear array sensor module 2 respectively, and is used to determine the light intensity and light intensity ratio of each color according to the light signals corresponding to the various color lights, and compare the light intensity and light intensity ratio of each color with the corresponding preset standard thresholds to determine the detection result.
[0039] Specifically, it is difficult for traditional color mark sensors to simultaneously take into account "large distance tolerance" and "accurate color recognition". When the target distance changes greatly, the sensitivity of traditional sensors will be significantly reduced, and it is easy to misjudge or miss the judgment, thus affecting production efficiency and product quality.
[0040] For example, on a high-speed production line, the position of the target may shift due to vibration or changes in conveyor speed, and traditional color mark sensors have difficulty adapting to such dynamic changes.
[0041] In this embodiment, the color mark sensor includes a light source module 1, a linear array sensor module 2 and a processing module 3. Among them:
[0042] The light source module 1 is composed of multiple monochromatic light sources (such as red, green, blue, etc.), or a multi-color light output is achieved through an adjustable light source, and the luminous intensity of the light can be adjusted at the software or hardware level. The light source module 1 lights up light sources of different colors in sequence to ensure that each color of light can be emitted independently. The time-sharing emission method can effectively avoid interference between colors and improve the accuracy of color recognition.
[0043] For each color of light source, the emitted light is reflected back to the linear array sensor module 2 by the background or the target to be detected. The linear array sensor module 2 is used to receive the light reflected back from the target surface, and generate corresponding light signals according to the light spots formed by the light of different colors, and transmit the light signals to the processing module 3 for data processing and color mark detection. The linear array sensor module 2 is composed of a plurality of pixel receiving tubes 21, and the plurality of pixel receiving tubes 21 are arranged in a straight line to form a one-dimensional pixel array. The above light signal includes the position of the light spot on the array and the voltage / current value (or digital signal) of the corresponding pixel.
[0044] The light source is set perpendicular to the target, and the linear array sensor module 2 is located on the same side as the light source and is set at an acute angle to the target, so that the processing module 3 can use the triangulation principle to first determine the light intensity and light intensity ratio of each color based on the light signal generated by the linear array sensor module 2; then, the light intensity of each color and its light intensity ratio are compared with a preset standard threshold.
[0045] If the difference between any data and the standard threshold exceeds a certain range, it is determined that the sensor detects a color mark of a different color and the sensor state is flipped.
[0046] On the contrary, if the difference between all data and the standard threshold value is within the range, it is determined that the sensor has not detected a color mark of a different color, and the sensor state remains unchanged.
[0047] Compared with the traditional color mark sensor, the color mark sensor of the embodiment of the present invention can achieve stable detection of the color mark within a wide distance range, has high tolerance and high sensitivity, and improves production efficiency and product quality.
[0048] Furthermore, the processing module 3 may be implemented by, but not limited to, a microcontroller or a digital signal processor, such as MCU / FPGA / DSP. The processing module 3 may also be used to control the operating parameters of the light source module 1 and the linear array sensor module 2. For example, the operating parameters include, but are not limited to, light intensity, channel gain, and scanning frequency.
[0049] As a preferred embodiment, the colors of the light are red, green and blue;
[0050] The light source module 1 is used to emit red light, green light and blue light in sequence, wherein the red light forms a red light spot on the linear array sensor module 2, the green light forms a green light spot on the linear array sensor module 2, and the blue light forms a blue light spot on the linear array sensor module 2.
[0051] Specifically, in this embodiment, the light source module includes three emission tubes 11 of red, green and blue, which are used to emit red light, green light and blue light independently in sequence in a time-sharing emission manner.
[0052] Furthermore, the light source module 1 may further include a first optical element 12. The first optical element 12 includes but is not limited to a lens, a semi-transparent mirror or a prism, etc., which is used for triangulation positioning, reducing mutual interference between light spots, and ensuring imaging clarity.
[0053] For red light, the linear array sensor module 2 receives the red light spot formed on multiple pixel receiving tubes 21 by the red light being reflected by the target, and generates a first light signal based on the red light spot, which is recorded as V1 = [VR1, VR2, ..., VRn], where n represents the number of pixel receiving tubes 21.
[0054] For green light, the linear array sensor module 2 receives the green light spot formed on the plurality of pixel receiving tubes 21 by the green light reflected by the target, and generates a second light signal according to the green light spot, which is recorded as V2 = [VG1, VG2, ..., VGn].
[0055] For the blue light, the linear array sensor module 2 receives the blue light spot formed on the plurality of pixel receiving tubes 21 by the blue light reflected by the target, and generates a third light signal according to the blue light spot, which is recorded as V3 = [VB1, VB2, ..., VBn].
[0056] The first optical signal VR, the second optical signal VG and the third optical signal VB can be characterized by the voltage distribution formed on multiple pixel receiving tubes, which is the embodiment of the centroid of the light spot and the light intensity distribution, wherein the centroid can be used to calculate the distance of the target relative to the sensor, and the light intensity can be used to calculate the ratio of RGB.
[0057] Furthermore, the linear array sensor module 2 may further include a second optical element 22. The second optical element 22 may also be a lens, a semi-transparent mirror or a prism, etc., to focus the reflected light onto the surface of the pixel receiving tube 21, thereby improving the receiving sensitivity and measurement accuracy.
[0058] As a preferred embodiment, the light intensity is the maximum value of the voltage formed on the multiple pixel receiving tubes 21 of the linear array sensor module 2 by the corresponding color light.
[0059] Specifically, in this embodiment, the light intensity is represented by the maximum value of the linear array voltage distribution, that is, the maximum value is selected from the voltage values of the plurality of pixel receiving tubes 21 as the light intensity of the color light.
[0060] For the green light, its light intensity VR=max(VR1, VR2,..., VRn).
[0061] For green light, its light intensity VG=max(VG1, VG2, ..., VGn).
[0062] For blue light, its light intensity VB=max(VB1, VB2, ..., VBn).
[0063] As a preferred embodiment, the light intensity ratio is the proportion of the light intensity of the corresponding color light in the sum of the light intensities of all color lights, wherein the light intensity is the maximum value of the voltage formed by the corresponding color light on multiple pixel receiving tubes of the linear array sensor module.
[0064] Specifically, in this embodiment, after obtaining the light intensities (VR, VG, VB) of red, green and blue light, the processing module 3 further calculates the light intensity ratio of each color light according to the proportion of the light intensity of a single color light in the sum of the light intensities of all color lights.
[0065] For green light, the light intensity ratio is VR / (VR+VG+VB).
[0066] For green light, the light intensity ratio is VG / (VR+VG+VB).
[0067] For blue light, the light intensity ratio is VB / (VR+VG+VB).
[0068] As a preferred embodiment, the light intensity ratio is the proportion of the light intensity of the corresponding color light in the sum of the light intensities of all color lights, wherein the light intensity sum is the sum of the voltages formed by the corresponding color light on all pixel receiving tubes of the linear array sensor module.
[0069] Specifically, in this embodiment, the light intensity ratio can also be the proportion of the light intensity of a single color light in the sum of the light intensities of all color lights. Specifically, the processing module 3 first calculates the light intensity sum according to the sum of the voltages on the plurality of pixel receiving tubes 21 .
[0070] For each color light, the light intensity is the sum of the voltages formed on all pixel receiving tubes 21 of the linear array sensor module 2 by the color light.
[0071] For the green light, the light intensity sum VR_all=VR1+VR2+.....+VRn.
[0072] For green light, the sum of its light intensities is VG_all=VG1+VG2+.....+VGn.
[0073] For blue light, the sum of its light intensities VB_all=VB1+VB2+...+VBn.
[0074] Then, after obtaining the sum of the light intensities of the red, green, and blue lights (VR_all, VG_all, VB_all), the processing module 3 further calculates the light intensity ratio based on the sum of the light intensities:
[0075] For green light, the light intensity ratio is VR_all / (VR_all+VG_all+VB_all).
[0076] For green light, the light intensity ratio is VG_all / (VR_all+VG_all+VB_all).
[0077] For blue light, the light intensity ratio is VB_all / (VR_all+VG_all+VB_all).
[0078] In this embodiment, the sum of the voltages formed on each pixel receiving tube 21 of the linear array sensor module 2 under three different color lights is calculated by using an integral method to obtain the light intensity sum VR_all, VG_all, and VB_all, and then the light intensity ratio of each color light is calculated based on the light intensity sum obtained by integration. The integral calculation can more accurately reflect the total intensity of the light, reduce the influence of noise and interference, further improve the measurement accuracy, and make it easier for the system to distinguish similar colors.
[0079] As a preferred embodiment, the detection result includes whether there is a target to be detected between the color mark sensor and the background;
[0080] Processing module 3 includes:
[0081] The detection unit is used to determine the detection result of the existence of the target to be detected between the color mark sensor and the background when the difference between any one of the light intensity of each color and the light intensity ratio and the standard threshold exceeds the corresponding preset threshold.
[0082] Specifically, in this embodiment, the light intensity (VR, VG, VB) and light intensity ratio (VR / (VR+VG+VB), VG / (VR+VG+VB), VB / (VR+VG+VB)) measured in the real-time detection process are subtracted from the standard thresholds corresponding to each data to obtain the difference between the light intensity and the light intensity ratio and the corresponding standard thresholds, and the difference is compared with the preset threshold.
[0083] If the difference between any of the above data and the corresponding standard threshold exceeds a certain range, it is determined that the sensor detects a color mark of a different color, and the sensor state is reversed.
[0084] On the contrary, if the difference between all data and the corresponding standard threshold value is within the range, it is determined that the sensor has not detected the color mark of different colors, and the sensor state remains unchanged.
[0085] As a preferred embodiment, the detection result further includes distance information of the target to be detected relative to the color mark sensor when the target to be detected exists between the color mark sensor and the background;
[0086] The processing module 3 also includes:
[0087] The distance information calculation unit is used to determine the centroid of the light spot according to the light intensity corresponding to each color light when determining that there is a target to be detected between the color mark sensor and the background, and to determine the distance information of the target to be detected relative to the color mark sensor according to the centroid of the light spot.
[0088] Specifically, each color light corresponds to a light spot, and each light spot corresponds to a light spot centroid. In this embodiment, the light signal of the color light corresponding to the maximum value of the light intensity corresponding to the three color lights is first obtained. Specifically, after obtaining the light intensities of the red, green, and blue lights (VR, VG, VB), the light spot centroid is determined according to the light signal of the color light corresponding to the maximum value of VR, VG, and VB. Then, the distance of the target relative to the color mark sensor can be calculated using the triangulation distance measurement principle, such as Figure 3 The relationship between the spot centroid and the distance information is shown.
[0089] The distance information can be used to calibrate or compensate the sensor output to eliminate the effects of changes in target distance on color judgment.
[0090] It should be noted that the process of determining the distance of the target relative to the color mark sensor according to the centroid of the light spot belongs to the prior art and will not be described in detail here, but should be included in the protection scope of the present invention.
[0091] As a preferred embodiment, the processing module further includes:
[0092] The initialization unit is used to measure and record the light intensity and light intensity ratio corresponding to the light spot formed by the reflection of various color lights by the target as the standard threshold, wherein the target has a preset initialization distance relative to the color mark sensor.
[0093] Specifically, in this embodiment, the background has a preset initialization distance relative to the color mark sensor.
[0094] When the color mark sensor is initialized, it is set to align with the color mark to be detected. Through the initialization process, data such as VR_th, VG_th, VB_th, VR_th / (VR_th+VG_th+VB_th), VG_th / (VR_th+VG_th+VB_th), VB_th / (VR_th+VG_th+VB_th) are recorded as standard thresholds.
[0095] The initialization process includes:
[0096] During the initialization process, the red, green and blue emitting tubes are controlled to emit light in sequence, and the voltages formed by the red / green / blue light spots on multiple pixel receiving tubes 21, namely V_red, V_green and V_blue, are respectively collected in real time to adjust the luminous intensity or the gain of each color channel to keep V_red, V_green and V_blue in an unsaturated state, that is, the maximum voltage value is less than 0.9 times the maximum value and is within a certain range.
[0097] Record the voltages or pixel values corresponding to the red, green, and blue light spots, record the maximum light intensity values VR_th, VG_th, and VB_th, and calculate the light intensity ratios VR_th / (VR_th+VG_th+VB_th), VG_th / (VR_th+VG_th+VB_th), VB_th / (VR_th+VG_th+VB_th), and other data. This set of data corresponds to the color code of this color.
[0098] As a preferred embodiment, the processing module 3 further includes:
[0099] The calibration unit is connected to the distance information calculation unit and is used to correct the standard threshold corresponding to the light intensity and the light intensity ratio according to the distance information and the preset initialization distance.
[0100] Specifically, in this embodiment, the calibration unit calculates the distance information D between the current target and the color mark sensor according to a calibration formula or a calibration standard table stored in a register.
[0101] If the distance information D deviates from the initialization distance, that is, the working distance at the time of initialization, the light intensity and the light intensity ratio can be corrected by a formula or a table lookup.
[0102] During the color mark detection process, if the target shakes or moves quickly, the changes in light intensities VR, VG, VB and light intensity ratios VR / (VR+VG+VB), VG / (VR+VG+VB), VB / (VR+VG+VB) can be quickly captured, and corresponding calibration operations can be performed to ensure that the color mark sensor maintains high resolution.
[0103] By compensating for distance changes in real time, the color mark sensor is guaranteed to detect different colors stably and accurately within a larger working distance range.
[0104] As a preferred embodiment, the color of the light is white.
[0105] Specifically, in this embodiment, if white light is used as the light source, the principle that the color mark sensor uses distance measurement to calibrate the measurement error caused by the distance change, thereby improving the color differentiation ability, is still applicable.
[0106] Specifically, the linear array sensor module 2 measures the voltage and voltage distribution of white light on multiple pixel receiving tubes 21, and uses the measured distance to calibrate the same color mark at different distances from the sensor, so that the sensor can maintain high resolution.
[0107] Furthermore, the color mark sensor may also include a power module 4 and a communication module 5. The power module 4 is respectively connected to the processing module 3 and the communication module 5 to power the sensor; the communication module is used to establish communication with an external system to transmit the target distance information and the calibrated sensor output results to the external system for use by subsequent external systems such as industrial control systems or host computers.
[0108] The following provides an embodiment to illustrate and describe the color mark sensor of the present technical method:
[0109] The present invention aims to provide a color mark sensor which can stably distinguish different colors and measure target distance within a larger working distance range.
[0110] The color mark sensor includes a light source module 1, a linear array sensor module 2, a processing module 3, a power module 4 and a communication module 5. Among them:
[0111] The light source module 1 uses three independently packaged high-brightness LEDs with wavelengths of approximately 460nm (blue), 520nm (green), and 630nm (red), which are driven by a programmable current driver.
[0112] The linear array sensor module 2 uses a plurality of CMOS pixel receiving tubes 21 to form a one-dimensional pixel array, and different pixel receiving tubes 21 independently output voltage signals.
[0113] Among them, the light source module 1 is used as the transmitting end, and the linear array sensor module 2 is used as the receiving end. Both are arranged on the same side of the target and have a triangulated ranging geometric relationship with the target.
[0114] The processing module 3 can preferably use a microcontroller MCU, which controls the working parameters in the light source module 1 and the linear array sensor module 2 through SPI / I2C, adjusts the luminous intensity and channel gain, and the microcontroller MCU receives the light signal output by the linear array sensor module 2 through the ADC interface, processes the light signal through the built-in signal processing algorithm, centroid algorithm, distance compensation algorithm, and color distinction algorithm, and communicates with the external system through the communication module 5.
[0115] The workflow of the color mark sensor includes the initialization process and the real-time measurement process. Among them:
[0116] During the initialization process, the color mark to be detected is aligned to control the red, green and blue emission tubes to emit light in sequence, and the voltages formed by the red / green / blue light spots on multiple pixel receiving tubes 21, namely V_red, V_green and V_blue, are respectively collected in real time.
[0117] The luminous intensity or the gain of each color channel is adjusted to ensure that the multiple pixel receiving tubes 21 of the linear array sensor module 2 are in an unsaturated state under three different colors of light, that is, the maximum voltage value of each pixel receiving tube 21 is less than 0.9Vdd and is within a predetermined range, which can preferably be 0.3Vdd to .9Vdd, where Vdd is the operating voltage of each pixel receiving tube 21.
[0118] If the color mark sensor is in a saturated state, the luminous power of the transmitting tube corresponding to the current color and the corresponding channel gain are automatically adjusted until the maximum voltage values of V_red, V_green, and V_blue are kept between 0.3Vdd and .9Vdd.
[0119] Next, after the luminous intensity or the gain of each color channel is adjusted, the maximum values of light intensity VR_th, VG_th, and VB_th are recorded according to the voltage or pixel value corresponding to the red, green, and blue light spots at this time, and the light intensity ratios VR_th / (VR_th+VG_th+VB_th), VG_th / (VR_th+VG_th+VB_th), and VB_th / (VR_th+VG_th+VB_th) are calculated as standard thresholds. This set of data corresponds to the color scale of this color.
[0120] During the real-time measurement process, the light intensities VR, VG, VB and the light intensity ratios VR / (VR+VG+VB), VG / (VR+VG+VB), and VB / (VR+VG+VB) are measured in real time. The differences between these six data and the standard thresholds are then compared with the preset thresholds. If the difference between any of the above six data and the corresponding standard threshold exceeds a certain range, it is determined that the color mark sensor has detected a color mark of a different color, and the state of the color mark sensor is flipped. On the contrary, if the difference between the above six data and the corresponding standard thresholds does not exceed the range, it is determined that the color mark sensor has not detected a color mark of a different color, and the state of the color mark sensor remains unchanged.
[0121] Furthermore, in order to further improve the measurement accuracy, the integral method can also be used to calculate the light intensity and VR_all, VG_all, VB_all and the corresponding light intensity ratios VR_all / (VR_all+VG_all+VB_all), VG_all / (VR_all+VG_all+VB_all), VB_all / (VR_all+VG_all+VB_all). Similarly, the difference between these six data and the standard threshold is compared with the preset threshold, and the principle of the judgment method is still applicable, which will not be repeated here. The integral calculation can more accurately reflect the total intensity of light, reduce the influence of noise and interference, and make it easier for the system to distinguish similar colors.
[0122] Furthermore, the light signals of the three colors can be compared to determine the maximum value, and the centroid of the light spot can be calculated based on the light signal of the color light corresponding to the maximum value, and then the distance information of the target relative to the color mark sensor can be calculated using the triangulation principle. This distance information can be used to calibrate or compensate the sensor output to eliminate the influence of the change in target distance on color judgment.
[0123] Furthermore, if the target shakes or moves quickly, the changes in light intensity VR, VG, VB and light intensity ratios VR / (VR+VG+VB), VG / (VR+VG+VB), VB / (VR+VG+VB) can be quickly captured, and corresponding calibration operations can be performed. Specifically, the calibration operation includes: calculating the distance information D between the current target and the color mark sensor according to the calibration formula or the calibration standard table stored in the register. If the distance information D deviates from the initialization distance, that is, the working distance at the time of initialization, the light intensity and the light intensity ratio can be corrected by formula or table lookup, so that the color mark sensor maintains high resolution. By real-time compensation for distance changes, the color mark sensor is guaranteed to stably and accurately detect different colors within a larger working distance range.
[0124] Furthermore, if white light is used as the light source, the principle that the color mark sensor uses distance measurement to calibrate the measurement error caused by the distance change to improve the color differentiation ability is still applicable. The linear array sensor module 2 measures the voltage and voltage distribution of the white light on multiple pixel receiving tubes 21, and uses the measured distance to calibrate the same color mark at different distances from the sensor, so that the sensor can maintain high resolution.
[0125] The advantages or beneficial effects of adopting the above technical solution are: the present invention combines the linear array sensor with the RGB three-color light emission, utilizes the triangulation distance measurement principle and the channel gain / light intensity adjustment / normalization technology, performs the same distance-related calibration on the sensor readings of the same color mark at different distances, and realizes the stable detection of the target color within a large distance range. The present invention can be widely used in the fields of packaging, printing, electronic component sorting, etc., and provides a new solution for color mark detection with both high tolerance and high sensitivity.
[0126] The above are only preferred embodiments of the present invention, and are not intended to limit the implementation methods and protection scope of the present invention. Those skilled in the art should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the contents of this specification and illustrations should be included in the protection scope of the present invention.
Claims
1. A color mark sensor, characterized in that: include: A light source module, the light source module is used to emit light of different colors in sequence; The linear array sensor module is used to generate light signals corresponding to light of different colors according to the light spots formed by the reflection of light of different colors; The processing module is respectively connected to the light source module and the linear array sensor module, and is used to determine the light intensity and light intensity ratio of each color according to the light signals corresponding to the various color lights, and compare the light intensity and light intensity ratio of each color with the corresponding preset standard thresholds to determine the detection result.
2. The color mark sensor according to claim 1, characterized in that: The colors of the light are red, green and blue; The light source module is used to emit red light, green light and blue light in sequence, wherein the red light forms a red light spot on the linear array sensor module, the green light forms a green light spot on the linear array sensor module, and the blue light forms a blue light spot on the linear array sensor module.
3. The color mark sensor according to claim 1, characterized in that: The light intensity is the maximum value of the voltage formed on multiple pixel receiving tubes of the linear array sensor module by the corresponding color light.
4. The color mark sensor according to claim 1, characterized in that: The light intensity ratio is the proportion of the light intensity of the corresponding color light in the sum of the light intensities of all color lights, wherein the light intensity is the maximum value of the voltage formed by the corresponding color light on multiple pixel receiving tubes of the linear array sensor module.
5. The color mark sensor according to claim 1, characterized in that: The light intensity ratio is the proportion of the light intensity of the corresponding color light in the sum of the light intensities of all color lights, wherein the light intensity sum is the sum of the voltages formed by the corresponding color light on all pixel receiving tubes of the linear array sensor module.
6. The color mark sensor according to claim 1, characterized in that: The detection result includes whether there is a target to be detected between the color mark sensor and the background; The processing module comprises: The detection unit is used to determine the detection result of the existence of the target to be detected between the color mark sensor and the background when the difference between any one of the light intensity of each color and the light intensity ratio and the standard threshold exceeds the corresponding preset threshold.
7. The color mark sensor according to claim 1, characterized in that: The detection result also includes distance information of the target to be detected relative to the color mark sensor when there is a target to be detected between the color mark sensor and the background; The processing module also includes: The distance information calculation unit is used to determine the centroid of the light spot according to the light intensity corresponding to each color light when it is determined that there is a target to be detected between the color mark sensor and the background, and determine the distance information of the target to be detected relative to the color mark sensor according to the centroid of the light spot.
8. The color mark sensor according to claim 7, characterized in that: The processing module also includes: The initialization unit is used to measure and record the light intensity and light intensity ratio corresponding to the light spot formed by the reflection of various color lights by the target as the standard threshold, wherein the target has a preset initialization distance relative to the color mark sensor.
9. The color mark sensor according to claim 8, characterized in that: The processing module also includes: A calibration unit is connected to the distance information calculation unit and is used to correct the standard threshold corresponding to the light intensity and the light intensity ratio according to the distance information and a preset initialization distance.
10. The color mark sensor according to claim 1, characterized in that: The color of the light is white.
Citation Information
Cited By
Color sensor
CN121113268A