Visual inspection system for metal stand board frame machining

By constructing a virtual optical simulation environment and a dual-difference extraction module, combined with a feature consistency decision module, the problem of accurate identification of microstructural defects on metal curved surfaces was solved, and the effective differentiation of specular walk-through pseudo-defects and the stability improvement of the detection system were achieved.

CN121933443APending Publication Date: 2026-04-28ANHUI XINMAI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI XINMAI TECH CO LTD
Filing Date
2026-03-10
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately identify microstructural defects on curved metal surfaces and effectively distinguish between genuine structural damage and pseudo-defects while eliminating interference from ambient light and material texture, resulting in insufficient robustness of the detection system.

Method used

By constructing a virtual optical simulation environment, generating an ideal illumination response map and injecting virtual defect features, using a dual difference extraction module to calculate light and shadow residual information, and combining the feature consistency judgment module to extract the similarity of light and shadow trajectories, accurate determination of specular walk defects on metal surfaces can be achieved.

Benefits of technology

It significantly reduces the interference from anisotropic textures and complex geometric structures of materials, improves the accuracy and robustness of detection, effectively distinguishes between real structural damage and pseudo-defects, and ensures the stability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121933443A_ABST
    Figure CN121933443A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of machine vision and precision industrial detection, in particular to a metal stand board frame processing visual detection system, which comprises a data acquisition module, a processing module, a processing module, a processing module and a processing module, and is characterized in that the data acquisition module is used for acquiring visual detection data of a target object and loading a standard three-dimensional design file and bidirectional reflection distribution function parameters of the target object; the light field reference reconstruction module is used for constructing a virtual optical simulation environment of a target object and generating a simulation illumination image with defects; the dual difference extraction module is used for resolving shadow residual information on the surface of the target object and generating a theoretical residual space; the feature consistency judgment module is used for carrying out authenticity judgment on suspected features in the real residual data and outputting a defect judgment result of the target object based on the trajectory similarity; the feedback optimization module is used for adaptively adjusting the detection parameters based on the defect judgment result and outputting a final quality evaluation signal; according to the invention, the technical problem of low signal-to-noise ratio in a high-reflection environment is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision and precision industrial inspection technology, specifically a visual inspection system for processing metal stand frames. Background Technology

[0002] With the advancement of precision manufacturing processes, the appearance quality requirements for products such as metal sign frames are becoming increasingly stringent; the surfaces of such workpieces typically have high reflectivity, anisotropic textures, and complex curved surface structures.

[0003] Currently, surface defect detection for highly reflective curved workpieces often employs traditional machine vision solutions based on grayscale thresholds or single viewing angles. However, due to the specular walk effect on metal surfaces and interference from processing textures, normal textures easily form bright noise points resembling defects in imaging. Existing technologies struggle to effectively distinguish between genuine structural damage and pseudo-defects, such as oil stains, stray ambient light, or normal texture reflections. When faced with changes in illumination angle, traditional methods easily misjudge specular reflections that vary with viewing angle as defects, or miss minute microstructural damage, resulting in insufficient robustness of the detection system.

[0004] Therefore, how to accurately identify microstructural defects on metal surfaces and effectively eliminate pseudo-defect noise caused by specular walk, while eliminating interference from ambient light and material texture, has become an urgent problem to be solved in this field. Summary of the Invention

[0005] The purpose of this invention is to provide an intelligent voice interaction system based on a large-scale cultural tourism model, which solves the following technical problems:

[0006] It avoids environmental and material interference caused by high reflectivity of metal surfaces, anisotropic textures, and curved surface structures, and can effectively distinguish between normal processing textures and structural damage, solving the problem of false defect false alarms caused by high-gloss wandering on curved surfaces.

[0007] The objective of this invention can be achieved through the following technical solutions:

[0008] The data acquisition module is used to acquire visual inspection data of the target object, collect multi-angle photometric stereo images under different light source angles, and load the standard three-dimensional design file and bidirectional reflectance distribution function parameters of the target object.

[0009] The light field reference reconstruction module is used to construct a virtual optical simulation environment for the target object. Based on the standard 3D design file and bidirectional reflection distribution function parameters, it uses ray tracing algorithm to render an ideal illumination response map in a flawless state. Based on the preset defect optical model library, it injects parameterized virtual defect features into the ideal illumination response map to generate a simulated illumination map with defects.

[0010] The dual difference extraction module is used to solve the light and shadow residual information on the surface of the target object, calculate the difference between the multi-angle photometric stereo image group and the ideal lighting response map, generate the real residual data, and at the same time calculate the difference between the simulated lighting map and the ideal lighting response map to generate the theoretical residual space.

[0011] The feature consistency judgment module is used to determine the authenticity of suspected features in real residual data, extract the actual movement trajectory of feature regions in real residual data as the light source angle changes, extract the theoretical movement trajectory of feature templates in theoretical residual space as the light source angle changes, calculate the trajectory similarity between the actual movement trajectory and the theoretical movement trajectory, and output the defect judgment result of the target object based on the trajectory similarity.

[0012] The feedback optimization module is used to adaptively adjust the detection parameters based on the defect determination results and output the final quality assessment signal.

[0013] As a further aspect of the present invention: the data acquisition module includes:

[0014] The sequence acquisition unit is used to control the synchronous triggering of the camera and the light source, acquire grayscale sequence images of the target object under a preset set of different lighting directions, and use the grayscale sequence images as a multi-angle photometric stereo image group.

[0015] The prior loading unit is used to parse standard 3D design files, extract the geometric dimensions, chamfer radius and theoretical surface roughness data of the target object, and map the extracted data into the imaging coordinate system of the camera to establish a virtual observation viewpoint.

