An automated appearance inspection apparatus and method based on multispectral imaging
By combining multispectral imaging with multiple light sources and image processing technologies, the problems of low defect detection rate and poor adaptability in existing technologies have been solved, enabling efficient and accurate detection of complex product surfaces, especially for the identification of defects such as scratches, particles and oil stains.
Patent Information
- Application Number
- CN202610445808.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-07
- Publication Date
- 2026-08-25
AI Technical Summary
Existing industrial appearance inspection equipment relies on single visible light imaging and fixed light source strategies, resulting in low defect detection rate, poor adaptability, and low efficiency. Furthermore, it lacks multispectral collaborative mechanisms and structured inspection processes, making it difficult to meet the requirements of full-coverage scanning and highly robust inspection of complex products.
A multispectral imaging method is adopted, which combines parallel white light, coaxial light source and low-angle dark field light source to form a multispectral image sequence. Combined with median filtering, histogram equalization, difference operation and high threshold binarization, defect enhancement and connected component analysis are realized. Combined with ultraviolet light source to detect fluorescent substances, an automated appearance inspection device is constructed.
It significantly improves the accuracy and reliability of defect detection, is applicable to products with complex geometries, reduces false alarm rates, expands the detection range to functional contamination defects, enhances system stability and generalization ability, and meets the real-time and stability requirements of industrial sites.
Smart Images

