Application and Practice of Machine Vision in Online Color Difference Detection

2026/03/02 10:55

Introduction

In modern industrial manufacturing, especially in key areas involving appearance and color quality control, such as printing and packaging, textile printing and dyeing, automotive painting, plastic products, food processing, and consumer electronics, color consistency is one of the core evaluation indicators of product quality. Even slight color differences can affect product aesthetics and may lead to damage to brand reputation, customer complaints, or even batch returns. Traditional color difference detection heavily relies on subjective comparison by the human eye under a standard light source box or offline sampling inspection using a benchtop colorimeter. This method is inefficient, fatigue-prone, inconsistent in standards, and cannot achieve real-time monitoring of the production process.


The introduction of machine vision technology has brought a revolutionary breakthrough to color difference detection. Online color difference detection systems, by simulating and surpassing the color perception capabilities of the human eye, combined with sophisticated optical, electronic, and algorithmic technologies, can perform 100% real-time, objective, and accurate color measurement and judgment on products in high-speed motion. This truly realizes the transformation from "post-inspection" to "in-process control" in quality control, and is an indispensable part of intelligent manufacturing and Industry 4.0.


I. Core Technical Principles

The essence of machine vision color difference detection is to transform color, a physical and psychologically perceived quantity, into a quantifiable and comparable digital model. Its core technology is built upon colorimetry and digital image processing.


1. Colorimetric Fundamentals: The core of the system is the CIE (International Commission on Illumination) standard colorimetric system, most commonly the CIE Lab* color space. In this space:


L* represents lightness, from 0 (black) to 100 (white).


 a* represents the red-green axis; positive values lean towards red, negative values towards green.


b* represents the yellow-blue axis; positive values lean towards yellow, negative values towards blue.


The difference between two colors can be represented by the color difference value ΔE, calculated using the formula: ΔE = √[(ΔL*)² + (Δa*)² + (Δb*)²]. The smaller the ΔE value, the smaller the color difference. Manufacturing typically sets strict ΔE tolerance ranges (e.g., ΔE < 1.5 is imperceptible to the human eye).


2. Machine Vision Implementation Path:


Imaging: Industrial cameras acquire color digital images of the object under measurement under specific, stable light sources (such as high color rendering LED white light sources). The stability and uniformity of the light source are crucial and are the cornerstone of ensuring data repeatability.


Color Space Conversion: The camera typically acquires RGB (red, green, blue) images. Through specific color model conversion algorithms, the RGB values are accurately converted to device-independent standard color space values such as CIE Labs. The accuracy of this step directly determines the measurement accuracy of the entire system.


Data Processing and Analysis: Within the defined detection area (ROI), the system calculates the average L, a, b* values of the colors in that area and compares them with pre-recorded "standard color" data to calculate ΔE.


Judgment and Output: Based on whether ΔE exceeds a preset threshold, the system makes a real-time "qualified/unqualified" judgment and can trigger actuators such as audible and visual alarms, marking devices, and sorting devices, or feed the data back to the production control system (e.g., adjusting the ink keys of the printing press), achieving closed-loop control.


II. System Composition

A complete machine vision online color difference detection system typically consists of the following parts:


1. Hardware System:


 Illumination System: The core component. It often uses adjustable brightness, flicker-free LED surface light sources, dome lights, or coaxial lights to provide a uniform, stable, and shadowless lighting environment, eliminating interference from surface textures and curvature.


 Industrial Camera: Typically, a high-resolution, high-color-fidelity CCD or CMOS area array color camera is selected. For high-speed moving objects (such as films and fibers), a line scan camera may also be used for line-by-line scanning.


 Lens: A suitable focal length, high-resolution industrial lens is selected to ensure clear, distortion-free imaging.


 Image Acquisition Card/Gigabit Ethernet Interface: Responsible for high-speed transmission of images acquired by the camera to the processing unit.


 Industrial PC and Processor: Equipped with a high-performance CPU/GPU, running vision processing software and performing complex image calculations.


 Color Measurement Control Unit: Some high-end systems integrate a spectrometer or spectrophotometer probe for periodic camera calibration, ensuring long-term absolute accuracy of color data.


2. Software System:


 Control and Communication Module: Controls the camera and light source triggering, synchronizing with the production line PLC (Programmable Logic Controller).


 Image Processing Algorithm Library: Includes image preprocessing (filtering, enhancement), color space conversion, feature extraction, pattern matching, speckle analysis, etc.


 Color Management Module: Core software, responsible for standard sample learning, tolerance setting, color difference calculation, trend analysis, and generating color reports (such as color difference charts and trend charts).


 Database: Stores color data, images, and results of all inspected products for quality traceability and statistical analysis.