[0016] As a further aspect of the present invention: the light field reference reconstruction module includes:

[0017] The ideal rendering unit is used to generate an ideal lighting response map. Based on the intrinsic data of the actual camera and the spatial position of the light source, combined with the bidirectional reflection distribution function parameters, it simulates the reflection path of light on the geometric surface defined in the standard 3D design file and calculates the theoretical pixel brightness distribution of the target object under the current observation view.

[0018] The defect parameter injection unit is used to generate a simulated lighting map, call the micro-geometric structure parameters in the defect optical model library, model the scratch as a micro-groove with anisotropic scattering characteristics, model the burr as a protruding geometry with edge diffraction characteristics, and superimpose the micro-geometric structure parameters into the surface properties of the standard 3D design file.

[0019] As a further aspect of the present invention: the dual difference extraction module includes:

[0020] The reality extraction unit is used to eliminate background texture and structural highlights. It subtracts the pixel brightness value of the corresponding coordinate in the ideal illumination response map from the pixel gray value in the multi-angle photometric stereo image group to obtain the reality residual data containing potential defect signals and environmental noise.

[0021] The theoretical extraction unit is used to obtain the pure defect light and shadow morphology. It subtracts the pixel brightness value of the corresponding coordinate in the ideal light response map from the pixel brightness value in the simulated lighting map to obtain the theoretical residual space containing only the optical response characteristics of the defects.

[0022] As a further aspect of the present invention: the feature consistency decision module includes:

[0023] The feature mapping unit is used to extract local gradient direction features, and to calculate the local gradient direction histogram of the highlighted area in the real residual data, and the local gradient direction histogram of the corresponding type of defect in the theoretical residual space.

[0024] The trend comparison unit is used to calculate the consistency of feature evolution under changes in illumination angle, track the pixel coordinate displacement of bright spots in real residual data as the light source angle changes, form the actual movement trajectory, and perform optical flow field matching with the theoretical movement trajectory pre-simulated in the theoretical residual space to generate trajectory similarity.

[0025] As a further aspect of the present invention: the feature consistency decision module further includes:

[0026] The logic decision unit is used to perform conditional logic judgments, set similarity thresholds and static thresholds, and is configured as follows: if the trajectory similarity is greater than the similarity threshold, the feature in the real residual data is determined to be a physical defect; if the trajectory similarity is less than or equal to the similarity threshold, and the change in pixel coordinate position of the feature in the real residual data in the multi-angle photometric stereo image group is less than the static threshold, the feature in the real residual data is determined to be a pseudo-defect noise and is removed.

[0027] As a further aspect of the present invention: the defect optical model library includes:

[0028] The scratch model unit is used to define the optical anisotropy of scratches, set the scratch depth, width and direction vector, and specify the illumination reflection rules when light is perpendicular to the scratch direction and produces a bright response, and when light is parallel to the scratch direction and produces a dark response.

[0029] The point defect model unit is used to define the light and shadow reversal features of pits and bumps, and to set the relative position rules of the shadow and highlight positions of the defect area when the lighting angle changes.

[0030] As a further aspect of the present invention: the feedback optimization module includes:

[0031] The parameter correction unit is used to adjust the rendering accuracy based on historical misjudgment data. When continuous false defect false alarms are detected, the specular reflection coefficient in the bidirectional reflection distribution function parameters is corrected and the generation benchmark of the ideal lighting response map is updated.

[0032] The sorting control unit is used to generate corresponding industrial control instructions in response to the defect determination results, marking target objects that are determined to have physical defects as defective products, and marking target objects that are determined to be without defects or only contain false defect noise as good products.

[0033] The beneficial effects of this invention are:

[0034] 1. This invention constructs a virtual optical simulation environment and generates an ideal illumination response map, and performs a double difference operation between the actual acquired multi-angle images and the ideal reference. This mechanism effectively filters out common-mode specular signals caused by background textures and curved surface structures on metal surfaces, retaining only potential defect signals. It significantly reduces the interference of anisotropic textures and complex geometric structures on detection and solves the technical problem of low signal-to-noise ratio under high reflectivity.

[0035] 2. This invention utilizes a feature consistency decision module to extract the actual movement trajectory of the feature region as the light source angle changes, and performs optical flow field matching with the pre-simulated trajectory in the theoretical residual space. This decision method, based on dynamic light and shadow evolution behavior rather than a single gray value, can accurately distinguish between real structural damage that conforms to physical laws and random walk interference highlights, thereby effectively avoiding false defect false alarms in metal surface detection and improving detection accuracy.

[0036] 3. This invention introduces a logic decision unit, which combines trajectory similarity and position change as dual indicators for comprehensive judgment; for static surface stains or ink noise that are not sensitive to the angle of illumination, the system can distinguish them from physical defects with specific light and shadow dynamics and eliminate them; this dual threshold mechanism gives the system extremely high specificity and ensures robustness of detection in the presence of non-structural pollution interference in industrial sites.

[0037] 4. This invention has a feedback optimization function, which can adaptively adjust the rendering accuracy and bidirectional reflection distribution function parameters based on historical misjudgment data. When continuous false defect false alarms are detected, the system automatically corrects the reflection coefficient in the optical model and dynamically updates the generation benchmark of the ideal illumination response map. This realizes closed-loop control of detection parameters, ensures continuous alignment between the digital twin model and the physical environment, and maintains the stability of the system's long-term operation. Attached Figure Description

[0038] The invention will now be further described with reference to the accompanying drawings.

[0039] Figure 1This is a schematic diagram of the visual inspection system for processing metal stand frames according to the present invention. Detailed Implementation

[0040] 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.

