Image-based paint defect point detection method and system
By employing phase-shifting fringe acquisition, normalized reflection calculation, and phase gradient separation techniques, combined with physical wavelength band quantization, the stability and accuracy issues of orange peel defect detection on dark, high-gloss painted surfaces have been resolved, achieving higher detection consistency and adaptability.
Patent Information
- Application Number
- CN202610467187.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-10
- Publication Date
- 2026-07-10
AI Technical Summary
Existing technologies struggle to accurately distinguish between reflection changes in normal curved areas and microscopic undulations caused by orange peel defects in the inspection of dark, high-gloss painted surfaces, resulting in poor stability and positioning accuracy of the inspection results.
A sequence of reflection images was constructed using phase-shifted fringe acquisition. Combined with normalized reflection calculation, phase gradient separation, and physical wavelength zonal quantization techniques, the characteristics of orange peel defects were extracted and quantized.
It improves the stability and positioning accuracy of paint defect detection, adapts to different workpiece sizes and imaging conditions, and reduces the inconsistency of detection results.
Smart Images

Figure CN122367936A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial visual inspection technology, and in particular to an image-based method and system for detecting paint defects. Background Technology
[0002] Currently, in the field of paint surface quality inspection, especially in dark and high-gloss paint application scenarios such as automotive exterior panels, home appliance panels, and 3C product casings, orange peel defects are one of the important indicators affecting appearance quality. Their detection mainly relies on manual visual inspection or automatic detection methods based on image grayscale features.
[0003] To achieve automated inspection, existing technologies typically employ analysis methods based on image brightness distribution, local contrast, or texture features. For example, they calculate grayscale variance, local energy, gradient amplitude, or use fixed-scale filters to extract surface texture changes, using these as the basis for determining orange peel defects. However, under conditions of dark, high-gloss painted surfaces, due to the strong specular reflection characteristics of the paint surface, incident light forms obvious high-brightness reflection bands in different curvature regions, and the reflection intensity varies significantly with the viewing angle, resulting in large differences in the image grayscale distribution at different locations on the same workpiece. In this situation, the reflection changes in normal curved surface areas and the micro-undulation responses caused by orange peel defects are easily superimposed in the image, making it difficult for detection methods based on grayscale or simple texture features to accurately distinguish between true defects and reflection disturbances.
[0004] Furthermore, orange peel defects are not isolated point-like or linear defects, but rather consist of dense, minute undulations, characterized by multiple spatial scales: including sub-millimeter-level fine ripples as well as millimeter-level or even larger-scale, gradually varying undulations. Existing technologies often employ fixed-scale windows or single-band filtering for analysis. When the detection scale is small, it can reflect subtle texture changes but is easily affected by noise; when the detection scale is large, it easily overlooks fine orange peel structures, making it difficult to simultaneously capture undulation characteristics at different scales, resulting in poor stability of the detection results.
[0005] Therefore, there is an urgent need for a detection method that can effectively separate surface reflection changes under complex reflection environments and multi-scale undulation conditions, and perform multi-band quantitative analysis of orange peel undulations under a unified physical scale, so as to improve the stability, consistency and positioning accuracy of orange peel defect detection. Summary of the Invention
[0006] To address the aforementioned technical shortcomings, the purpose of this invention is to propose an image-based method for detecting paint defects. This method aims to solve the technical problem that existing technologies, which mainly rely on grayscale contrast for surface texture analysis, struggle to accurately locate paint defects, especially when there are minute orange peel undulations coupled with the overall curvature on dark, high-gloss paint surfaces.
[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The present invention provides an image-based method for detecting paint defects.
[0008] The image-based paint defect detection method includes: Step S10: Obtain a multi-frame reflection stripe image sequence of the target detection area of the workpiece to be inspected, and perform the original reflection image construction task based on the multi-frame reflection stripe image sequence using the phase-shifting stripe acquisition construction method, and output the original reflection image set; Step S20: Based on the original reflection image set, a normalized reflection solution mechanism is used to perform the reflection information extraction task and output the reflection feature map; Step S30: Based on the reflection feature map, a phase gradient separation mechanism is used to perform a preprocessing task and output a micro slope map; Step S40: Based on the micro slope map, perform orange peel quantization using a physical wavelength band quantization mechanism to output an orange peel quantization map; Step S50: Perform adaptive threshold determination and defect region extraction based on the orange peel quantization map, and output the orange peel defect detection result.
[0009] Preferably, step S10, which involves acquiring a multi-frame reflective fringe image sequence of the target detection area of the workpiece to be inspected, performing an original reflective image construction task based on the multi-frame reflective fringe image sequence using a phase-shifting fringe acquisition method, and outputting an original reflective image set, specifically includes: Step S101: Obtain the target detection area on the surface of the workpiece to be inspected, control the preset stripe light source component to project a periodically changing phase-shifted stripe pattern onto the target detection area, and simultaneously acquire the corresponding multi-frame reflection images by the industrial camera to obtain a multi-frame reflection stripe image sequence. Step S102: Record exposure time based on multi-frame reflectance stripe image sequence Light source power Camera gain And object-side imaging scale parameters And establish a set of collected parameters; Step S103: Preset saturation pixel ratio constraints. Based on the saturation pixel ratio constraints, adjust the exposure time and light source power together according to the multi-frame reflective stripe image sequence and the acquisition parameter set. Then, summarize the adjusted multi-frame reflective stripe image sequence to form the original reflective image set and output the original reflective image set.
[0010] Preferably, in step S10, the first frame of the multi-frame reflective stripe image sequence... Frame stripe pattern satisfy: ; in, Let the coordinates be those of the light source plane. Let x be the x-coordinate of the light source plane. The vertical coordinate of the light source plane; For the fringe spatial frequency, For phase shift, Cosine function.
[0011] Preferably, step S20, which involves performing a reflection information extraction task based on the original reflection image set using a normalized reflection solution mechanism and outputting a reflection feature map, specifically includes: Step S201: Perform dark field correction and gain normalization on the original reflectance image set to obtain the corrected image sequence. , ,in, Let be the pixel value of the k-th frame at pixel coordinate u after dark field correction and gain normalization. Let be the pixel grayscale value of the k-th frame of the original reflected image at pixel coordinate u. As a dark field reference image, For gain-corrected images, Stable terms to prevent numerical anomalies caused by a denominator of zero or an excessively small normalization interval; Step S202: Perform saturation pixel masking and quantile normalization based on the corrected image sequence to obtain a normalized reflectance image sequence. ; Step S203: Extract the wrap-around phase map based on the normalized reflectance image sequence Striped mode diagram and effective reflection area mask and wrap the phase map Striped mode diagram and effective reflection area mask Perform combined mapping to form a reflection feature map.
[0012] Preferably, in step S20, ; ; in, The pixel grayscale values in the normalized reflectance image sequence. This is the saturation threshold; This is an indicator function that takes the value 1 when the condition within the parentheses is true, and 0 otherwise. The saturation pixel mask value at pixel coordinate u is used to characterize whether the corresponding pixel is a saturated pixel; The fifth percentile value of the pixel grayscale distribution in the target detection region of the k-th frame corrected image; This is the 95th percentile value of the pixel grayscale distribution in the target detection region of the k-th frame corrected image.
[0013] Preferably, step S30, which involves performing a preprocessing task based on the reflection feature map using a phase gradient separation mechanism to output a micro slope map, specifically includes: Step S301: Extract the wrapping phase and effective reflection region from the reflection feature map, and calculate the spatial gradient of the wrapping phase within the effective reflection region to obtain the phase gradient field at pixel coordinate u. And based on the object-side imaging scale parameters, the phase gradient field Converted to reflection slope field ; Step S302: Based on the reflection slope field Constructing a macroscopic slope field and micro slope field ,in: ; ; in, It is a Gaussian filter kernel; The Gaussian kernel standard deviation parameter corresponding to the macroscopic separation scale is used to control the reflection slope field. The spatial range of effect during smoothing processing; Step S303: Based on the micro slope field A curvature compensation mapping method is used to construct and output a micro slope map.
[0014] Preferably, step S40, which involves performing orange peel quantization based on the microscopic slope map using a physical wavelength band quantization mechanism and outputting an orange peel quantized map, specifically includes: Step S401: Map the microscopic slope map to the physical wavelength range according to the object-side imaging scale parameters, and perform multi-band decomposition on the physical wavelength range to obtain the frequency band response map corresponding to each frequency band; wherein, the first Each frequency band corresponds to a wavelength range of The corresponding frequency range is: ; This is the minimum physical wavelength value corresponding to the b-th frequency band, used to define the shortest fluctuation scale covered by this frequency band; The maximum physical wavelength value corresponding to the b-th frequency band is used to limit the longest fluctuation scale covered by this frequency band; This represents the minimum spatial frequency value corresponding to the b-th frequency band. This represents the maximum spatial frequency value corresponding to the b-th frequency band. Step S402: Perform local robust statistics based on the frequency band response map corresponding to each frequency band to obtain local statistics for each frequency band and statistics for the reference sample frequency band; wherein, the local statistics for each frequency band include the local median energy value, the local energy dispersion, and the pixel-level energy deviation; the statistics for the reference sample frequency band include the reference median energy value and the reference energy dispersion; Step S403: Construct pixel-level orange peel quantization values based on local statistics of each frequency band and statistics of the reference sample frequency band, map all pixel-level orange peel quantization values to form an orange peel quantization map, and output the orange peel quantization map.
[0015] The present invention also provides an image-based paint defect detection system comprising: The image acquisition module is used to acquire a multi-frame reflective stripe image sequence of the target detection area of the workpiece to be inspected, and to perform the original reflective image construction task based on the multi-frame reflective stripe image sequence using a phase-shifting stripe acquisition construction method, and output the original reflective image set. The reflection resolution module is used to perform reflection information extraction tasks based on the original reflection image set using a normalized reflection resolution mechanism, and output a reflection feature map. The preprocessing module is used to perform preprocessing tasks based on the reflection feature map using a phase gradient separation mechanism, and output a micro slope map. The quantization analysis module is used to perform orange peel quantization tasks based on the micro slope map using a physical wavelength band quantization mechanism, and output an orange peel quantization map. The result output module is used to perform adaptive threshold determination and defect region extraction based on the orange peel quantization map, and output the orange peel defect detection result.
[0016] The present invention also provides an image-based paint defect detection device, comprising: a memory, a processor, and an image-based paint defect detection program stored in the memory and executable on the processor. When the image-based paint defect detection program is executed by the processor, it implements an image-based paint defect detection method.
[0017] The present invention also provides a computer program product, including an image-based paint defect detection program, which, when executed by a processor, implements the image-based paint defect detection method.
[0018] The beneficial effects of this invention are as follows: By performing phase calculation on the reflective stripe image and constructing a reflective slope characterization quantity, and then based on the separation processing of macroscopic slope components and microscopic slope components, the low-frequency interference caused by the overall curvature, posture changes and specular reflection of the workpiece is effectively removed, so that the high-frequency slope components corresponding to the subtle undulations of orange peel can be extracted separately. This avoids the misjudgment problem caused by the superposition of curvature changes and orange peel undulations in traditional gray-scale or single-scale filtering methods, and improves the stability and repeatability of the detection results.
[0019] This invention maps a microscopic slope map to the actual physical wavelength range and performs multi-band decomposition. At the same time, it combines local median energy statistics and reference sample statistics to construct pixel-level orange peel quantization values, thereby achieving a unified quantitative expression of orange peel undulations at different scales. This avoids the quantization inconsistency problem caused by fixed detection scales or non-adaptive thresholds in traditional methods, and improves the adaptability and quantization accuracy of orange peel defect detection under different workpiece sizes, different imaging conditions, and different spraying processes. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic flowchart of the first embodiment of an image-based paint defect detection method according to the present invention.
[0022] Figure 2 This is a schematic diagram of an image-based paint defect detection method according to the present invention. Detailed Implementation
[0023] 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 only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] Example 1: As Figure 1 The diagram shown is a flowchart of the first embodiment of the image-based paint defect detection method of the present invention, which presents the first embodiment of the image-based paint defect detection method of the present invention.
[0025] In the first embodiment, the image-based paint defect detection method includes: Step S10: Obtain a multi-frame reflection stripe image sequence of the target detection area of the workpiece to be inspected, and perform the original reflection image construction task based on the multi-frame reflection stripe image sequence using the phase-shifting stripe acquisition construction method, and output the original reflection image set; It should be noted that the target detection area refers to the region on the surface of the workpiece used for detecting paint defects, including but not limited to areas with dark high-gloss paint, areas with dark semi-high-gloss paint, curved transition areas, locally high-reflection areas, and areas for appearance quality inspection after painting. A multi-frame reflection stripe image sequence refers to a set of multiple reflection stripe images acquired sequentially within the same target detection area according to a preset phase shift order. This includes reflection images corresponding to different phase shift angles, reflection images under different exposure conditions, and auxiliary reflection images used to compensate for local high-gloss saturation. The phase-shifted stripe acquisition and construction method involves controlling the stripe light source to project a stripe pattern with a phase difference onto the target detection area, and simultaneously acquiring the corresponding reflection images by an image acquisition device to form a raw reflection image set for subsequent reflection information calculation. The raw reflection image set not only contains the reflection response of the target detection area under different phase shift states but also retains the subtle modulation information caused by minute surface undulations on the stripe reflection morphology, thus providing basic data for subsequent wrapping phase extraction and stripe modulation calculation.
[0026] It should be understood that, compared to traditional techniques that directly use single-frame surface light source images, point light source images, or ordinary grayscale images for defect analysis, this step introduces a phase-shifted fringe acquisition and construction method. This transforms the specular reflection changes on the surface of the target detection area into an image sequence with phase constraints. This allows for the preservation of effective structural information corresponding to minute surface undulations even when strong reflections, local highlights, and surface variations coexist on dark, high-gloss painted surfaces. Traditional methods often only obtain overexposed bright spots or reflective bands in highly reflective areas, making it difficult to distinguish between normal curvature changes and abnormal reflection disturbances caused by surface undulations. This step, however, uses multiple phase-shifted images to jointly constrain the reflection state of the target detection area, making subsequent calculations independent of the absolute brightness of a single frame, thus improving adaptability to complex reflection environments. For example, in the final inspection station of a car's high-gloss black door panel, if only a single frame image is acquired using a standard line light source, a continuous high-brightness reflection band will form near the door's waistline. Even if there are minor orange peel-like undulations within this reflection band, they are often masked by the overall brightness, making it difficult to form a stable defect response in a single frame image. However, by using the phase-shifted fringe acquisition method described in this step, four frames of reflection fringe images with different phase shift angles can be acquired continuously, such as corresponding to phase shift states of 0 degrees, 90 degrees, 180 degrees, and 270 degrees, respectively. In each frame image, the brightness and darkness positions of the stripes in the same area change regularly, and the local stripe distortion caused by minor surface undulations will form a consistent structural shift across multiple frames, thus enabling the construction of a set of original reflection images suitable for subsequent phase calculations. Therefore, even in areas with strong specular reflection, minor orange peel-like undulations can still be preserved through stripe phase changes, creating conditions for subsequent defect detection.
[0027] Step S20: Based on the original reflection image set, a normalized reflection solution mechanism is used to perform the reflection information extraction task and output the reflection feature map; It should be noted that the normalized reflectance calculation mechanism refers to the process of performing uniform dark field correction, gain normalization, quantile compression normalization, saturation pixel masking, and joint extraction of fringe phase and fringe modulation on the original reflectance image set, considering potential brightness bias, gain differences, local saturation, and uneven reflectance intensity within the target detection area, across different frames of the original reflectance image set. This process generates a reflectance feature map that can be used for subsequent surface morphology analysis. The reflectance feature map is the feature representation result formed after structurally calculating the reflectance information of the original reflectance image set. It includes wrapper phase information, fringe modulation information, and effective reflectance area information, and can be combined and mapped to form a unified feature representation carrier. The reflectance feature map is not a simple image enhancement result, but rather an intermediate representation result obtained after normalizing the surface reflectance response of the target detection area and fusing multi-source information.
[0028] Understandably, the purpose of this step is to transform the multiple frames of original reflective stripe images acquired in step S10 into reflective feature maps that directly reflect the changes in the local reflective state of the surface. This allows subsequent processing to no longer rely on grayscale values in the original image that are heavily influenced by exposure, ambient brightness, and local highlights. Instead, it relies on more stable phase information, modulation information, and effective area information to describe the surface state of the target detection area. Therefore, this step effectively transforms "raw brightness data" into "structured reflective information," preserving the effective responses within the target detection area that are truly related to the surface's micro-undulations, while suppressing invalid responses related to brightness drift, acquisition bias, and saturation interference.
[0029] Step S30: Based on the reflection feature map, a phase gradient separation mechanism is used to perform a preprocessing task and output a micro slope map; It should be noted that the phase gradient separation mechanism refers to extracting the enveloping phase information and effective reflection area information from the reflection feature map, calculating the spatial gradient of the enveloping phase and converting it into a reflection slope characterization quantity, and then performing macroscopic and microscopic component separation processing on the reflection slope characterization quantity to obtain a microscopic slope map used to characterize the local minute undulations of the painted surface. The microscopic slope map refers to the imaged result that retains only the slope components corresponding to local minute undulations after eliminating the influence of overall curvature changes, slow reflection changes, and low-frequency morphology in the target detection area. The microscopic slope map includes the pixel-level distribution of microscopic slope values and the corresponding intensity changes of local minute undulations.
[0030] It should be understood that, compared to traditional techniques that directly calculate the gradient of image grayscale values, perform high-pass filtering on enhanced images, or use fixed templates to extract texture edges, this step does not directly calculate the gradient on a normal brightness map. Instead, it first constructs a reflection slope representation based on the phase information in the reflection feature map, and then uses macroscopic component separation processing to remove the influence caused by the overall curvature and low-frequency fluctuations of the workpiece. In traditional techniques, for dark, bright curved surfaces, normal curvature changes often appear as a large range of brightness variations in the image. If gradient analysis is performed directly, normal curvature transitions are easily mistaken for abnormal textures. However, this step separates the overall shape changes from microscopic fluctuations through a phase gradient separation mechanism, thus making the resulting microscopic slope map more accurately reflect the local fluctuation state corresponding to orange peel.
[0031] For example, in the detection of a dark blue, high-gloss engine hood, the reflection changes in the gently sloping central area differ significantly from those in the curved edge area. If a high-pass filter is directly applied to the reflection feature map or brightness map, the curved edge area will typically produce a strong response, even exceeding the response intensity of the true orange peel area, leading to misjudgment. Using this step, the phase gradient can be calculated first based on the wrapping phase information and then converted into a reflection slope characterization quantity. Subsequently, the low-frequency changes corresponding to the workpiece edge curvature are extracted through macroscopic component separation and subtracted from the total slope, retaining only the microscopic slope components corresponding to local minor undulations. In the final microscopic slope map, the response of the curved edge area is significantly weakened, while the orange peel area with dense minor undulations in the central area forms a continuous high-response microscopic slope region, thereby improving the targeting and accuracy of subsequent orange peel quantification.
[0032] Step S40: Based on the micro slope map, perform orange peel quantization using a physical wavelength band quantization mechanism to output an orange peel quantization map; It should be noted that the physical wavelength band quantization mechanism refers to converting the micro slope map obtained in step S30 from a pixel-scale representation to a physical-scale representation, performing multi-band decomposition of the micro slope map according to a preset physical wavelength range, extracting local robust statistics within each band, and then constructing pixel-level orange peel quantization values by combining them with reference sample statistics. Finally, the orange peel quantization values corresponding to each pixel are mapped to form an orange peel quantization map. The orange peel quantization map is a quantized distribution map used to characterize the intensity of orange peel undulations at each pixel location within the target detection area. It not only reflects the presence of orange peel undulations but also the relative intensity and spatial distribution of orange peel undulations in different areas. The physical wavelength range includes, but is not limited to, sub-millimeter wavelength ranges, millimeter wavelength ranges, and multi-millimeter wavelength ranges, used to describe surface undulation features at different scales.
[0033] Understandably, by mapping the microscopic slope map to the actual physical wavelength range and extracting local statistical information at multiple physical scales, the orange peel texture of the painted surface is no longer characterized solely by the texture intensity at a single scale, but rather by the combined undulation responses at multiple actual physical scales. Therefore, this step can simultaneously consider the influence of fine ripples and larger, gradually varying undulations on the degree of orange peel, resulting in an output orange peel quantization map that is both locally sensitive and globally consistent. Especially for images acquired under different detection devices, imaging distances, and resolutions, this step, by using a physical wavelength banding approach rather than a fixed pixel window approach for analysis, makes it easier to maintain consistent quantization results.
[0034] It should be understood that, compared to traditional techniques that only use fixed pixel windows to calculate local variance, local energy, or single-band texture response, this step establishes a correspondence between the detection scale and the actual surface undulation scale through a physical wavelength band quantization mechanism. This overcomes the problem of incomparable detection results when the imaging resolution changes, a traditional method. In traditional methods, if the image resolution changes, the same size surface orange peel undulations may correspond to different numbers of pixels, leading to large fluctuations in the fixed pixel window analysis results. This step, however, converts the pixel scale to the actual physical scale using the object-side imaging ratio parameter, and then performs multi-band analysis within the same physical wavelength range, ensuring that orange peel undulations under different acquisition conditions can be mapped to a unified quantization framework. Furthermore, this step uses local median energy and reference sample statistics for quantization construction, which, compared to traditional methods using mean or single-point peak values, better suppresses the interference of local abnormal noise and occasional bright spots on orange peel scoring.
[0035] For example, on the same production line, if a black high-gloss door is inspected using a 5-megapixel camera, while a dark gray high-gloss tailgate is inspected using an 8-megapixel camera, there is a difference in pixel resolution. If a fixed pixel window is used for orange peel texture analysis, the window coverage of the same actual-size orange peel undulations will differ under the two devices, easily leading to inconsistent quantization results for similar workpieces. This step involves first converting the microscopic slope map to the actual physical wavelength scale according to the object-side imaging ratio parameters of each device, then extracting the response of each frequency band within a preset unified wavelength range, and combining this with the statistics of a reference qualified sample to construct the orange peel quantization value. Thus, even if the resolutions of the two devices differ, the quantization results corresponding to the same actual undulation scale remain consistent. For areas with obvious orange peel anomalies, the local energy in multiple physical wavelength bands will simultaneously increase, thus appearing as a continuous high-response area in the orange peel quantization map, facilitating subsequent defect judgment.
[0036] Step S50: Perform adaptive threshold determination and defect region extraction based on the orange peel quantization map, and output the orange peel defect detection result.
[0037] It should be noted that the orange peel defect detection result refers to the final detection output result obtained based on the orange peel quantization map, including but not limited to defect point coordinates, defect area boundaries, area-level orange peel anomaly markers, workpiece-level orange peel score, pass or fail judgment result, and re-inspection prompt information; adaptive threshold judgment means that instead of using a fixed threshold to uniformly segment all pixels, it combines the local distribution characteristics, regional discrete characteristics, and quantization response differences within the target detection area of the orange peel quantization map to adaptively determine the judgment threshold for different areas; defect area extraction means performing connected component filtering, area constraint, boundary extraction, and abnormal area aggregation processing on areas exceeding the threshold to form defect areas with practical detection significance.
[0038] Understandably, by applying adaptive threshold determination and defect region extraction to the orange peel quantization map, the quantization response result obtained in step S40 is ultimately transformed into a detection result that can be directly used for production line judgment and quality output. The orange peel quantization map essentially characterizes the degree of fluctuation at various locations, while in practical applications, it is more necessary to clearly indicate which locations are defects, the size of the defects, whether they exceed allowable standards, and whether the entire workpiece needs rework or re-inspection. Therefore, this step completes the transformation from "quantitative characterization" to "engineering judgment result." By using an adaptive threshold instead of a fixed threshold, this step can take into account the differences in orange peel quantization responses of different workpieces, different regions, and different reflection states, improving the adaptability of the detection results.
[0039] It should be understood that, compared to traditional techniques that directly apply a single fixed threshold to the texture response map, gradient map, or grayscale variance map, this step does not simply rely on a uniform threshold to define all high-response pixels as anomalies. Instead, it performs adaptive judgment based on the statistical distribution and regional response characteristics of the orange peel quantization map itself, and then combines connected component filtering and area constraints for region extraction. This avoids the common problems in traditional methods where scattered noise points are misjudged as defects, or large areas of gradually changing regions are misjudged as anomalies. Traditional fixed threshold methods have poor stability under different workpiece colors and different lighting conditions, while this step, through region-level processing of the quantization map, makes the final output result more in line with actual quality inspection requirements.
[0040] Example 2: Furthermore, the present invention provides an image-based paint defect detection system that employs an image-based paint defect detection method from the above embodiments, thereby solving a technical problem related to image-based paint defect detection. The beneficial effects of the image-based paint defect detection system provided by the present invention are the same as those of the image-based paint defect detection method provided in the above embodiments, and other technical features of the image-based paint defect detection system are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0041] Example 3: This invention provides an image-based paint defect detection device. Please refer to... Figure 2An image-based paint defect detection device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform an image-based paint defect detection method as described in Embodiment 1 above. An image-based paint defect detection device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. An image-based paint defect detection device is merely an example and should not be construed as limiting the functionality or scope of the embodiments of this invention. An image-based paint defect detection device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. Random access memory 1004 also stores various programs and data required for the operation of an image-based paint defect detection device. Processing device 1001, read-only memory 1002, and random access memory 1004 are interconnected via bus 1005. I / O interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows an image-based paint defect detection device to communicate wirelessly or wiredly with other devices to exchange data. Although an image-based paint defect detection device with various systems is shown in the figures, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented or possessed alternatively.
[0042] Example 4: This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the image-based paint defect detection method described above. The computer program product provided by this invention can solve the technical problem of image-based paint defect detection. Compared with the prior art, the beneficial effects of the computer program product provided by this invention are the same as those of the image-based paint defect detection method provided in the above embodiments, and will not be repeated here.
[0043] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this invention.
[0044] It should be understood that the various parts disclosed in this invention can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.
[0045] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. An image-based method for detecting paint defects, characterized in that, The methods include: Step S10: Obtain a multi-frame reflection stripe image sequence of the target detection area of the workpiece to be inspected, and perform the original reflection image construction task based on the multi-frame reflection stripe image sequence using the phase-shifting stripe acquisition construction method, and output the original reflection image set; Step S20: Based on the original reflection image set, a normalized reflection solution mechanism is used to perform the reflection information extraction task and output the reflection feature map; Step S30: Based on the reflection feature map, a phase gradient separation mechanism is used to perform a preprocessing task and output a micro slope map; Step S40: Based on the micro slope map, perform orange peel quantization using a physical wavelength band quantization mechanism to output an orange peel quantization map; Step S50: Perform adaptive threshold determination and defect region extraction based on the orange peel quantization map, and output the orange peel defect detection result.
2. The image-based method for detecting paint defects as described in claim 1, characterized in that, Step S10, which involves acquiring a multi-frame reflective fringe image sequence of the target detection area of the workpiece to be inspected, and performing an original reflective image construction task based on the multi-frame reflective fringe image sequence using a phase-shifting fringe acquisition method, and outputting the original reflective image set, specifically includes: Step S101: Obtain the target detection area on the surface of the workpiece to be inspected, control the preset stripe light source component to project a periodically changing phase-shifted stripe pattern onto the target detection area, and simultaneously acquire the corresponding multi-frame reflection images by the industrial camera to obtain a multi-frame reflection stripe image sequence. Step S102: Record exposure time based on multi-frame reflectance stripe image sequence Light source power Camera gain And object imaging scale parameters And establish a set of collected parameters; Step S103: Preset saturation pixel ratio constraints. Based on the saturation pixel ratio constraints, adjust the exposure time and light source power together according to the multi-frame reflective stripe image sequence and the acquisition parameter set. Then, summarize the adjusted multi-frame reflective stripe image sequence to form the original reflective image set and output the original reflective image set.
3. The image-based method for detecting paint defects as described in claim 2, characterized in that, In step S10, the first frame of the multi-frame reflective stripe image sequence Frame stripe pattern satisfy: ; in, Let the coordinates be those of the light source plane. Let x be the x-coordinate of the light source plane. The vertical coordinate of the light source plane; For the fringe spatial frequency, For phase shift, Cosine function.
4. The image-based paint defect detection method as described in claim 1, characterized in that, Step S20, which involves performing a reflection information extraction task based on the original reflection image set using a normalized reflection solution mechanism and outputting a reflection feature map, specifically includes: Step S201: Perform dark field correction and gain normalization on the original reflectance image set to obtain the corrected image sequence. , ,in, Let be the pixel value of the k-th frame at pixel coordinate u after dark field correction and gain normalization. Let be the pixel grayscale value of the k-th frame of the original reflected image at pixel coordinate u. As a dark field reference image, For gain-corrected images, Stable terms to prevent numerical anomalies caused by a denominator of zero or a normalization interval that is too small; Step S202: Perform saturation pixel masking and quantile normalization based on the corrected image sequence to obtain a normalized reflectance image sequence. ; Step S203: Extract the wrap-around phase map based on the normalized reflectance image sequence Striped mode diagram and effective reflection area mask and wrap the phase map Striped mode diagram and effective reflection area mask Perform combined mapping to form a reflection feature map.
5. The image-based method for detecting paint defects as described in claim 4, characterized in that, In step S20, ; ; in, The pixel grayscale values in the normalized reflectance image sequence. This is the saturation threshold; This is an indicator function that takes the value 1 when the condition within the parentheses is true, and 0 otherwise. The saturation pixel mask value at pixel coordinate u is used to characterize whether the corresponding pixel is a saturated pixel; The fifth percentile value of the pixel grayscale distribution in the target detection region of the k-th frame corrected image; This is the 95th percentile value of the pixel grayscale distribution in the target detection region of the k-th frame corrected image.
6. The image-based method for detecting paint defects as described in claim 1, characterized in that, Step S30, which involves performing a preprocessing task based on the reflection feature map using a phase gradient separation mechanism to output a micro slope map, specifically includes: Step S301: Extract the wrapping phase and effective reflection region from the reflection feature map, and calculate the spatial gradient of the wrapping phase within the effective reflection region to obtain the phase gradient field at pixel coordinate u. And based on the object-side imaging scale parameters, the phase gradient field Converted to reflection slope field ; Step S302: Based on the reflection slope field Constructing a macroscopic slope field and micro slope field ,in: ; ; in, It is a Gaussian filter kernel; The Gaussian kernel standard deviation parameter corresponding to the macroscopic separation scale is used to control the reflection slope field. The spatial range of effect during smoothing processing; Step S303: Based on the micro slope field A curvature compensation mapping method is used to construct and output a micro slope map.
7. The image-based method for detecting paint defects as described in claim 1, characterized in that, Step S40, which involves performing orange peel quantization based on the microscopic slope map using a physical wavelength band quantization mechanism and outputting the orange peel quantized map, specifically includes: Step S401: Map the microscopic slope map to the physical wavelength range according to the object-side imaging scale parameters, and perform multi-band decomposition on the physical wavelength range to obtain the frequency band response map corresponding to each frequency band; wherein, the first Each frequency band corresponds to a wavelength range of The corresponding frequency range is: ; This is the minimum physical wavelength value corresponding to the b-th frequency band, used to define the shortest fluctuation scale covered by this frequency band; The maximum physical wavelength value corresponding to the b-th frequency band is used to limit the longest fluctuation scale covered by this frequency band; This represents the minimum spatial frequency value corresponding to the b-th frequency band. This represents the maximum spatial frequency value corresponding to the b-th frequency band. Step S402: Perform local robust statistics based on the frequency band response map corresponding to each frequency band to obtain local statistics for each frequency band and statistics for the reference sample frequency band; wherein, the local statistics for each frequency band include the local median energy value, the local energy dispersion, and the pixel-level energy deviation; the statistics for the reference sample frequency band include the reference median energy value and the reference energy dispersion; Step S403: Construct pixel-level orange peel quantization values based on local statistics of each frequency band and statistics of the reference sample frequency band, map all pixel-level orange peel quantization values to form an orange peel quantization map, and output the orange peel quantization map.
8. An image-based paint defect detection system, applied to the image-based paint defect detection method according to any one of claims 1 to 7, characterized in that, The image-based paint defect detection system includes: The image acquisition module is used to acquire a multi-frame reflective stripe image sequence of the target detection area of the workpiece to be inspected, and to perform the original reflective image construction task based on the multi-frame reflective stripe image sequence using a phase-shifting stripe acquisition construction method, and output the original reflective image set. The reflection resolution module is used to perform reflection information extraction tasks based on the original reflection image set using a normalized reflection resolution mechanism, and output a reflection feature map. The preprocessing module is used to perform preprocessing tasks based on the reflection feature map using a phase gradient separation mechanism, and output a micro slope map. The quantization analysis module is used to perform orange peel quantization tasks based on the micro slope map using a physical wavelength band quantization mechanism, and output an orange peel quantization map. The result output module is used to perform adaptive threshold determination and defect region extraction based on the orange peel quantization map, and output the orange peel defect detection result.
9. An image-based paint defect detection device, characterized in that, The image-based paint defect detection device includes: a memory, a processor, and an image-based paint defect detection program stored in the memory and executable on the processor. When the image-based paint defect detection program is executed by the processor, it implements an image-based paint defect detection method according to any one of claims 1 to 7.
10. A computer program product, characterized in that, The computer program product includes an image-based paint defect detection program, which, when executed by a processor, implements an image-based paint defect detection method according to any one of claims 1 to 7.