III. Typical Application Cases


1. Printing Industry:


 Application: Online color inspection on high-speed gravure, flexographic, or offset printing presses. The system is installed after the printing unit, monitoring color bars in each ink key control area in real time or directly monitoring key parts of the pattern.


 Value: Instantly detects variations in ink depth, preventing color deviations caused by fluctuations in ink viscosity and pressure, significantly reducing start-up waste and setup time, and ensuring color consistency in long-run printing.


2. Textile Printing and Dyeing Industry:


 Application: Full-width scanning of continuously moving fabrics before stenter or inspection machines.


 Value: Detects color variations, stains, uneven color distribution, edge-to-center differences, and batch-to-batch differences. Replaces manual fabric inspection, increasing efficiency by tens of times, and generates digital quality reports, providing data support for process improvement.


3. Automotive Manufacturing Industry:


 Application: Online color inspection of body panels, bumpers, and other components in the painting workshop. Multi-camera, multi-angle layouts are often used to handle complex curved surfaces. ◦ Value: Ensures perfect color matching between different parts of the same vehicle and between different batches of vehicles, meeting the stringent "zero color difference" requirements of high-end customers.


4. Food and Pharmaceutical Packaging:


 Application: Inspects the accuracy of colors on packaging bags, labels, and bottle caps, and whether brand logo colors are within tolerance.


 Value: Prevents mixing and mispackaging due to color errors, maintains brand image, and complies with industry standards.


IV. Challenges and Solutions


Despite the mature technology, challenges remain in practical deployment:


1. Environmental Stability: Ambient light interference, vibration, and temperature changes can affect measurements. Solution: Employ a closed detection dark chamber, vibration-resistant design, and a constant temperature system, and use coaxial or structured light to suppress ambient light.


2. Complex Backgrounds and Textures: Product patterns and textures can interfere with color extraction. Solution: Use multi-band spectral imaging or combine it with deep learning algorithms to enable the model to distinguish between textures and true color changes.


3. Gloss and Material Influence: Different surfaces, such as high-gloss, matte, and metallic paint, have varying light reflection characteristics, affecting camera readings. Solution: Use multi-angle lighting and imaging systems (e.g., 0°:45° or 45°:0° geometry) to simulate the measurement conditions of a standard spectrophotometer, or eliminate specular reflections using polarizers.


4. Balancing High Speed and High Precision: Extremely high production line speeds require extremely short exposure and data processing times. Solution: Employ high-performance GPUs for parallel computing and algorithm optimization, and potentially introduce linear scanning.


5. System Integration and Calibration: Integration and data synchronization with existing production lines (MES/ERP). Solution: Adopt standardized industrial communication protocols (e.g., OPC UA, Profinet) and establish a regular automatic calibration process, calibrating the system with standard color charts to ensure long-term data reliability and traceability.


V. Future Development Trends


1. Deep Integration of AI and Deep Learning: Traditional threshold segmentation and template matching are insufficient for extremely complex scenarios. 1. Deep learning, especially convolutional neural networks (CNNs), will play a leading role in defect classification, color difference determination under complex textures, and adaptive learning of color features of different products, making systems more intelligent and robust.


2. The widespread adoption of hyperspectral/multispectral imaging technology: Traditional RGB cameras can only acquire information from three wide bands. Hyperspectral cameras can acquire spectral information from hundreds of consecutive narrow bands, forming a "spectral cube." This not only enables more accurate color calculation but also allows for analysis of the chemical composition of materials, achieving dual detection of "color + substance."


3. Cloud platforms and big data analytics: Uploading data from online inspection terminals to cloud platforms allows for factory-level and group-level multi-production-line, multi-batch big data analysis. Through data mining, equipment degradation can be predicted, process parameters optimized, and predictive maintenance and intelligent decision-making achieved.


4. Miniaturization and embedded edge computing: With the improvement of chip computing power, more compact, low-cost, and low-power embedded vision systems will be deployed in more production line stages, making "ubiquitous vision" online inspection possible.


Conclusion


Machine vision-based online color difference inspection technology has transformed from a cutting-edge technology into a standard configuration for enhancing the core competitiveness of the manufacturing industry. It replaces subjective human observation with objective data and inefficient offline sampling with 100% online full inspection. This not only significantly improves quality control and production efficiency while reducing labor costs and quality risks, but more importantly, it generates valuable production process data assets, laying a solid foundation for process optimization, intelligent manufacturing, and digital transformation. With the continuous advancement of artificial intelligence, spectral technology, and computing power, future online color difference inspection systems will be more intelligent, accurate, and ubiquitous, continuously driving the high-quality development of "Made in China" towards "Intelligent Manufacturing in China."