[0041] Please see Figure 1 As shown, a visual inspection system for processing metal stand frames includes: a data acquisition module, used to acquire visual inspection data of the target object, acquire multi-angle photometric stereo images under different light source angles, and load the standard three-dimensional design file and bidirectional reflectance distribution function parameters of the target object;

[0042] The light field reference reconstruction module is used to construct a virtual optical simulation environment for the target object. Based on the standard 3D design file and bidirectional reflection distribution function parameters, it uses ray tracing algorithm to render an ideal illumination response map in a flawless state. Based on the preset defect optical model library, it injects parameterized virtual defect features into the ideal illumination response map to generate a simulated illumination map with defects.

[0043] The dual difference extraction module is used to solve the light and shadow residual information on the surface of the target object, calculate the difference between the multi-angle photometric stereo image group and the ideal lighting response map, generate the real residual data, and at the same time calculate the difference between the simulated lighting map and the ideal lighting response map to generate the theoretical residual space.

[0044] The feature consistency judgment module is used to determine the authenticity of suspected features in real residual data, extract the actual movement trajectory of feature regions in real residual data as the light source angle changes, extract the theoretical movement trajectory of feature templates in theoretical residual space as the light source angle changes, calculate the trajectory similarity between the actual movement trajectory and the theoretical movement trajectory, and output the defect judgment result of the target object based on the trajectory similarity.

[0045] The feedback optimization module is used to adaptively adjust the detection parameters based on the defect determination results and output the final quality assessment signal.

[0046] This embodiment details the overall architecture and operating mechanism of the visual inspection system for metal standee frame processing. The system addresses the issues of high reflectivity of metal surfaces, anisotropic textures, and specular walk caused by curved surface structures. It adopts a synthetic analysis approach to eliminate environmental and material interference by constructing a digital twin light field.

[0047] The system initiates the data acquisition process, controls the multi-angle light source array and industrial camera to work synchronously to obtain real observation data of the physical world, namely a multi-angle photometric stereo image group, and simultaneously retrieves CAD models and BRDF parameters characterizing the microscopic reflective properties of materials from the enterprise database.

[0048] The system enters the light field reference reconstruction stage, using ray tracing technology to reproduce the real physical lighting conditions in the virtual environment, establishing a perfect reference system for comparison, namely the ideal lighting response map, and a defect hypothesis system, namely the simulated lighting map, which injects virtual defect features through mathematical modeling.

[0049] The dual-difference extraction module processes real and simulated data in parallel to separate background noise and defect signals. Based on this, the feature consistency judgment module does not directly compare gray values, but identifies true and false defects by comparing the evolution of light and shadow. The feedback optimization module dynamically adjusts parameters according to the judgment results and outputs the final quality assessment signal to complete closed-loop control.

[0050] This embodiment effectively distinguishes between normal processing textures and structural damage on metal surfaces by introducing light field reference reconstruction and a dual difference mechanism. Normal processing textures are rendered in the ideal illumination response map and canceled out in the difference, while abnormal structures are preserved. By using trajectory similarity judgment, the problem of false defect false alarms is solved in the scenario where the highlight points on the metal surface are disturbed by changes in the viewing angle, and the robustness of detection is significantly improved.

[0051] In a preferred embodiment of the present invention, the data acquisition module includes: a sequence acquisition unit, used to control the synchronous triggering of the camera and the light source, acquire grayscale sequence images of the target object under a preset set of different lighting directions, and use the grayscale sequence images as a multi-angle photometric stereo image group; and a priori loading unit, used to parse the standard three-dimensional design file, extract the geometric dimensions, chamfer radius and theoretical surface roughness data of the target object, and map the extracted data to the imaging coordinate system of the camera to establish a virtual observation perspective.

[0052] This embodiment further defines the specific structure and execution logic of the data acquisition module; the sequence acquisition unit is connected to a hemispherical light source array, on which are distributed... Each unit has an independently controllable LED light source, and the camera shutter and LED light source are time-division multiplexed to trigger the capture of high-dimensional data with photometric three-dimensional information.

[0053] set up The light source is numbered, and this unit acquires a set of grayscale sequence images. Includes Single-frame grayscale images under different lighting directions; prior loading of standard 3D design files to extract geometric mesh data, and use camera extrinsic matrix obtained by hand-eye calibration. and intrinsic parameter matrix This establishes a precise mapping from physical space to image space. To conform to the principles of perspective projection in computer vision and ensure code reproducibility, a homogeneous coordinate system is used for calculations.

[0054] For any point on the surface of the CAD model In other words, homogeneous coordinates in the world coordinate system. During the system initialization phase, the CAD model coordinate system was aligned with the actual physical world coordinate system through rigid body transformation using the ICP algorithm; these coordinates were then transformed to point coordinates in the camera coordinate system. The calculation formula is as follows:

[0055]

[0056] in, Derived from coordinate transformation calculations, its physical meaning is the coordinates of a point in three-dimensional space in the camera coordinate system, with the unit being millimeters (mm); utilizing the intrinsic parameter matrix. Projecting the camera coordinates onto the normalized image plane yields homogeneous pixel coordinates. The calculation formula is as follows:

[0057]

[0058] in, Derived from projection calculations, its physical meaning is the normalized homogeneous coordinate vector on the image plane. In this step, It includes geometric correction based on radial and tangential distortion models to eliminate the impact of lens distortion on measurement accuracy; perspective division is performed to obtain the final two-dimensional pixel coordinates. The calculation formula is as follows:

[0059]

[0060] in, Derived from calculation results, its physical meaning is a two-dimensional coordinate vector in the pixel coordinate system, with the unit being pixels;

[0061] Derived from projection calculations, its physical meaning is the depth scaling factor of a point, used to restore homogeneous coordinates to Euclidean coordinates;

[0062] Derived from calibration parameters, the physical meaning is: Camera intrinsic parameter matrix;