Figure CN122631637A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial visual inspection technology, specifically to an automated appearance inspection device and method based on multispectral imaging. Background Technology
[0002] In the industrial manufacturing sector, product appearance quality is a crucial indicator of its technological sophistication and reliability. Especially in industries such as consumer electronics, automotive parts, precision optical components, and medical devices, surface defects (such as scratches, dents, particles, oil stains, and printing flaws) not only affect product aesthetics but can also become a contributing factor to functional failures or safety risks. Therefore, efficient, accurate, and stable automated appearance inspection technology has become a key component of modern intelligent manufacturing production lines.
[0003] Currently, most mainstream automated appearance inspection equipment uses a single visible light source in conjunction with an industrial camera for image acquisition and relies on traditional image processing algorithms (such as threshold segmentation, edge detection, and template matching) for defect identification. However, this approach faces several technical bottlenecks in practical applications: First, single lighting conditions are insufficient to fully capture the visual characteristics of various defects. For example, fine scratches on highly reflective surfaces like metal or glass are difficult to distinguish under ordinary white light due to specular reflection; bubbles or cracks inside transparent plastic parts are almost invisible in the visible light spectrum; and residual cleaning agents or oil stains have extremely low contrast with the background under normal lighting, making them easy to miss. Due to the lack of multi-dimensional optical information, relying solely on a single image often fails to effectively distinguish surface textures, material differences, and actual defects, resulting in a high false positive rate. Second, fixed field of view or simple conveyor belt structures have blind spots. For products with complex geometries (such as curved surfaces, steps, and polyhedra), a single viewpoint cannot achieve full surface coverage. Existing equipment, lacking a flexible motion control system, struggles to perform comprehensive scanning of irregularly shaped workpieces, leading to missed detections in localized areas. Furthermore, traditional image processing algorithms lack robustness. In scenarios with uneven lighting, complex backgrounds, or low defect contrast, methods based on fixed thresholds or edge features are susceptible to noise interference, generating numerous false alarms or false negatives. While recent research has introduced deep learning models to improve detection accuracy, these methods rely on extensive labeled sample training, limiting model generalization capabilities and lacking interpretability in the inference process, making it difficult to meet the stringent requirements of stability, real-time performance, and maintenance-free operation in industrial settings. Moreover, AI models typically require high-performance GPUs, increasing equipment costs and deployment complexity.
[0004] Finally, existing systems lack effective multispectral coordination mechanisms and structured detection processes. Most devices simply integrate light sources, cameras, and motion mechanisms without designing specific optical excitation-imaging strategies for different defect types, nor establishing a complete closed-loop logic from image acquisition, enhancement, judgment to result fusion, making it difficult to balance detection efficiency and accuracy.
[0005] In summary, there is an urgent need for an automated appearance inspection solution that possesses multispectral imaging capabilities, supports full-coverage scanning, and achieves highly robust defect discrimination based on physical optics principles, in order to solve the problems of high false negative rates, poor adaptability, and structural rigidity in existing technologies. Summary of the Invention
[0006] In view of the above-mentioned shortcomings of the existing technology, the present invention provides an automated appearance inspection device and method based on multispectral imaging, which can effectively solve the problems of low defect detection rate, poor adaptability and low efficiency caused by the reliance on single visible light imaging and fixed light source strategy in traditional industrial appearance inspection.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] In a first aspect, the present invention provides an automated appearance inspection method based on multispectral imaging, the method comprising the following steps:
[0009] S1. Control the relative position between the product to be inspected and the imaging module, and move sequentially to multiple detection points according to the preset scanning path so that the imaging area successively covers the surface of the product to be inspected;
[0010] S2. At the current detection point, different types of light sources are used to illuminate the surface of the product to be inspected in sequence, and multiple single-channel or multi-channel images under the corresponding illumination conditions are acquired simultaneously to form a multispectral image sequence. The light sources include parallel white light sources, coaxial light sources, and low-angle dark field light sources. The multispectral image sequence includes parallel white light images acquired under the illumination of the parallel white light source, coaxial light source images acquired under the illumination of the coaxial light source, and low-angle dark field light source images acquired under the illumination of the low-angle dark field light source.
[0011] S3. Perform image preprocessing on the multispectral image sequence to obtain a preprocessed multispectral image sequence;
[0012] S4. Perform a defect enhancement operation on the preprocessed multispectral image sequence to obtain an enhanced feature image, which includes a scratch candidate image and a particle candidate image;
[0013] S5. Perform connected component analysis on the enhanced feature map, extract the area, gray-scale mean and center coordinates, and determine the effective defects by comparing the area, gray-scale mean and their corresponding thresholds;
[0014] S6. If a valid defect exists, the defect type is determined based on the image channel that triggered the determination;
[0015] S7. Determine whether all detection points in the preset scanning path have been completed. If not, move to the next detection point and return to step S2; if yes, proceed to step S8.
[0016] S8. Integrate the defect type and location information obtained from all inspection points of the product to be inspected. If there is at least one valid defect, the product to be inspected is determined to be unqualified; otherwise, it is determined to be qualified.
[0017] Furthermore, in step S3, the preprocessing process includes: performing median filtering and histogram equalization on the multispectral image sequence to obtain the preprocessed multispectral image sequence.
[0018] Furthermore, in step S3, performing defect enhancement on the preprocessed multispectral image sequence includes the following steps:
[0019] Perform a difference operation on the parallel white light image and the coaxial light source image to obtain a scratch candidate image;
[0020] The low-angle dark field light source image is binarized with a high threshold to obtain a particle candidate image.
[0021] Furthermore, step S5 includes the following steps:
[0022] Extract the area and center coordinates of each connected region of the scratch candidate image and the particle candidate image, and extract the gray-scale mean of the connected regions of the scratch candidate image;
[0023] If the area of the candidate scratch image is greater than the area threshold and the average gray value is greater than the average gray value threshold, it is determined to be a valid scratch.
[0024] If the area of the candidate particle image is greater than the area threshold, it is determined to be a valid particle.
[0025] Furthermore, the area threshold is 50 to 300 pixels, used to eliminate noise points and single-pixel pseudo-defects;
[0026] The grayscale threshold is 60 to 120 pixels to ensure that the differences in the scratch candidate image are physically significant.
[0027] Furthermore, in step S2, the light source further includes an ultraviolet light source, and the multispectral image sequence further includes ultraviolet images acquired under the illumination of the ultraviolet light source; correspondingly, the enhanced feature image further includes a fluorescence candidate image for detecting oil stains or fluorescent residues.
[0028] In a second aspect, the present invention provides an automated appearance inspection device based on multispectral imaging, which is used to implement an automated appearance inspection method based on multispectral imaging as described in the first aspect, comprising:
[0029] The motion control module is used to control the relative position between the product under inspection and the imaging module, so that the imaging area sequentially covers multiple detection points on the surface of the product under inspection according to the preset scanning path.
[0030] The multispectral illumination module includes a parallel white light source, a coaxial light source, and a low-angle dark field light source, which are used to sequentially illuminate the surface of the product under inspection at each detection point;
[0031] An imaging module is electrically connected to and synchronously triggered by the multispectral illumination module, used to acquire multiple single-channel or multi-channel images under corresponding illumination conditions to form a multispectral image sequence.
[0032] The image processing module is communicatively connected to the imaging module and is used to perform image preprocessing, defect enhancement, connected component analysis and defect determination on the multispectral image sequence to obtain the defect type and location information of each detection point. After completing the scanning of all detection points, if there is at least one valid defect, an unqualified signal is output; otherwise, a qualified signal is output.
[0033] Furthermore, the motion control module includes: an X-axis conveying mechanism for carrying and moving the product to be inspected along the product length direction;
[0034] The YZ-axis gantry mechanism spans above the X-axis conveying mechanism and is used to move the imaging module and multispectral illumination module in the vertical plane to adjust the imaging height and lateral scanning position.
[0035] Furthermore, the multispectral illumination module also includes an ultraviolet light source for exciting fluorescent substances on the surface of the product to be inspected;
[0036] The imaging module is equipped with ultraviolet band response capability or an ultraviolet bandpass filter to acquire ultraviolet images to generate fluorescence candidate images, thereby detecting oil stains or fluorescent residues.
[0037] Furthermore, the imaging module includes a color industrial camera and a monochrome industrial camera. The monochrome industrial camera is equipped with an electric filter wheel, which has red, green, blue, and near-infrared bandpass filters for selectively acquiring images in specific wavelengths.
[0038] The technical solution provided by this invention has the following advantages compared with the known prior art:
[0039] 1. This invention controls the relative position between the product under inspection and the imaging module, and sequentially illuminates the surface of the product under inspection with multiple light sources to form a multispectral image sequence. After preprocessing, defect enhancement, connected component analysis, and defect determination, it can comprehensively cover the surface of the product under inspection, effectively detect various defects (such as scratches, particles, etc.), and accurately determine their type and location. Compared with the traditional single-light source detection scheme, this invention utilizes the image differences under different lighting conditions to significantly improve the accuracy and reliability of defect detection, and is especially suitable for the inspection of product surfaces with complex geometries.
[0040] 2. This invention generates scratch candidate images by performing difference operations on parallel white light images and coaxial light source images, and generates particle candidate images by performing high-threshold binarization on low-angle dark field images, making full use of the optical response characteristics of different defects under specific illumination; furthermore, a dual threshold criterion of area and gray-scale mean is introduced for scratch candidate images, while only the area threshold is used for particle candidate images, achieving highly robust defect classification without relying on deep learning models, effectively suppressing texture interference and noise artifacts, and significantly reducing the false alarm rate;
[0041] 3. This invention employs a dynamic threshold (such as T) based on background statistical characteristics in particle and fluorescence detection. high =μ bg +3σ bg or T fluorescence =μ bg +2σ bg This system can automatically adapt to fluctuations in ambient light and differences in material reflectivity, avoiding the problem of fixed thresholds failing under different batches or materials. While ensuring a high detection rate, this strategy significantly improves the stability and generalization ability of the system in long-term operation in industrial settings.
[0042] 4. By introducing an ultraviolet light source and an ultraviolet response imaging module, this invention can excite and capture the fluorescence signals of substances such as oil stains and cleaning agent residues, and generate fluorescence candidate images to identify chemical pollution defects that cannot be detected by traditional visible light. This function expands the detection range from physical morphological defects (scratches, particles) to functional pollution defects, significantly improving the dimension and completeness of product quality control. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0044] Figure 1 This is a flowchart of embodiment 1 of the present invention;
[0045] Figure 2 This is a diagram of the device architecture in Embodiment 2 of the present invention. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0047] Unless otherwise stated, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. While only preferred methods and materials are described herein, any methods and materials similar or equivalent to those described herein may be used in the implementation or testing of this invention. All references to this specification are incorporated by way of citation to disclose and describe methods and / or materials associated with those references. In the event of any conflict with any incorporated reference, the content of this specification shall prevail. The terms “comprising,” “including,” “having,” “containing,” etc., as used herein are open-ended terms, meaning that they include but are not limited to. Unless the context clearly indicates otherwise, the expressions “a” and “an” as used herein include plural references. It should be noted that “first,” “second,” etc., are used merely for convenience of description and distinction and should not be construed as indicating or implying relative importance. The term “about” as used herein indicates a range of ±20% of the following numerical value. In some embodiments, the term “about” indicates a range of ±10% of the following numerical value. In some embodiments, the term “about” indicates a range of ±5% of the following numerical value. The invention is further described below with reference to embodiments.
[0048] Example: Refer to Figures 1 to 2 .
[0049] Example 1
[0050] This embodiment provides an automated appearance inspection method based on multispectral imaging, referencing... Figure 1 The method includes the following steps:
[0051] S1. Control the relative position between the product to be inspected and the imaging module, and move sequentially to multiple detection points according to the preset scanning path so that the imaging area successively covers the surface of the product to be inspected;
[0052] S2. At the current inspection point, different types of light sources are used to illuminate the surface of the product to be inspected in sequence, and multiple single-channel or multi-channel images under the corresponding illumination conditions are acquired simultaneously to form a multispectral image sequence. The light sources include parallel white light sources, coaxial light sources and low-angle dark field light sources. The multispectral image sequence includes parallel white light images acquired under parallel white light source illumination, coaxial light source images acquired under coaxial light source illumination, and low-angle dark field light source images acquired under low-angle dark field light source illumination.
[0053] S3. Perform image preprocessing on the multispectral image sequence to obtain the preprocessed multispectral image sequence;
[0054] S4. Perform defect enhancement operation on the preprocessed multispectral image sequence to obtain enhanced feature images, which include scratch candidate images and particle candidate images;
[0055] S5. Perform connected component analysis on the enhanced feature map, extract the area, mean gray level and center coordinates, and determine the effective defects by comparing the area, mean gray level and their corresponding thresholds;
[0056] S6. If a valid defect exists, the defect type is determined based on the image channel that triggered the determination;
[0057] S7. Determine whether all detection points in the preset scanning path have been completed. If not, move to the next detection point and return to step S2; if yes, proceed to step S8.
[0058] S8. Combine the defect type and location information obtained from all inspection points of the product to be inspected. If there is at least one valid defect, the product to be inspected is determined to be unqualified; otherwise, it is determined to be qualified.
[0059] In step S2, when a parallel white light source is used, the wavelength range is 400-700 nm, and the direction is 90° vertical illumination from directly above. This is used to detect macroscopic scratches, pits, and printed characters on the surface of the product under inspection. When a coaxial light source is used, the wavelength range is 400-700 nm, and the direction is the same as the optical axis of the camera (beam splitter structure). This can solve the specular reflection problem of highly reflective surfaces (such as metal and glass), making minor pits, scratches, and other defects on the surface stand out due to local shadows, eliminating artifacts caused by uneven illumination. The coaxial light source is used to detect minor scratches and imprints on highly reflective surfaces (such as metal and glass) of the product under inspection. When a low-angle dark field light source is used, the wavelength range is 400-700 nm, and the direction is grazing incidence from the side at 15°~30°. This is used to detect protruding foreign objects, burrs, and particles on the product under inspection.
[0060] Regarding camera configuration:
[0061] Color industrial camera: global shutter, resolution ≥ 5 megapixels, used to acquire RGB three-channel images and retain color information.
[0062] Monochrome industrial camera: Equipped with an electrically switchable filter wheel containing red / green / blue / near-infrared / ultraviolet passband filters, it activates only one band at a time to acquire a single-band high signal-to-noise ratio image.
[0063] The above method, by controlling the relative position between the product under inspection and the imaging module, and sequentially illuminating the surface of the product under inspection with multiple light sources to form a multispectral image sequence, followed by preprocessing, defect enhancement, connected component analysis, and defect determination, can comprehensively cover the surface of the product under inspection, effectively detect various defects (such as scratches, particles, etc.), and accurately determine their type and location. Compared with traditional single-light source detection schemes, this invention utilizes the image differences under different lighting conditions, significantly improving the accuracy and reliability of defect detection, and is particularly suitable for the inspection of product surfaces with complex geometries.
[0064] In step S3, the preprocessing process includes: performing median filtering and histogram equalization on the multispectral image sequence to obtain the preprocessed multispectral image sequence.
[0065] During preprocessing, for the acquired raw images: I parallel Color or grayscale images under parallel white light, I coaxial Image under coaxial light, I darkfield Images under dark lighting conditions.
[0066] To remove salt-and-pepper noise (such as sensor noise and light source flicker), median filtering is performed. For each pixel, the median value of its 3×3 neighborhood pixels is used to replace the original value, which preserves edges and smooths noise. The calculation formula is:
[0067] ;
[0068] in, To output the pixel value of the image at position (x, y); The original pixel values within the neighborhood of the input image; The coordinates of the currently processed pixel; [−1,0,1] represents the neighborhood offset (relative coordinates); [−1,0,1] defines the neighborhood range.
[0069] To enhance overall image contrast and make low-contrast areas clearer, histogram equalization is performed, stretching the original image's grayscale distribution to the full range (0~255) and improving the visibility of details in both bright and dark areas. This is particularly suitable for product surfaces with uneven lighting (such as reflective metal parts), resulting in an enhanced image I... enhanced ,
[0070] The above-described method effectively removes noise and enhances contrast in multispectral image sequences by performing median filtering and histogram equalization, making subsequent defect enhancement operations more accurate. This preprocessing step not only improves image quality but also provides clearer and more stable input data for subsequent connected component analysis and defect identification, thereby reducing the false positive rate and improving overall detection accuracy.
[0071] In step S3, performing defect enhancement on the preprocessed multispectral image sequence includes the following steps:
[0072] The preprocessed parallel white light image and the preprocessed coaxial light source image are subjected to a difference operation to obtain a scratch candidate image; the preprocessed low-angle dark field light source image is subjected to high threshold binarization to obtain a particle candidate image.
[0073] This process involves generating a scratch candidate image by calculating the absolute difference between the preprocessed parallel white light image and the preprocessed coaxial light source image, and using the brightness difference of the scratch under the two lighting conditions to enhance the defect. At the same time, a dynamic threshold is set based on the background statistical characteristics of the preprocessed dark field image to separate the protruding foreign objects from the background and generate a particle candidate image, thereby achieving efficient identification of multiple types of defects.
[0074] The formula for difference operations is:
[0075] ;
[0076] in, The pixel value at position (x,y) of the candidate scratch image (difference image) represents the difference in brightness at that point under parallel light and coaxial light. The larger the value, the more likely it is to be a scratch or pit. The gray value at (x,y) is the preprocessed parallel white light image. The image was acquired under parallel light source illumination. The scratch area is darkened by the shadow, forming a low-brightness area. The gray value of the preprocessed coaxial light source image at (x,y); These are the image coordinates (pixel positions).
[0077] Using parallel light (90º perpendicular illumination), the scratch shows a distinct shadow and reduced brightness; using coaxial light (illumination along the same axis as the camera), reflected light enters the lens directly, the scratch has no shadow, and the brightness is close to normal. Therefore, the brightness difference of the scratch under the two lighting conditions is significant and can be highlighted through difference analysis. For the obtained difference results, if it represents a normal area, then D... scratch ≈0 (consistent brightness); if it is a scratched area, then D scratch >0, and the value is relatively high (due to the presence of shadows).
[0078] High-threshold binarization process: using the preprocessed dark field image I darkfield_pre And set a threshold T high : μ bg σ represents the average gray level of the background area. bg Using the background standard deviation as the threshold, and employing three times the standard deviation as an empirical threshold, it can be guaranteed that 99.7% of the background is suppressed. It can effectively suppress most background noise and retain only truly prominent foreign objects.
[0079] The binarization formula is:
[0080] ;
[0081] in, The pixel value at (x,y) is the candidate image of the particle (binary image), where 1 represents a potential particle and 0 represents the background; represents the grayscale value at (x,y) of the preprocessed dark field image; The threshold is high (binarization threshold).
[0082] The above method generates a scratch candidate image D by performing a difference operation between the preprocessed parallel white light image and the preprocessed coaxial light source image. scratch And perform high-threshold binarization on low-angle dark field light source images to generate particle candidate images B. particle This method fully utilizes the response differences of different light sources to different defect characteristics. This defect enhancement operation based on physical optics principles does not rely on complex machine learning models, has high robustness and interpretability, can operate stably in industrial environments, and quickly and accurately identify scratches and particle defects.
[0083] Step S5 includes the following steps:
[0084] Extract the area and center coordinates of each connected component in the candidate scratch image and the candidate particle image, and extract the gray-scale mean of the connected components in the candidate scratch image. If the area of the candidate scratch image is greater than the area threshold and the gray-scale mean is greater than the gray-scale mean threshold, it is determined to be a valid scratch. If the area of the candidate particle image is greater than the area threshold, it is determined to be a valid particle.
[0085] The area threshold is 50 to 300 pixels, used to eliminate noise points and single-pixel pseudo-defects;
[0086] The grayscale threshold is 60 to 120 pixels to ensure that the differences in the scratch candidate images are physically significant.
[0087] In the above judgment process, for the area condition: if the area of the scratch candidate image is greater than the area threshold, false defects such as noise and single bright spots can be excluded; for the intensity condition, only scratch candidate image D is applicable. scratch If the grayscale mean is greater than the grayscale mean threshold, it is ensured that it is a real scratch rather than a slight difference. If the above conditions are met, it is judged as a valid defect.
[0088] For the connected component analysis phase, the formula for calculating the mean gray value of the connected component is:
[0089] ;
[0090] Among them, Mean k Let be the average gray value of the k-th connected component; N represents the set of pixels in the k-th connected component; k D is the area (in pixels) of the connected component. scratch (x,y) is the gray value of the difference image at pixel (x,y).
[0091] By setting an area threshold of 50 to 300 pixels and a grayscale threshold of 60 to 120 pixels, the present invention effectively eliminates noise points and single-pixel false defects, ensuring that only genuine defect areas are identified as valid defects. This threshold-based determination method is simple and efficient, avoiding over-reliance on complex algorithms or models, while ensuring the reliability and consistency of detection results. It is particularly suitable for online inspection scenarios in large-scale production.
[0092] In step S6, when classifying defect types, the defect type is determined by the activated image channel based on the image channel that triggered the judgment: if only B particle If an alarm is triggered, the defect type is determined to be particles; if only D... scratch If an alarm is triggered, the defect type is determined to be a scratch / dimple. Each detection point returns a set of defect information, including: location (X,Y), defect type (e.g., scratch, particle), and area size.
[0093] In some embodiments, in step S2, the light source further includes an ultraviolet light source, and the multispectral image sequence further includes an ultraviolet image I acquired under ultraviolet light source illumination. uv Correspondingly, the enhanced feature image also includes fluorescence candidate image B. fluor It is used to detect oil stains or fluorescent residues.
[0094] Fluorescence candidate map (B) fluor ): Based on the characteristic of certain substances emitting light under ultraviolet light, the bright areas in the preprocessed image under ultraviolet light are directly detected, and the background is distinguished from potential oil stains or other fluorescent substances by setting an appropriate threshold.
[0095] Ultraviolet light (365 nm) excites certain substances (such as cleaning agent residue, oil stains, and fluorescent markers) to emit visible light (fluorescence). Normal material surfaces do not emit light and appear black; fluorescent areas appear as bright spots, which may be oil stains, cleaning agent residues, or specific chemical markers.
[0096] The processing procedure is as follows:
[0097] ;
[0098] in, The value is the pixel value at (x,y) of the candidate fluorescent image (binary image). 1 indicates that the point is a fluorescent area (suspected oil or chemical residue), and 0 indicates a non-fluorescent area (normal surface). This represents the grayscale value of the preprocessed ultraviolet image at (x, y). This is the fluorescence detection threshold; These are the image coordinates (pixel positions).
[0099] The formula for setting the dynamic threshold of the fluorescence candidate image is as follows: .
[0100] When classifying defects, it was determined to be only B. fluor If an alarm is triggered, the defect type is determined to be oil stain / fluorescence. If multiple alarms are triggered simultaneously, they can be combined or recorded separately (e.g., scratch + oil stain).
[0101] The above method, in step S2, introduces an ultraviolet light source and generates a fluorescence candidate image for detecting oil stains or fluorescent residues, thus expanding the detection capabilities of the equipment. The ultraviolet light source can excite certain specific substances (such as cleaning agent residues and oil stains) to emit fluorescence, which is then clearly displayed in the ultraviolet image. This multispectral synergistic detection mechanism not only improves the comprehensiveness of detection but also effectively identifies subtle defects or contaminants that are difficult to detect with other light sources, further enhancing product quality control.
[0102] Example 2
[0103] This embodiment provides an automated appearance inspection device based on multispectral imaging. This device is used to implement an automated appearance inspection method based on multispectral imaging as described in Embodiment 1. (Refer to...) Figure 2 ,include:
[0104] The motion control module is used to control the relative position between the product under inspection and the imaging module, so that the imaging area sequentially covers multiple detection points on the surface of the product under inspection according to the preset scanning path.
[0105] The multispectral illumination module includes a parallel white light source, a coaxial light source, and a low-angle dark field light source, which are used to sequentially illuminate the surface of the product under inspection at each detection point;
[0106] The imaging module is electrically connected to and synchronously triggered by the multispectral illumination module, and is used to acquire multiple single-channel or multi-channel images under corresponding illumination conditions to form a multispectral image sequence.
[0107] The image processing module, which is connected to the imaging module, is used to perform image preprocessing, defect enhancement, connected component analysis, and defect determination on the multispectral image sequence. It obtains the defect type and location information of each detection point, and outputs a non-qualified signal if at least one valid defect exists after scanning all detection points; otherwise, it outputs a qualified signal.
[0108] The motion control module includes: an X-axis conveyor mechanism for carrying and moving the product to be inspected along its length; and a YZ-axis gantry mechanism spanning above the X-axis conveyor mechanism to move the imaging module and multispectral illumination module in the vertical plane, adjusting the imaging height and lateral scanning position. The motion control module, comprising the X-axis conveyor mechanism and the YZ-axis gantry mechanism, can flexibly adjust the relative position between the product to be inspected and the imaging module, achieving two-dimensional scanning coverage. This three-axis linkage structure design allows the equipment to scan product surfaces with complex geometries without blind spots, solving the detection blind zone problem of traditional fixed-field-of-view inspection equipment, ensuring accurate inspection of every surface, and greatly improving the comprehensiveness and flexibility of the inspection.
[0109] The multispectral illumination module also includes an ultraviolet light source to excite fluorescent substances on the surface of the product to be inspected; the imaging module is equipped with ultraviolet band response capability or an ultraviolet bandpass filter to acquire ultraviolet images to generate fluorescence candidate images, thereby detecting oil stains or fluorescent residues.
[0110] The imaging module includes a color industrial camera and a monochrome industrial camera. The monochrome camera is equipped with a motorized filter wheel containing red, green, blue, and near-infrared bandpass filters for selectively acquiring images in specific wavelengths. This multi-band imaging configuration not only acquires rich spectral information but also dynamically adjusts the imaging bands according to different inspection needs, enhancing the equipment's adaptability and inspection accuracy. Especially when it is necessary to distinguish material differences or specific chemical compositions, multi-band imaging provides more detailed image data, helping to improve the accuracy of defect identification.
[0111] 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 the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions will not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. An automated appearance inspection method based on multispectral imaging, characterized in that, The method includes the following steps: S1. Control the relative position between the product to be inspected and the imaging module, and move sequentially to multiple detection points according to the preset scanning path so that the imaging area successively covers the surface of the product to be inspected; S2. At the current detection point, different types of light sources are used to illuminate the surface of the product to be inspected in sequence, and multiple single-channel or multi-channel images under the corresponding illumination conditions are acquired simultaneously to form a multispectral image sequence. The light sources include parallel white light sources, coaxial light sources, and low-angle dark field light sources. The multispectral image sequence includes parallel white light images acquired under the illumination of the parallel white light sources, coaxial light source images acquired under the illumination of the coaxial light sources, and low-angle dark field light source images acquired under the illumination of the low-angle dark field light sources. S3. Perform image preprocessing on the multispectral image sequence to obtain a preprocessed multispectral image sequence; S4. Perform a defect enhancement operation on the preprocessed multispectral image sequence to obtain an enhanced feature image, which includes a scratch candidate image and a particle candidate image; S5. Perform connected component analysis on the enhanced feature map, extract the area, gray-scale mean and center coordinates, and determine the effective defects by comparing the area, gray-scale mean and their corresponding thresholds; S6. If a valid defect exists, the defect type is determined based on the image channel that triggered the determination; S7. Determine whether all detection points in the preset scanning path have been completed. If not, move to the next detection point and return to step S2. If so, proceed to step S8; S8. Integrate the defect type and location information obtained from all inspection points of the product to be inspected. If there is at least one valid defect, the product to be inspected is determined to be unqualified; otherwise, it is determined to be qualified.
2. The automated appearance inspection method based on multispectral imaging according to claim 1, characterized in that, In step S3, the preprocessing process includes: performing median filtering and histogram equalization on the multispectral image sequence to obtain the preprocessed multispectral image sequence.
3. The automated appearance inspection method based on multispectral imaging according to claim 1, characterized in that, In step S3, performing defect enhancement on the preprocessed multispectral image sequence includes the following steps: Perform a difference operation on the parallel white light image and the coaxial light source image to obtain a scratch candidate image; The low-angle dark field light source image is binarized with a high threshold to obtain a particle candidate image.
4. The automated appearance inspection method based on multispectral imaging according to claim 1, characterized in that, Step S5 includes the following steps: Extract the area and center coordinates of each connected region of the scratch candidate image and the particle candidate image, and extract the gray-scale mean of the connected regions of the scratch candidate image; If the area of the candidate scratch image is greater than the area threshold and the average gray value is greater than the average gray value threshold, it is determined to be a valid scratch. If the area of the candidate particle image is greater than the area threshold, it is determined to be a valid particle.
5. The automated appearance inspection method based on multispectral imaging according to claim 4, characterized in that, The area threshold is 50 to 300 pixels, used to eliminate noise points and single-pixel pseudo-defects; The grayscale threshold is 60 to 120 pixels to ensure that the differences in the scratch candidate image are physically significant.
6. The automated appearance inspection method based on multispectral imaging according to claim 1, characterized in that, In step S2, the light source further includes an ultraviolet light source, and the multispectral image sequence further includes ultraviolet images acquired under the illumination of the ultraviolet light source; correspondingly, the enhanced feature image further includes a fluorescence candidate image for detecting oil stains or fluorescent residues.
7. An automated appearance inspection device based on multispectral imaging, characterized in that, The device is used to implement an automated appearance inspection method based on multispectral imaging as described in any one of claims 1-6, comprising: The motion control module is used to control the relative position between the product under inspection and the imaging module, so that the imaging area sequentially covers multiple detection points on the surface of the product under inspection according to the preset scanning path. The multispectral illumination module includes a parallel white light source, a coaxial light source, and a low-angle dark field light source, which are used to sequentially illuminate the surface of the product to be inspected at each detection point. An imaging module is electrically connected to and synchronously triggered by the multispectral illumination module, used to acquire multiple single-channel or multi-channel images under corresponding illumination conditions to form a multispectral image sequence. The image processing module is communicatively connected to the imaging module and is used to perform image preprocessing, defect enhancement, connected component analysis and defect determination on the multispectral image sequence to obtain the defect type and location information of each detection point. After completing the scanning of all detection points, if there is at least one valid defect, an unqualified signal is output; otherwise, a qualified signal is output.
8. The automated appearance inspection device based on multispectral imaging according to claim 7, characterized in that, The motion control module includes: an X-axis conveyor mechanism for carrying and moving the product to be inspected along the product length direction; The YZ-axis gantry mechanism spans above the X-axis conveying mechanism and is used to move the imaging module and multispectral illumination module in the vertical plane to adjust the imaging height and lateral scanning position.
9. An automated appearance inspection device based on multispectral imaging according to claim 7, characterized in that, The multispectral illumination module also includes an ultraviolet light source for exciting fluorescent substances on the surface of the product to be inspected; The imaging module is equipped with ultraviolet band response capability or an ultraviolet bandpass filter to acquire ultraviolet images to generate fluorescence candidate images, thereby detecting oil stains or fluorescent residues.
10. An automated appearance inspection device based on multispectral imaging according to claim 7, characterized in that, The imaging module includes a color industrial camera and a monochrome industrial camera. The monochrome industrial camera is equipped with an electric filter wheel, which has red, green, blue and near-infrared bandpass filters for selectively acquiring images in specific wavelengths.