[0063] Derived from calibration parameters, the physical meaning is: Rotation and translation matrices;

[0064] This embodiment corrects the dimension mismatch problem caused by direct matrix multiplication by introducing strict homogeneous coordinate transformation and perspective division steps, ensuring the mathematical rigor of the virtual observation perspective, thereby ensuring that the ideal illumination response map generated subsequently is aligned with the actual acquired image at the pixel level.

[0065] It should be clarified here that all spatial geometric dimensions involved in this embodiment are as follows: All measurements are in millimeters (mm) to ensure the dimensional accuracy of the physical simulation.

[0066] In a preferred embodiment of the present invention, the light field reference reconstruction module includes: an ideal rendering unit, used to generate an ideal lighting response map, which, based on the intrinsic data of the actual camera and the spatial position of the light source, and combined with the bidirectional reflection distribution function parameters, simulates the reflection path of light on the geometric surface defined in the standard 3D design file, and calculates the theoretical pixel brightness distribution of the target object under the current observation view.

[0067] The defect parameter injection unit is used to generate a simulated lighting map, call the micro-geometric structure parameters in the defect optical model library, model the scratch as a micro-groove with anisotropic scattering characteristics, model the burr as a protruding geometry with edge diffraction characteristics, and superimpose the micro-geometric structure parameters into the surface properties of the standard 3D design file.

[0068] This embodiment further defines the internal logic of the light field reference reconstruction module, which is the core algorithm engine of this invention; the ideal rendering unit adopts a BRDF rendering model based on microplanes, for each pixel in the image. According to its corresponding surface normal Based on material properties, calculate the theoretical pixel brightness distribution. The calculation formula is as follows:

[0069]

[0070] in, Derived from calculation results, its physical meaning is the emitted radiance in the direction of observation, i.e., the pixel grayscale value, and the unit is watts per steradian per square meter. ; Calculated radiance It needs to be converted to grayscale values ​​through camera response function mapping. The calculation formula is as follows:

[0071]

[0072] in, The photoelectric conversion coefficient of the camera, in units of This is used to map physical radiance to the grayscale space of an image sensor.

[0073] Originating from geometric calculations, its physical meaning is the line-of-sight vector, i.e., a dimensionless unit vector;

[0074] Derived from the light source configuration, its physical meaning is the first The incident direction vector of a light source, i.e., a dimensionless unit vector;

[0075] Derived from the light source parameters, the physical meaning is the first The intensity of a light source, measured in watts per square meter. ;

[0076] Derived from material properties, its physical meaning is a two-way reflection distribution function, which includes diffuse and specular reflection components, and its unit is the reciprocal of steradian. ;

[0077] Derived from CAD models, its physical meaning is the surface normal vector defined in standard 3D design files;

[0078] Derived from material properties, its physical meaning is surface roughness parameter;

[0079] Derived from system settings, its physical meaning is the total number of light sources involved in lighting calculations;

[0080] After verification of dimensional consistency, the dimensions of the product of the terms on the right side of the formula are: , with left-side radiance The dimensions are kept strictly consistent; specifically, to ensure the physical realism and reproducibility of the rendering results, the bidirectional reflection distribution function... The Cook-Torrance microsurface model is used, and its expression is:

[0081]

[0082] in, For a half-range vector, its calculation formula is: To ensure that those skilled in the art can accurately reproduce this, the specific mathematical form of each component function is defined here: Let GGX be the normal distribution function, and its expression is:

[0083]

[0084] For the Fresnel equations, using the Schlick approximation, the calculation formula is as follows:

[0085]

[0086] in, Based on basic reflectivity; The Smith-GGX geometric occlusion function is composed of the product of the occlusion factors in the view direction and the illumination direction, and its calculation formula is as follows:

[0087]

[0088] The formula for calculating the single-item occlusion factor is as follows:

[0089]

[0090] is the diffuse reflectance coefficient, used to characterize the non-metallic component of a material;

[0091] The defect parameter injection unit calls the defect optical model library. For scratch defects, it simulates them by perturbing the normal vector; let the original normal be... In order to accurately calculate the tangent vector perpendicular to the direction of the scratch This embodiment introduces tangent space mapping logic: obtaining the tangent of the current shading point on the CAD mesh. and secondary tangent ;

[0092] Specifically, tangent Defined as texture coordinates Axis-aligned unit vector, bitangent Through the normal line With tangent cross product The calculations yielded the results, thus constructing a local orthogonal tangent space;

[0093] in, Derived from preset scratch morphology parameters, these represent the scratches along the UV texture space. shaft and The directional component of the axis, and satisfying ;

[0094] The linear equation of the scratch in UV texture space has the following parameters: That is, the perpendicular tangent vector in world space corresponding to the normal vector direction. The calculation is as follows:

[0095]

[0096] in, It can accurately reflect the anisotropic direction of the surface geometry; in order to prevent sinusoidal perturbations from producing incorrect texture effects in the entire space, this embodiment introduces a Gaussian space envelope function. The formula for calculating the physical width of a scratch is as follows:

[0097]

[0098] Perturbation normal after injection The formula for generating it is as follows:

[0099]

[0100] in, The physical width of the scratch. The physical depth of the scratch is expressed in millimeters (mm), and the spatial frequency is... Amplitude coefficient ;variable The vertical distance from the pixel to the center line of the scratch, in millimeters (mm); this unit will calculate... Replace the original Substituting the above Calculation formulas are used to generate simulated lighting maps; by introducing... This ensures that defect features are only visible within the scratch width. It is effective within its scope, which is consistent with physical facts;

[0101] To address burr defects, this unit further employs a normal perturbation method based on the height field gradient, introducing a curvature control mechanism; the microscopic height field of the burr is defined. Let be a Gaussian spike function to ensure second-order differentiability; its calculation formula is as follows:

[0102]

[0103] in, The peak height of the burr. Here, represents the characteristic width parameter of the burr, with units in millimeters (mm). Based on this height field definition, the dynamically adjusted roughness parameter is calculated during rendering. The calculation formula is as follows:

[0104]

[0105] in, The original surface roughness, This is the roughness correction after superimposing the burr effect;

[0106] This is the diffraction enhancement coefficient. Let be the Laplace operator modulus of the height field;

[0107] To ensure the consistency of physical dimensions and the feasibility of the technical solution, this embodiment clearly defines: parameters The physical dimensions are The unit is millimeters (mm), designed to counteract the Laplace operator. The resulting dimensions, i.e. This ensures the dimensionless nature of the roughness increment term;

[0108] In practical engineering applications, The preferred numerical range mm, this numerical value physically characterizes the modulation gain scale of surface light scattering distribution caused by changes in microscopic curvature; it belongs to the empirical fitting coefficient, used to map microscopic geometric deformation to macroscopic optical scattering characteristics; to clarify the calculation process, its analytical solution is obtained by the second-order partial derivative of the above Gaussian function, the specific formula is:

[0109]

[0110] Through this mechanism, the roughness at the sharp edges of the burrs is significantly increased, simulating a diffraction-like visual effect. It should be noted that the simulated diffraction-like visual effect used in this embodiment is not based on the numerical solution of the wave equation, but on a phenomenological approximation based on the statistical principles of micro-surfaces.

[0111] By mapping the Laplacian operator values ​​representing edge abrupt changes to surface roughness The increment essentially widens the microplane normal distribution NDF in the region, which can accurately reproduce the light intensity diffusion and edge halo effect caused by physical diffraction in macroscopic vision, thus achieving an effective approximation of the diffraction visual features within the framework of the geometric optics model.

[0112] In a preferred embodiment of the present invention, the dual difference extraction module includes: a reality extraction unit, used to eliminate background texture and structural highlights, and to subtract the pixel brightness value of the corresponding coordinate in the ideal illumination response map from the pixel gray value in the multi-angle photometric stereo image group to obtain reality residual data containing potential defect signals and environmental noise;

[0113] The theoretical extraction unit is used to obtain the pure defect light and shadow morphology. It subtracts the pixel brightness value of the corresponding coordinate in the ideal light response map from the pixel brightness value in the simulated lighting map to obtain the theoretical residual space containing only the optical response characteristics of the defects.

[0114] This embodiment further defines the signal processing flow of the dual differential extraction module; the actual extraction unit performs differential operations to generate actual residual data. The calculation formula is as follows:

[0115]

[0116] in, Derived from the calculation results, its physical meaning is a residual image containing real defects and random noise;

[0117] Originating from the acquisition module, its physical meaning is the actual grayscale image acquired;

[0118] Originating from the reconstruction module, its physical meaning is the ideal illumination response diagram;

[0119] Derived from image coordinates, its physical meaning is pixel coordinate index;

[0120] Derived from the light source sequence, its physical meaning is the light source angle index;

[0121] Simultaneously, the theoretical extraction unit calculates the theoretical residual space. By calculating the absolute difference between the simulated lighting map and the ideal lighting response map, we obtained a result that only includes the brightness changes caused by the microstructure of defects, completely eliminating the influence of background texture and ambient light.

[0122] This embodiment constructs a common-mode suppression mechanism, in which background textures such as metal lattices and chamfered highlights are subtracted as common-mode signals, while defects are retained as differential-mode signals. The introduction of theoretical residual space provides a noise-free standard answer for subsequent feature matching, which greatly improves the signal-to-noise ratio in a highly interfering industrial environment.

[0123] In a preferred embodiment of the present invention, the feature consistency decision module includes: a feature mapping unit, used to extract local gradient direction features, and to calculate the local gradient direction histogram of the highlighted area in the real residual data and the local gradient direction histogram of the corresponding type of defect in the theoretical residual space respectively;

[0124] The trend comparison unit is used to calculate the consistency of feature evolution under changes in illumination angle, track the pixel coordinate displacement of bright spots in real residual data as the light source angle changes, form the actual movement trajectory, and perform optical flow field matching with the theoretical movement trajectory pre-simulated in the theoretical residual space to generate trajectory similarity.

[0125] This embodiment further defines the feature comparison method of the feature consistency decision module; the feature mapping unit converts light and shadow changes into quantifiable gradient features;

[0126] To accurately define the highlighted areas and eliminate the interference of background noise on histogram calculation, this unit uses real residual data. Perform binarization segmentation and set a brightness segmentation threshold. Specifically, it is defined as 20% of the global maximum grayscale value within the current real-world residual data frame. This proportion is the optimal segmentation point obtained based on the bimodal characteristic analysis of grayscale histograms from a large number of samples. This is to adapt to the dynamic range under different illumination intensities, and several independent feature region sets are extracted using a connected component analysis algorithm. ;

[0127] For each feature region, its local gradient direction histogram and the local gradient direction histogram of the corresponding type of defect in the theoretical residual space are calculated. Specifically, to address the uncertainty in gradient calculation, this embodiment specifies the use of... The Sobel operator calculates the horizontal gradient separately. with vertical gradient gradient direction The histogram statistical intervals (Bin) are set to 12, meaning each interval covers 30 degrees. Degree range; After completing the statistics, L2 norm normalization is performed on the histogram vector to eliminate the influence of light intensity differences on feature description;

[0128] To prevent spurious features with drastically different shapes, such as oil stains, from interfering with trajectory determination, this embodiment introduces a morphological consistency pre-screening mechanism before trend comparison: calculating the histogram of actual features. Histogram of theoretical features The Barthel coefficient between them is calculated using the following formula:

[0129]

[0130] in, Taking 12, we obtain the Bach distance. To transform the difference metric into normalized similarity weights, a Gaussian kernel function is used for mapping, and its calculation formula is as follows:

[0131]

[0132] in, The morphological sensitivity parameter has a value of 0.3. This parameter is an empirically optimized value obtained through statistical analysis of the overlap area of ​​the Bartholin's distance distribution between typical defective samples and non-defective samples. This weight... This will be used to suppress the scoring of atypical morphological regions in subsequent similarity calculations;

[0133] The trend comparison unit verifies the dynamic behavior of light and shadow and calculates the actual movement trajectory. Compared with the theoretical trajectory To address the problem in existing technologies that mistakenly treat macroscopic surface highlight movement as a defect feature, this embodiment clarifies that... It must be generated based on the microscopic visual response of defects rather than macroscopic geometric reflections;

[0134] Specifically, the theoretical residual space generated using the embodiments It already contains injected virtual defect features. The theoretical defect area is determined by threshold segmentation, with the threshold set at 5% of the theoretical maximum response value, or by directly mapping the non-zero region of the injected model. And perform grayscale centroid tracking within that region: for the first light source in the sequence... Frame, calculate the gray-level centroid coordinates of the corresponding defect region in the theoretical residual space. The calculation formula is as follows:

[0135]

[0136] It should be noted that the denominator term in the above formula includes a very small positive number. ,For example This is designed to prevent division by zero errors when the sum of gray levels in a feature region is zero, such as in a pure black background or an area with no illumination response, thus ensuring the numerical stability of the program; the theoretical optical flow vector is defined, and its calculation formula is:

[0137]

[0138] This calculation method can accurately capture the tiny visual center displacement caused by the light and shadow reversal of point defects or the anisotropic flicker of scratches. Its physical essence is the shadow-highlight phase shift generated by the microstructure.

[0139] Similarly, for real-world residual data Calculate the actual centroid of the suspected feature region in the data. and actual optical flow vector The same application Prevent division by zero;

[0140] Based on this, the weighted trajectory similarity is calculated. This embodiment specifies the weights. For the first Average spatial gradient magnitude and morphological weight of feature regions in a frame The product of the two is calculated using the following formula:

[0141]

[0142] in, Derived from image statistics, its physical meaning is feature region. The total number of pixels contained within is used for normalization calculations; based on this weight, the weighted trajectory similarity is calculated. The calculation formula is as follows:

[0143]

[0144] in, Derived from the calculation results, its physical meaning is the weighted trajectory similarity score;

[0145] Derived from centroid difference calculations, these represent the light and shadow movement vectors in reality and theory, respectively.

[0146] It originates from a preset constant, and its physical meaning is to prevent tiny values ​​where the denominator is zero;

[0147] Derived from preset parameters, its physical meaning is the amplitude matching sensitivity coefficient, and its unit is set to [unit missing]. Or, if the displacement is converted to physical distance, the unit is... To simplify the calculation, pixel-domain metrics are used here to offset the difference in motion magnitude. The pixel dimension ensures that the input parameters of the exponential function are dimensionless values, which are used to exponentially penalize inconsistent movement amplitudes.

[0148] This embodiment introduces a centroid tracking algorithm based on residual space and a similarity metric that includes amplitude constraints, ensuring that the theoretical trajectory strictly corresponds to the optical behavior of the defect itself rather than the geometric reflection of the workpiece surface. This allows for a logical and effective distinction between real defects that are stationary or slightly moving and structural specular noise that travels significantly across curved surfaces.

[0149] In a preferred embodiment of the present invention, the feature consistency judgment module further includes: a logic adjudication unit, used to perform conditional logic judgment, set a similarity threshold and a static threshold, configured to: if the trajectory similarity is greater than the similarity threshold, then determine that the feature in the real residual data is a physical defect;

[0150] If the trajectory similarity is less than or equal to the similarity threshold, and the change in pixel coordinate position of the feature in the real residual data in the multi-angle photometric stereo image group is less than the static threshold, then the feature in the real residual data is determined to be a false defect noise and is removed.

[0151] This embodiment further defines the decision logic of the feature consistency judgment module; the logic adjudication unit presets a similarity threshold. This threshold is based on ROC curve analysis using a pre-set calibration dataset. The value corresponding to the point with the maximum F1 score is selected to determine whether the lighting behavior conforms to the physical model, as well as the static threshold. This threshold is calculated based on the magnification and pixel size of the optical system, corresponding to a specular displacement of 0.05 mm in physical space. It is used to distinguish between microstructural reflections and macroscopic surface wandering specular highlights. This is determined by system calibration parameters. Convert [mm / pixel] to a threshold value. Pixel; used to determine whether a feature has undergone physical displacement in an image sequence;

[0152] To quantify the change in pixel coordinate position, this embodiment defines a displacement index. The Euclidean distance between the geometric center of the feature region and the first and last frames of the image sequence is calculated using the following formula:

[0153]

[0154] in, and The feature regions are respectively in the 1st frame and the 2nd frame. The centroid coordinates of the frame; the system executes the following complete logical judgment process: if the trajectory similarity... This indicates that the changes in light and shadow in real-world features are highly consistent with the simulation defects, and the system determines that these are physical defects.

[0155] like Then further determine the displacement index :like This indicates that although the feature has differences, it is not sensitive to the angle of illumination and is stationary. The system judges it as a false defect noise, such as ink or surface stains, and removes it.

[0156] like This indicates that the feature has significant movement but does not conform to the optical laws of defects, such as non-steady-state water stain flow or environmental stray light interference. The system classifies it as non-structural interference, and also marks it as a non-defect signal and removes it. The logic design of this embodiment can not only detect defects, but also show extremely high specificity when facing non-structural interference such as oil stains and dust through a dual threshold judgment mechanism, which greatly reduces the overkill rate.

[0157] In a preferred embodiment of the present invention, the defect optical model library includes: a scratch model unit, used to define the optical anisotropy of scratches, set the scratch depth, width and direction vector, and specify the illumination reflection rules that produce a bright response when light is perpendicular to the scratch direction and a dark response when light is parallel to the scratch direction; and a point defect model unit, used to define the light and shadow reversal characteristics of pits and protrusions, and set the relative position rules that the shadow and highlight positions of the defect area are interchanged when the illumination angle is switched.

[0158] This embodiment further defines the specific content of the defect optical model library; the scratch model unit defines scratches as having optical anisotropy, specifically the rule that when the projection direction of the light source is perpendicular to the scratch direction vector, the reflection intensity... Reaching the peak value, when parallel, Approaching the background brightness; its reflection intensity is mathematically expressed as:

[0159]

[0160] in, The value is 1.0, which represents the maximum normalized reflection intensity of the defect at the optimal observation angle in this embodiment.

[0161] Derived from calculation results, its physical meaning is reflection intensity, which is a normalized dimensionless value;

[0162] Derived from light source parameters, its physical meaning is the azimuth angle of the light source, and the unit is radians (rad).

[0163] Derived from defect parameters, its physical meaning is the azimuth angle of the scratch direction, and the unit is radians (rad).

[0164] The point defect model element defines the light and shadow reversal characteristics of pits and protrusions. For pits, when the light source is from the left, the left side is in shadow and the right side is in highlight; when the light source switches to the right, the light and dark positions are reversed. For protrusions such as burrs, their light and dark distribution is strictly opposite to that of pits. To make this rule enforceable in simulation rendering, this element defines the microscopic geometric height field of the pit. For a negative Gaussian surface, its mathematical expression is:

[0165]

[0166] in, The depth of the pit. Let be the radius of the indentation, with all physical units being millimeters (mm). Based on this definition, the relative position rule of this unit is mathematically defined as the microscopic height field gradient operator. Projection vector of the light source plane Dot product relation: when When the rendering system calculates the result, the result is the illuminated surface, i.e., the specular highlight; when When the result is the backlight side, i.e., the shadow side;

[0167] Preset pits in the model library The above-mentioned negative Gaussian surface is used, and the convex surface is used as a positive Gaussian surface. This allows for the automatic generation of light and shadow reversal phenomena that conform to physical laws during ray tracing calculations. Point defects can be identified by monitoring this phase reversal phenomenon.

[0168] This embodiment uses parametric modeling, which allows the system to identify multiple types of defects without requiring a large number of samples for training. This physical rule-based modeling approach solves the problem of cold-starting deep learning methods when there are few defect samples, and gives the system a strong generalization ability.

[0169] In a preferred embodiment of the present invention, the feedback optimization module includes: a parameter correction unit, used to adjust the rendering accuracy based on historical misjudgment data; when continuous false defect false alarms are detected, the specular reflection coefficient in the bidirectional reflection distribution function parameters is corrected, and the generation benchmark of the ideal lighting response map is updated.

[0170] The sorting control unit is used to generate corresponding industrial control instructions in response to the defect determination results, marking target objects that are determined to have physical defects as defective products, and marking target objects that are determined to be without defects or only contain false defect noise as good products.

[0171] This embodiment further defines the feedback optimization module; the parameter correction unit is designed to compensate for simulation errors; in order to accurately define continuous false defect false alarms and establish closed-loop control, this embodiment uses the intermediate data of the feature consistency decision module to identify a special type of wandering specular residual signal.

[0172] Specifically, the system monitors feature regions that meet the following joint conditions. Trajectory similarity That is, it does not conform to the optical characteristics of the defect; positional change. This means that there is significant movement within the image sequence, consistent with the physical laws of specular reflection, rather than a static stain; the presence of this feature indicates that the specular component in the ideal illumination response map has not completely canceled out the actual highlights, i.e. Parameter setting deviation; for this type of area, calculate the marked average brightness deviation. The calculation formula is as follows:

[0173]

[0174] in, The original grayscale value was collected. For the current ideal rendering brightness, This is the theoretical maximum grayscale value of the image sensor, for example, 255 for an 8-bit image; the unit performs proportional integration based on this error. The revised calculation is as follows:

[0175]

[0176] in, Derived from calculation results, its physical meaning is the updated specular reflection coefficient;

[0177] Derived from the current settings, its physical meaning is the current specular reflection coefficient;

[0178] The parameters are derived from preset values: proportional gain (0.05) and integral gain (0.01). These two parameters are tuned during system initialization using the Ziegler-Nichols critical scaling method. The specific process is as follows: initially set the integral gain to 0, and then gradually increase the proportional gain until the highlight error is reached. Generate constant-amplitude oscillations, record the critical gain and oscillation period at this point, and calculate the final gain based on this. This ensures rapid convergence of the feedback adjustment without overshoot;

[0179] The statistical bias originates from the highlighted residual areas selected above;

[0180] This embodiment introduces... This dynamic screening condition ensures that the feedback mechanism only targets false highlight defects caused by BRDF parameter mismatch, and is not misled by static oil stains or dust noise, thus guaranteeing the correct physical direction of parameter adaptation; the sorting control unit outputs digital signals through the PLC interface. In response to the judgment result containing physical defects, it outputs a high-level signal to the rejection cylinder to push the workpiece into the defective product tank; otherwise, it outputs a low-level signal, and the workpiece flows into the good product line.

[0181] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.

Claims

1. A visual inspection system for processing metal signboard frames, characterized in that, include: The data acquisition module is used to acquire visual inspection data of the target object, collect multi-angle photometric stereo images under different light source angles, and load the standard three-dimensional design file and bidirectional reflectance distribution function parameters of the target object. The light field reference reconstruction module is used to construct a virtual optical simulation environment for the target object. Based on the standard 3D design file and bidirectional reflection distribution function parameters, it uses ray tracing algorithm to render an ideal illumination response map in a flawless state. Based on the preset defect optical model library, it injects parameterized virtual defect features into the ideal illumination response map to generate a simulated illumination map with defects. The dual difference extraction module is used to solve the light and shadow residual information on the surface of the target object, calculate the difference between the multi-angle photometric stereo image group and the ideal lighting response map, generate the real residual data, and at the same time calculate the difference between the simulated lighting map and the ideal lighting response map to generate the theoretical residual space. The feature consistency judgment module is used to determine the authenticity of suspected features in real residual data, extract the actual movement trajectory of feature regions in real residual data as the light source angle changes, extract the theoretical movement trajectory of feature templates in theoretical residual space as the light source angle changes, calculate the trajectory similarity between the actual movement trajectory and the theoretical movement trajectory, and output the defect judgment result of the target object based on the trajectory similarity. The feedback optimization module is used to adaptively adjust the detection parameters based on the defect determination results and output the final quality assessment signal.

2. The visual inspection system for metal signboard frame processing according to claim 1, characterized in that, The data acquisition module includes: The sequence acquisition unit is used to control the synchronous triggering of the camera and the light source, acquire grayscale sequence images of the target object under a preset set of different lighting directions, and use the grayscale sequence images as a multi-angle photometric stereo image group. The prior loading unit is used to parse standard 3D design files, extract the geometric dimensions, chamfer radius and theoretical surface roughness data of the target object, and map the extracted data into the imaging coordinate system of the camera to establish a virtual observation viewpoint.

3. The visual inspection system for metal signboard frame processing according to claim 1, characterized in that, The light field reference reconstruction module includes: The ideal rendering unit is used to generate an ideal lighting response map. Based on the intrinsic data of the actual camera and the spatial position of the light source, combined with the bidirectional reflection distribution function parameters, it simulates the reflection path of light on the geometric surface defined in the standard 3D design file and calculates the theoretical pixel brightness distribution of the target object under the current observation view. The defect parameter injection unit is used to generate a simulated lighting map, call the micro-geometric structure parameters in the defect optical model library, model the scratch as a micro-groove with anisotropic scattering characteristics, model the burr as a protruding geometry with edge diffraction characteristics, and superimpose the micro-geometric structure parameters into the surface properties of the standard 3D design file.

4. The visual inspection system for metal signboard frame processing according to claim 1, characterized in that, The dual difference extraction module includes: The reality extraction unit is used to eliminate background texture and structural highlights. It subtracts the pixel brightness value of the corresponding coordinate in the ideal illumination response map from the pixel gray value in the multi-angle photometric stereo image group to obtain the reality residual data containing potential defect signals and environmental noise. The theoretical extraction unit is used to obtain the pure defect light and shadow morphology. It subtracts the pixel brightness value of the corresponding coordinate in the ideal light response map from the pixel brightness value in the simulated lighting map to obtain the theoretical residual space containing only the optical response characteristics of the defects.

5. The visual inspection system for metal signboard frame processing according to claim 1, characterized in that, The feature consistency decision module includes: The feature mapping unit is used to extract local gradient direction features, and to calculate the local gradient direction histogram of the highlighted area in the real residual data, and the local gradient direction histogram of the corresponding type of defect in the theoretical residual space. The trend comparison unit is used to calculate the consistency of feature evolution under changes in illumination angle, track the pixel coordinate displacement of bright spots in real residual data as the light source angle changes, form the actual movement trajectory, and perform optical flow field matching with the theoretical movement trajectory pre-simulated in the theoretical residual space to generate the trajectory similarity.

6. The visual inspection system for metal signboard frame processing according to claim 5, characterized in that, The feature consistency decision module also includes: The logic decision unit is used to perform conditional logic judgments, set a similarity threshold and a stillness threshold, and is configured as follows: if the trajectory similarity is greater than the similarity threshold, then the feature in the real residual data is determined to be a physical defect; if the trajectory similarity is less than or equal to the similarity threshold, and the change in pixel coordinate position of the feature in the real residual data in the multi-angle photometric stereo image group is less than the stillness threshold, then the feature in the real residual data is determined to be pseudo-defect noise and is removed.

7. The visual inspection system for metal signboard frame processing according to claim 3, characterized in that, The defect optics model library includes: The scratch model unit is used to define the optical anisotropy of scratches, set the scratch depth, width and direction vector, and specify the illumination reflection rules when light is perpendicular to the scratch direction and produces a bright response, and when light is parallel to the scratch direction and produces a dark response. The point defect model unit is used to define the light and shadow reversal features of pits and bumps, and to set the relative position rules of the shadow and highlight positions of the defect area when the lighting angle changes.

8. The visual inspection system for metal signboard frame processing according to claim 1, characterized in that, The feedback optimization module includes: The parameter correction unit is used to adjust the rendering accuracy based on historical misjudgment data. When continuous false defect false alarms are detected, the specular reflection coefficient in the bidirectional reflection distribution function parameters is corrected and the generation benchmark of the ideal lighting response map is updated. The sorting control unit is used to generate corresponding industrial control instructions in response to the defect determination results, marking target objects that are determined to have physical defects as defective products, and marking target objects that are determined to be without defects or only contain false defect noise as good products.