An industrial visual defect intelligent diagnosis method and system
Patent Information
- Application Number
- CN202611338848.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-10-16
AI Technical Summary
[0008]针对现有技术的不足,本发明提供了一种工业视觉缺陷智能诊断方法及系统,解决了现有工业视觉缺陷诊断中归一镜面响应值与材料响应向量难以分离,导致几何缺陷和材料缺陷识别不准的问题
[0022] (1) An intelligent diagnostic method and system for industrial visual defects, which uniformly back-projects multi-angle parallel polarization images, cross-polarization images and dark field images onto surface elements, and constructs a local angle domain response volume in combination with a healthy angle domain response reference table, so that the response data under different lighting angles maintain spatial correspondence, reduces the interference of workpiece surface shape, lighting intensity and imaging position differences on abnormal area location, and improves the recognition stability of candidate abnormal surface element areas.
Smart Images

Figure CN122928862A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual defect diagnosis technology, specifically to an intelligent diagnostic method and system for industrial visual defects. Background Technology
[0002] With the development of intelligent manufacturing, machine vision, digital twins, and artificial intelligence technologies, industrial monitoring is gradually evolving from single-state acquisition to multi-source sensing, spatial mapping, feature fusion, and intelligent diagnosis. In the process of inspecting industrial product surfaces, information on brightness, color, texture, geometric morphology, and material state can be obtained through visible light imaging, polarization imaging, 3D structural data, and process state data. This information can then be combined with image processing, feature analysis, and machine learning methods to locate, classify, and assess the condition of industrial defects.
[0003] For example, application CN120974849B discloses a cable condition fault prediction method based on multi-source data fusion. This method constructs a digital twin model by acquiring multi-source data and performs real-time simulation calculations of the theoretical health baseline as operating conditions change. This baseline is compared with measured data to generate a thermoelectric coupling matrix that quantifies the deviation, and the degradation state is diagnosed accordingly. When the deviation exceeds a threshold, a gradient boosting decision tree model is applied for attribution analysis, generating a visual spectrum that correlates partial discharge with the root cause. Finally, high-risk visual patterns on the spectrum are intelligently identified to determine the defect type and predict high-risk conditions.
[0004] For example, application CN118823780B discloses a method and apparatus for generating pixel-level annotations for industrial defect images. The method includes: extracting discriminative features from a defect image; using the discriminative features to perform low-resolution pixel-level annotations on the defect image; extracting discriminative features from a normal image; using the discriminative features to perform low-resolution pixel-level annotations on the normal image; fusing the discriminative features of the defect image with high-resolution features output by a VAE decoder to obtain refined features; using the refined features to perform high-resolution pixel-level annotations on the defect image; generating an objective function based on the low-resolution and high-resolution pixel-level annotations of the defect and normal images, as well as a defect image mask and a normal image mask; and optimizing the annotation generation model using the objective function.
[0005] However, existing technologies mainly rely on multi-source data fusion, digital twin simulation, image feature extraction, and labeled models to identify defects. But when the metal surface has obvious specular reflection, the mirror response migration under different lighting angles, changes in surface geometric height, and changes in material color or polarization can easily affect the image response. Existing technologies cannot independently track and verify the cross-plane element specular response and material response, making it difficult to accurately distinguish between geometric defects such as pits, scratches, and burrs and material defects such as rust, oxide spots, and oil films.
[0006] Therefore, in order to address the above problems, there is an urgent need to provide an intelligent diagnostic method and system for industrial visual defects. Summary of the Invention
[0007] Technical problems to be solved
[0008] To address the shortcomings of existing technologies, this invention provides an intelligent diagnostic method and system for industrial visual defects, which solves the problem that the normalized mirror response value and material response vector are difficult to separate in existing industrial visual defect diagnosis, leading to inaccurate identification of geometric and material defects.
[0009] Technical solution
[0010] To achieve the above objectives, the present invention provides the following technical solution: an intelligent diagnostic method for industrial visual defects, comprising: S1, acquiring multi-angle parallel polarization images, cross-polarization images, and dark field images; back-projecting image pixels onto surface elements to generate normalized specular response values and material response vectors; and determining candidate abnormal surface element regions and local angular domain response volumes based on a healthy angular domain response benchmark table; S2, solving for forward and reverse receiving edges for adjacent illumination angle layers respectively; pairing receiving edges with interchanged endpoints to generate bidirectional back-cut specular response records and unclosed specular response values; and connecting the bidirectional back-cut specular response records to form a specular response back-cut chain; S3, based on the specular response... The defect height deviation field is solved by the return tangent chain. The deviation values of the unclosed mirror response value and the material response vector relative to the healthy range are used to form the material angular domain residual vector. The material response primitive and the bearing coefficient are fitted. S4, the healthy reference response value corresponding to the normalized mirror response value is transferred along the return tangent chain, and the response change generated by the material response primitive according to the bearing coefficient is superimposed to generate the joint complex response volume. S5, the bearing edge of the cross-surface element is replaced with the bearing edge of the same surface element, and the bearing coefficient of the retained material response primitive is set to zero. According to the increase of the closing residual after cancellation relative to the joint complex closing residual value, the geometric defect type code value set and the material defect type code value set are generated.
[0011] Further, the specific steps for acquiring multi-angle parallel polarization images, cross-polarization images, and dark field images, and back-projecting image pixels onto surface elements to generate normalized specular response values and material response vectors are as follows: Obtain the workpiece positioning pose value, camera calibration parameters, exposure time value, illumination angle sequence, measured irradiance value of the illumination unit, and a three-dimensional model of the metal detection surface. Divide the three-dimensional model of the metal detection surface into surface elements with surface element numbers, surface element center coordinates, model normal vectors, and surface element adjacency relationships. Keeping the workpiece position, camera position, and exposure time value unchanged, sequentially activate the collimating illumination unit according to the illumination angle from small to large, acquiring parallel polarization images and cross-polarization images at each illumination angle, and acquiring images when the collimating illumination unit is turned off. Dark field image; based on the workpiece positioning pose value, camera calibration parameters, and 3D model of the metal detection surface, the pixels in the parallel polarization image, cross polarization image, and dark field image are back-projected onto the surface elements; the difference between the parallel polarization brightness value and the cross polarization brightness value is divided by the product of the measured irradiance value of the illumination unit and the exposure time value, and negative values are set to zero to generate a normalized specular response value; the cross polarization red channel value and blue channel value are divided by the sum of the cross polarization red, green, and blue channel values, respectively, to generate red channel ratio values and blue channel ratio values; the polarization blanking ratio value is generated according to the ratio of the difference between the parallel polarization and cross polarization brightness values to the parallel polarization brightness value; the red channel ratio value, blue channel ratio value, and polarization blanking ratio value are combined to form a material response vector.
[0012] Further, the specific steps for determining candidate abnormal surface element regions and local corner domain response volumes based on the healthy corner domain response benchmark table are as follows: Read the health benchmark response values and health ranges of each surface element, each lighting angle, and each response field under the same workpiece model number and material batch number from the healthy corner domain response benchmark table; determine the surface elements whose normalized specular response value and at least one component of the material response vector exceeds the corresponding health range as abnormal surface elements; connect the abnormal surface elements with common edges to form candidate abnormal surface element regions; determine the layer of healthy surface elements with common edges to the boundary surface elements of each candidate abnormal surface element region as the reference surface elements outside the region; and arrange the normalized specular response values and material response vectors of the candidate abnormal surface element regions and the reference surface elements outside the region according to the surface element number and lighting angle to generate the local corner domain response volume.
[0013] Further, the specific steps for generating bidirectional back-cut mirror response records and unclosed mirror response values are as follows: For each group of adjacent illumination angle layers in the local corner domain response volume, the surface element of the previous illumination angle layer is set as the response output node, and the surface element of the subsequent illumination angle layer is set as the response receiving node. The response output node is connected to the response receiving nodes with the same number and a common edge. A response addition node and a response disappearance node are set. The response addition node is connected to each response receiving node, and each response output node is connected to the response disappearance node. The corresponding edge variables are set as the addition response and disappearance response, respectively. The normalized mirror response value is used as the total output and receiving amount of the nodes, so that the sum of the outflow response and disappearance response of each response output node is equal to the total output amount, and the sum of the inflow response and addition response of each response receiving node is equal to the total receiving amount. First, minimize the sum of the new response and the disappearance response. Then, while keeping the corresponding minimum value unchanged, minimize the sum of the cross-surface element receiving response values to obtain the receiving response values of each forward receiving edge. Set the next lighting angle layer as the response output layer and the previous lighting angle layer as the response receiving layer. Obtain the receiving response values of each reverse receiving edge according to the same surface element connection range and solution constraints. Pair the forward receiving edges with interchanged endpoints with the reverse receiving edges. Determine the smaller receiving response value as the bidirectional back-cut mirror response value and generate a bidirectional back-cut mirror response record containing the output surface element number, receiving surface element number, lighting angle range, and bidirectional back-cut mirror response value. For each surface element and lighting angle, subtract the sum of the inflow response value and the new response value of each receiving edge after deducting the bidirectional back-cut mirror response value, and subtract the sum of the outflow response value and the disappearance response value of each receiving edge to generate an unclosed mirror response value.
[0014] Furthermore, the specific steps for connecting bidirectional back-cut mirror response records to form a mirror response back-cut chain are as follows: In ascending order of illumination angle, connect the current bidirectional back-cut mirror response record with the record whose receiving element number is the same as the output element number of the bidirectional back-cut mirror response record in the next illumination angle interval; determine the smallest bidirectional back-cut mirror response value in each connection sequence as the chain response value and deduct it from the corresponding record, repeat the record connection and chain response value deduction until all bidirectional back-cut mirror response values are allocated, and generate a mirror response back-cut chain containing chain response values.
[0015] Further, the specific steps for solving the defect height deviation field based on the mirror response back-cutting chain are as follows: For each chain node in the mirror response back-cutting chain, the unit vector of the illumination direction pointing from the center of the surface element to the collimating illumination unit and the unit vector of the observation direction pointing from the center of the surface element to the optical center of the camera are summed and normalized to generate the chain node observation normal vector; For multiple chain node observation normal vectors of the same surface element, the weighted summation is performed according to the chain response value of the corresponding mirror response back-cutting chain and normalized to generate the surface element observation normal vector; For each surface element that generates the surface element observation normal vector, the surface element observation normal vector is projected onto the tangent plane corresponding to the model normal vector to generate the height deviation gradient vector; According to the projection value of the average height deviation gradient vector of adjacent surface elements and the center coordinate difference vector of adjacent surface elements onto the tangent plane corresponding to the sum of the model normal vectors of adjacent surface elements, the edge height deviation increment value is generated; The height deviation value of the reference surface element outside the region is set to zero, and the sum of the squares of the differences between the height deviation values of adjacent surface elements and the corresponding edge height deviation increment value is used as the objective function. The defect height deviation field is solved by minimizing the objective function.
[0016] Furthermore, the deviation of the unclosed mirror response value from the material response vector relative to the healthy range is used to form the material corner domain residual vector. The specific steps for fitting the material response primitives and the bearing coefficient are as follows: For each surface element and illumination angle within the candidate abnormal surface element region, the components in the material response vector that are within the corresponding healthy range are set to zero. The components that are lower than the lower limit of the healthy range are subtracted from the lower limit of the healthy range, and the components that are higher than the upper limit of the healthy range are subtracted from the upper limit of the healthy range. The processed components are then combined with the unclosed mirror response value to form the material corner domain residual vector. The rust response primitives, oxide spot response primitives, oil film response primitives, and corresponding material defect type codes corresponding to the same material batch number are read from the material defect corner domain response primitive table. The non-negative least squares method is used to fit the material corner domain residual vector. The material response primitives and the bearing coefficient with the smallest number of response primitives and a fitting error not greater than the allowable value for material reconstruction are retained.
[0017] Further, the specific steps for generating the joint composite response volume are as follows: For each illumination angle range and response output surface element, according to the proportion of the chain response value of each mirror response back-cut chain starting from the same response output surface element to the sum of the corresponding chain response values, the health reference response value corresponding to the normalized mirror response value in the health angle domain response reference table is transferred angle by angle along the mirror response back-cut chain. The health reference response value that does not form a mirror response back-cut chain is retained in the original surface element; the health reference response values of each field of the material response vector are retained, and the response changes generated by the retained material response primitives according to the bearing coefficient are superimposed to generate the joint composite response volume.
[0018] Further, the specific steps for generating the set of geometric defect type codes and the set of material defect type codes are as follows: The joint complex response volume and the local corner domain response volume are compared item by item. The difference between each item is divided by the difference between the upper and lower limits of the corresponding healthy range. The arithmetic mean of the normalized absolute values of the differences is calculated to generate the joint complex closure residual value. When the joint complex closure residual value is not greater than the joint complex allowable value, the material response primitives and bearing coefficients remain unchanged. The cross-surface element bearing edges in the mirror response back-cut chain are replaced with same-surface element bearing edges, and the joint complex closure residual value is recalculated. When the recalculated closure residual value increases by a factor of 1 to the geometric undo increment threshold compared to the joint complex closure residual value, surface elements with height deviation values less than zero and common edges are connected as negative height deviation regions, and surface elements with height deviation values greater than zero and common edges are connected as positive height deviation regions. Principal component analysis is performed on the center coordinates of the surface elements within the negative height deviation region. When the ratio of the projection length to the projection length in the second principal direction reaches the lower limit of the scratch length-to-width ratio, a scratch defect code value is written. For negative height deviation regions that do not have a scratch defect code value and do not intersect with the boundary of the candidate abnormal surface element region, a pit defect code value is written. For positive height deviation regions where there is a peak surface element with a height deviation value greater than all adjacent surface elements, and the height deviation value does not increase in the shortest surface element path from the peak surface element to the region boundary determined according to the surface element adjacency relationship, a burr defect code value is written. The written code values are then combined into a geometric defect type code value set. When the joint re-display closure residual value is not greater than the joint re-display allowable value, the mirror response back-cut chain remains unchanged, all material response primitives' acceptance coefficients are set to zero, and the closure residual is recalculated. When the recalculated joint re-display closure residual value increases by a factor reaching the material removal increment threshold compared to the original joint re-display closure residual value, the code values corresponding to the retained rust response primitives, oxide spot response primitives, and oil film response primitives are combined into a material defect type code value set.
[0019] The second aspect of this invention provides an intelligent diagnostic system for industrial visual defects, comprising: a angular domain response construction module, used to acquire multi-angle parallel polarization images, cross-polarization images, and dark field images; back-project image pixels onto surface elements; generate normalized specular response values and material response vectors; and determine candidate abnormal surface element regions and local angular domain response volumes based on a healthy angular domain response benchmark table; a bidirectional back-cut solution module, used to solve for the forward and reverse receiving edges of adjacent illumination angle layers respectively; pair receiving edges with interchanged endpoints; generate bidirectional back-cut specular response records and unclosed specular response values; and connect the bidirectional back-cut specular response records to form a specular response back-cut chain; and a geometric material decoupling module, used for mirror-based... The surface response back-cutting chain solves the defect height deviation field, and forms a material corner domain residual vector by combining the deviation of the unclosed mirror response value and the material response vector relative to the healthy range. It then fits the material response primitives and the bearing coefficient. The joint re-display diagnostic module is used to transfer the healthy baseline response value corresponding to the normalized mirror response value along the mirror response back-cutting chain, and superimposes the response changes generated by the material response primitives according to the bearing coefficient to generate the joint re-display response volume. The cross-surface element bearing edge is replaced with the same-surface element bearing edge, and the bearing coefficient of the retained material response primitives is set to zero. Based on the increase of the closure residual after cancellation relative to the joint re-display closure residual value, a set of geometric defect type coding values and a set of material defect type coding values are generated.
[0020] Beneficial effects
[0021] The present invention has the following beneficial effects:
[0022] (1) An intelligent diagnostic method and system for industrial visual defects, which uniformly back-projects multi-angle parallel polarization images, cross-polarization images and dark field images onto surface elements, and constructs a local angle domain response volume in combination with a healthy angle domain response reference table, so that the response data under different lighting angles maintain spatial correspondence, reduces the interference of workpiece surface shape, lighting intensity and imaging position differences on abnormal area location, and improves the recognition stability of candidate abnormal surface element areas.
[0023] (2) An intelligent diagnostic method and system for industrial visual defects, by solving the forward and reverse connecting edges separately and using the endpoint interchange relationship to form a mirror response back-cut chain, the migration path of the normalized mirror response value between continuous illumination angle layers can be tracked. At the same time, the unclosed mirror response value is used to characterize the abnormal components that cannot be explained by mirror response migration, so as to avoid misjudging the highlight movement caused by angle change as a surface defect.
[0024] (3) An intelligent diagnostic method and system for industrial visual defects, which solves the defect height deviation field by using the mirror response back-cut chain, and decomposes the deviation values of the unclosed mirror response value and the material response vector into material response primitives and bearing coefficients, thereby realizing the separation of surface geometric deformation response from material state responses such as rust, oxide spots, and oil film, so that geometric defects such as pits, scratches, and burrs can be diagnosed separately from material defects.
[0025] (4) An intelligent diagnostic method and system for industrial visual defects, which generates a joint composite response body and replaces the cross-surface element receiving edge with the same surface element receiving edge and sets the receiving coefficient of the retained material response element to zero, thereby increasing the closed residual to verify the contribution of geometric components and material components to the measured response, so that the defect type determination has a basis that is reproducible, revocable and verifiable, reduces misjudgment caused by composite defects and specular reflection interference, and improves the credibility and interpretability of the diagnostic results. Attached Figure Description
[0026] Figure 1 A flowchart of an intelligent diagnostic method for industrial visual defects;
[0027] Figure 2 The diagram shows the decoupling results of the mirror response back-cutting chain and the geometric material.
[0028] Figure 3 This is a structural diagram of an intelligent diagnostic system for industrial visual defects. Detailed Implementation
[0029] 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.
[0030] Please see Figures 1-3This invention provides a technical solution: an intelligent diagnostic method for industrial visual defects, comprising: S1, acquiring multi-angle parallel polarization images, cross-polarization images, and dark field images; back-projecting image pixels onto surface elements to generate normalized specular response values and material response vectors; and determining candidate abnormal surface element regions and local angular domain response volumes based on a healthy angular domain response benchmark table; S2, solving for forward and reverse receiving edges for adjacent illumination angle layers respectively; pairing receiving edges with interchanged endpoints to generate bidirectional back-cut specular response records and unclosed specular response values; and connecting the bidirectional back-cut specular response records to form a specular response back-cut chain; S3, based on the specular response back-cut chain... Solve for the defect height deviation field, and form a material corner domain residual vector by combining the deviation values of the unclosed mirror response value and the material response vector relative to the healthy range. Fit the material response primitive and the bearing coefficient; S4, transfer the healthy reference response value corresponding to the normalized mirror response value along the mirror response back tangent chain, and superimpose the response change generated by the material response primitive according to the bearing coefficient to generate a joint complex response volume; S5, replace the bearing edge of the cross-surface element with the bearing edge of the same surface element, set the bearing coefficient of the retained material response primitive to zero, and generate a set of geometric defect type coding values and a set of material defect type coding values based on the increase of the closed residual after cancellation relative to the joint complex closed residual value.
[0031] Specifically, the steps for acquiring multi-angle parallel polarization images, cross-polarization images, and dark field images, back-projecting image pixels onto surface elements, and generating normalized specular response values and material response vectors are as follows: Obtain the workpiece positioning pose value, camera calibration parameters, exposure time value, illumination angle sequence, measured irradiance value of the illumination unit, and the three-dimensional model of the metal detection surface; set the workpiece coordinate system to coincide with the coordinate system of the three-dimensional model of the metal detection surface; the workpiece positioning pose value is obtained by rigidly registering the measured coordinates of the fixture positioning reference point in the detection station coordinate system with the reference point of the three-dimensional model of the metal detection surface; and a 4×4 homogeneous transformation matrix is used to record the coordinate system of the three-dimensional model of the metal detection surface to the detection station coordinate system. The translation and rotation of the measurement station coordinate system are measured, and the root mean square error of the registered reference point is controlled within 0.05mm. Camera calibration parameters include the camera intrinsic matrix, radial distortion coefficient, tangential distortion coefficient, and extrinsic matrix from the measurement station coordinate system to the camera coordinate system. These parameters are calculated after acquiring calibration images in at least fifteen poses using a planar calibration board. The reprojection error is controlled within 0.2 pixels. The extrinsic matrix is used to transform the measurement station coordinates to the camera coordinate system, and its inverse is used to transform the camera optical center and unit line-of-sight vector to the measurement station coordinate system. Exposure time values are read from the industrial camera's exposure register, and the exposure time ranges from 0.5ms to 5ms. Within the millisecond range, the proportion of unsaturated pixels in the parallel polarized image at the maximum illumination angle is determined, ensuring that the proportion of pixels with grayscale values reaching 95% of the camera's full scale does not exceed 1%. The illumination angle sequence is arranged from smallest to largest according to the angle between the principal optical axis of the collimated illumination unit and the Z-axis of the three-dimensional model coordinate system of the metal detection surface. The difference between adjacent illumination angles is 5° to 15°, and the specific difference is jointly determined by the half-width at half-maximum (WHM) of the normalized specular response peak of the healthy workpiece and the expected response migration range of a single surface element at adjacent illumination angles. The measured irradiance values of the illumination unit are collected by a metrologically calibrated silicon photodetector at the center and four corners of the detection surface, and based on the irradiance values at the five sampling locations, according to the proportion of unsaturated pixels in the parallel polarized image at the maximum illumination angle, the sequence is determined. Bilinear interpolation is performed on the center coordinates of the surface elements to obtain the measured irradiance values of the lighting units corresponding to the surface elements at each lighting angle. The relative range of three consecutive measurements does not exceed 2%. The three-dimensional model of the metal detection surface is read from the workpiece design file. The main positioning reference point defined in the workpiece design file is used as the origin of the coordinate system of the three-dimensional model of the metal detection surface. The X-axis is along the length direction of the workpiece, the Y-axis is along the width direction of the workpiece, and the Z-axis is along the outward normal direction of the metal detection surface. The coordinates of the model vertices are uniformly transformed to the coordinate system of the three-dimensional model of the metal detection surface. The three-dimensional model of the metal detection surface is divided into triangular surface elements with surface element numbers, surface element center coordinates, model normal vectors, and surface element adjacency relationships.The side length of the surface element is taken as 1mm to 5mm, and the specific value is determined by the minimum width of the defect to be identified and the number of effective back-projection pixels that a single surface element can receive. The center coordinates of the surface element are obtained by averaging the vertex coordinates of the surface element. The model normal vector is obtained by normalizing the cross product of the surface element edge vectors. Two surface elements with a common edge are written into the surface element adjacency relationship. The surface element numbers are generated in the order of increasing X, Y, and Z coordinates in the coordinate system of the three-dimensional model of the metal detection surface. Keeping the workpiece position, camera position, and exposure time value unchanged, the workpiece is locked by a positioning fixture, and the camera and collimation illumination unit are mounted on a rigid support. During a single round of acquisition, the translational fluctuation of the workpiece positioning pose value is no greater than 0.03mm and the rotational fluctuation is no greater than 0. The collimating illumination unit is activated sequentially from smallest to largest illumination angle, and parallel polarization and cross-polarization images are acquired at each illumination angle. A dark-field image is acquired when the collimating illumination unit is deactivated. A linear polarizer is installed at the light-emitting end of the collimating illumination unit, and an electrically controlled polarizer is installed in front of the industrial camera lens. Parallel polarization images are acquired when the transmission direction of the electrically controlled polarizer is parallel to the transmission direction of the linear polarizer, and cross-polarization images are acquired when the transmission direction of the electrically controlled polarizer is rotated 90° relative to the linear polarizer. Three frames of parallel polarization images and three frames of cross-polarization images are continuously acquired at each illumination angle and synthesized based on the pixel median. Five frames of dark-field images are continuously acquired using the same exposure time and synthesized based on the pixel median, generating an image with the same pixel coordinates as the parallel polarization and cross-polarization images. The dark field correction image is generated; based on the workpiece positioning pose value, camera calibration parameters, and the 3D model of the metal inspection surface, the pixels in the parallel polarization image, cross polarization image, and dark field image are back-projected onto the surface elements; in specific execution, the pixel coordinates are first corrected using the radial distortion coefficient and the tangential distortion coefficient, and then the corrected pixel coordinates are converted into the unit line-of-sight vector in the camera coordinate system using the inverse matrix of the camera intrinsic parameter matrix; the camera optical center and the unit line-of-sight vector are transformed to the inspection station coordinate system using the inverse matrix of the extrinsic parameter matrix, and then transformed to the 3D model coordinate system of the metal inspection surface using the inverse matrix of the homogeneous transformation matrix corresponding to the workpiece positioning pose value. Among them, the coordinate points are translated and rotated using homogeneous coordinates, and the unit line-of-sight vector is only transformed using the corresponding rotation matrix. The line direction is transformed and re-normalized; the intersection points of the transformed camera optical center ray and each triangle surface element are calculated using the Möller-Trumbore ray triangle intersection method, and only the intersection points located in the positive direction of the unit view and with the model normal vector pointing towards the camera optical center are retained; when the same pixel corresponds to multiple valid intersection points, the intersection point with the smallest distance along the positive direction of the unit view is determined as the visible intersection point, and the surface elements corresponding to the other intersection points are determined as occluded surface elements and are not received by the current pixel; when the distance difference between multiple intersection points and the camera optical center is not greater than 0.01mm, the surface element with the smaller angle between the model normal vector and the camera viewing direction is selected first. If the angle is still the same, the surface element with the smaller surface element number is selected, so that only one surface element is written for the same pixel.Pixels that do not form a valid intersection point are not written to the surface element; when the same surface element receives multiple pixels, the corresponding pixel values in the parallel polarization image, cross-polarization image, and dark-field correction image are read according to the pixel coordinates. The dark-field brightness value under the same pixel coordinate is subtracted from the brightness value of the parallel polarization pixel and the brightness value of the cross-polarization pixel, and the value of the same channel in the dark-field correction image is subtracted from the red, green, and blue channel values of the cross-polarization pixel. When the subtraction result is negative, it is set to zero; pixels with grayscale values reaching 95% of the camera's full scale, and pixels where the angle between the unit vector of the observation direction pointing from the intersection point of the surface element to the camera's optical center and the model normal vector is greater than 80°, do not participate in the surface element response calculation; for the remaining pixels The median value of the dark field correction results is used to generate parallel polarization brightness values, cross-polarization brightness values, and cross-polarization red, green, and blue channel values. The number of effective back-projected pixels for a single surface element in a single image is no less than nine. If the number of effective back-projected pixels is less than nine, the corresponding surface element is determined as an invisible surface element under the current illumination angle, and no normalized specular response value or material response vector is generated under the current illumination angle. It is not included in subsequent healthy range comparison, edge solving, and material response element fitting. The difference between the parallel polarization brightness value and the cross-polarization brightness value is divided by the product of the measured irradiance value of the illumination unit and the exposure time value; negative values are set to zero to generate the normalized specular response value. Dark field corrected image. To eliminate dark current and fixed pattern bias in industrial cameras, the difference between parallel polarization brightness values and cross-polarization brightness values is used to extract specular reflection components suppressed by cross-polarization. The product of the measured irradiance value and exposure time value of the illumination unit is used to eliminate differences in incident energy and integration time under different illumination angles. The normalized specular response value is written into the angular domain response record according to the surface element number and illumination angle. The sum of the cross-polarized red channel value, green channel value, and blue channel value is calculated, and three times the camera quantization step size is determined as the channel sum validity threshold. When the sum of the cross-polarized red channel value, green channel value, and blue channel value is greater than the channel sum validity threshold, the cross-polarized red channel value and blue channel value are divided by the cross-polarized red channel value, respectively. The sum of the color channel values, green channel values, and blue channel values generates the red channel ratio values and blue channel ratio values. When the sum of the cross-polarized red channel values, green channel values, and blue channel values is not greater than the channel sum validity threshold, the red channel ratio values and blue channel ratio values under the current surface element and the current illumination angle are not generated. The material response vector of the corresponding surface element under the current illumination angle is excluded from healthy range comparison and material response primitive fitting to avoid division by zero and noise amplification caused by the channel sum value being close to zero. The red channel ratio values and blue channel ratio values are normalized using the channel sum value to reduce the influence of illumination energy changes on the material color response and retain the spectral ratio changes caused by rust, oxide spots, and oil films.The non-negative result of subtracting the cross-polarization brightness value from the parallel polarization brightness value is defined as the difference between parallel and cross-polarization brightness values. When the parallel polarization brightness value is greater than three times the camera quantization step size, the difference between parallel and cross-polarization brightness values is divided by the parallel polarization brightness value to generate a polarization blanking ratio value, which is then limited to the range of 0 to 1. When the parallel polarization brightness value is not greater than three times the camera quantization step size, no polarization blanking ratio value is generated for the current surface element and the current illumination angle, and the corresponding material response vector is excluded from healthy range comparison and material response primitive fitting to avoid using the low signal-to-noise ratio parallel polarization brightness value as the denominator, which would cause undefined calculation results and noise. Magnification; the polarization blanking ratio is used to characterize the degree to which surface reflected light is suppressed by cross-polarization; when the red channel ratio, blue channel ratio, and polarization blanking ratio are all valid, the red channel ratio, blue channel ratio, and polarization blanking ratio are combined to form a material response vector. This material response vector is written in a fixed order of red channel ratio, blue channel ratio, and polarization blanking ratio, and is associated with and stored as a normalized specular response value under the same surface element number and illumination angle. This allows subsequent healthy range comparisons, unclosed specular response value combinations, and material response element fitting to read response data under the same surface element number and illumination angle.
[0032] In this implementation scheme, by unifying the workpiece positioning pose value, camera calibration parameters, illumination angle sequence, measured irradiance value of illumination unit, and spatial and energy correspondence between the 3D model of the metal detection surface and the multi-angle polarization image, the normalized specular response value and the material response vector can be stably correlated under the same surface element number and illumination angle. This reduces response drift caused by imaging distortion, dark field bias, exposure difference, illumination fluctuation, and surface tilt. It provides a consistent and traceable data foundation for candidate abnormal surface element region identification, specular response back-cutting, defect height deviation field solution, and material response element fitting in industrial monitoring scenarios, thereby improving the stability and reliability of geometric defect and material defect diagnosis.
[0033] Specifically, the steps for determining candidate abnormal surface element regions and local corner response volumes based on the healthy corner response benchmark table are as follows: After the workpiece is locked by the positioning fixture, the workpiece model number is read from the workpiece production identification, and the material batch number is read from the material traceability label. The workpiece model number and material batch number are associated and stored with the current workpiece positioning pose value and the three-dimensional model of the metal detection surface. The workpiece model number and material batch number are used as the retrieval conditions of the healthy corner response benchmark table to ensure that the read healthy benchmark response value and healthy range correspond to the current workpiece to be inspected. The healthy corner response benchmark table consists of 30 to 10 pieces of workpieces with the same workpiece model number and the same material batch number that have passed the appearance review and dimensional inspection. Zero healthy workpieces were established. Healthy workpieces were acquired using the same surface element division method, illumination angle sequence, exposure time value, measured irradiance value acquisition method for illumination units, and pixel back projection method as the workpieces under inspection. For each surface element, each illumination angle, and each response field, the normalized specular response value, red channel ratio value, blue channel ratio value, and polarization blanking ratio value of each healthy workpiece were collected. Hamper filtering was used to remove sampled values that deviated from the median value by more than three times the median absolute deviation. The median value of the remaining sampled values was written into the healthy baseline response value. The 2.5th percentile and 97.5th percentile values of the remaining sampled values were written into the lower limit and upper limit of the healthy range, respectively. The lower limit of the healthy range... The values and the upper limit of the health range constitute the health range for the corresponding surface element, the corresponding lighting angle, and the corresponding response field; the number of healthy workpieces starts at 30, and ten healthy workpieces are added each time, and the health range is recalculated; when the width of the health range for each surface element, each lighting angle, and each response field does not change by more than 5% relative to the width of the health range before adding healthy workpieces, the addition of healthy workpieces is stopped; if there are still records where the width of the health range changes by more than 5% after the number of healthy workpieces reaches 100, the health range of the corresponding surface element number, lighting angle, and response field is not written into the health angle domain response benchmark table, and the corresponding health range is not used to perform health range comparison; the health angle domain response benchmark table is based on the workpiece model number, The material batch number, surface element number, lighting angle, and response field form a composite index. Each record contains a health baseline response value, a lower limit of the health range, and an upper limit of the health range. The response field includes a normalized specular response value, a red channel ratio value, a blue channel ratio value, and a polarization blanking ratio value, ensuring that different surface elements, lighting angles, and response fields have independent health baseline response values and health ranges. The health baseline response values and health ranges for each surface element, lighting angle, and response field under the same workpiece model number and material batch number are read from the health angle domain response baseline table. During the reading process, the workpiece model number, material batch number, surface element number, lighting angle, and response field are matched item by item.For each surface element and each illumination angle, the normalized specular response value, red channel scale value, blue channel scale value, and polarization blanking scale value are compared with the lower and upper limits of the healthy range corresponding to the same surface element number, the same illumination angle, and the same response field. If the measured value is lower than the lower limit or higher than the upper limit, the corresponding measured value is determined to be outside the healthy range; if the measured value is within the closed interval formed by the lower and upper limits, the corresponding measured value is determined to be within the healthy range. Surface elements whose normalized specular response value and at least one component of the material response vector exceed the corresponding healthy range are identified as anomalous surface elements. Anomalous surface element determination is limited to the same surface element number, Perform the following steps between surfaces with the same lighting angle and the same response field: Connect anomalous surfaces with a common edge to form candidate anomalous surface regions. During connection, based on surface adjacency, start with the unconnected anomalous surface with the smallest surface number and perform a breadth-first search. Anomalous surfaces continuously reached via a common edge are written into the same candidate anomalous surface region until all anomalous surfaces have been assigned to a region. Generate candidate anomalous surface region numbers in ascending order of the smallest surface number within each candidate anomalous surface region. Anomalous surfaces with at least one adjacent surface outside the region are identified as boundary surfaces of the candidate anomalous surface region. All valid response fields that share a common edge with the boundary surfaces of the candidate anomalous surface region and are valid under all effective lighting angles are considered as boundary surfaces. Healthy surface elements within the corresponding healthy range are identified as reference surface elements outside the region. The normalized specular response values and material response vectors of candidate abnormal surface element regions and reference surface elements outside the region are arranged according to surface element number and illumination angle to generate a local corner domain response volume. During arrangement, the surface element number is used as the first arrangement direction (smallest to largest), and the illumination angle is used as the second arrangement direction (smallest to largest). The normalized specular response value, red channel scale value, blue channel scale value, and polarization blanking scale value are used as the response field direction in a fixed order. All surface elements within the candidate abnormal surface element region and the reference surface elements outside the region are written into the same local corner domain response volume. Before generating the local corner domain response volume, the normalized specular response value corresponding to each surface element is checked. If valid response data is not generated due to image saturation, transient noise, fewer than nine effective back-projection pixels, channel sum not exceeding the channel sum validity threshold, or parallel polarization brightness value not exceeding three times the camera quantization step size, then re-acquire parallel polarization, cross polarization, and dark field images at the corresponding illumination angle. If the number of effective back-projection pixels is still less than nine after re-acquisition, increase the industrial camera's imaging resolution, read the camera calibration parameters corresponding to the adjusted imaging resolution, and then perform image acquisition and pixel back-projection. If the material response vector is still invalid after re-acquisition, do not generate the local angular domain response volume corresponding to the current candidate abnormal surface region, and end the diagnosis of the current candidate abnormal surface region.
[0034] In this implementation scheme, by using a healthy corner domain response benchmark table to uniformly constrain surface elements, illumination angles, and response fields under the same workpiece model number and material batch number, health fluctuations, imaging fluctuations, and specular peak position changes are distinguished from true abnormal responses. Furthermore, by using benchmark elements outside the region to form a stable spatial reference, the boundaries of candidate abnormal surface element regions are made more continuous, and the data correspondence of local corner domain response volumes is more complete. This provides a consistent and traceable data foundation for solving forward and reverse edge connections, constructing specular response back-cutting chains, solving defect height deviation fields, and fitting material response primitives.
[0035] Specifically, the steps for generating bidirectional back-cut mirror response records and unclosed mirror response values are as follows: For each group of adjacent illumination angle layers in the local corner domain response volume, the illumination angle layer with the smaller illumination angle is determined as the previous illumination angle layer, and the illumination angle layer with the larger illumination angle is determined as the next illumination angle layer, and the closed interval formed by the two illumination angles is determined as the illumination angle interval; the surface element of the previous illumination angle layer is set as the response output node, and the surface element of the next illumination angle layer is set as the response receiving node; the response output node is connected to the response receiving node with the same number and a common edge; the nodes with the same number are connected to form the same surface element receiving edge, and the nodes with different numbers and a common edge are connected to form the cross surface element receiving edge. Set up a response addition node and a response disappearance node. Connect the response addition node to each response receiving node, and connect each response output node to the response disappearance node. Set the corresponding edge variables as the addition response and disappearance response, respectively. Set forward receiving response variables for each same-surface element receiving edge and cross-surface element receiving edge. Set forward addition response variables for each response receiving node, and forward disappearance response variables for each response output node. All forward receiving response variables, forward addition response variables, and forward disappearance response variables are limited to not less than zero. Determine the normalized specular response value of the corresponding surface element in the previous illumination angle layer as the total output of the response output node, so that all forward receiving edges originating from the same response output node... The sum of the response value and the corresponding vanishing response value equals the corresponding total output. The normalized specular response value of the corresponding surface element in the next illumination angle layer is determined as the total received value of the response receiving node, ensuring that the sum of all forward received response values reaching the same response receiving node and the corresponding newly added forward response value equals the corresponding total received value. A two-stage linear programming approach is used to solve for each forward received response variable, newly added forward response variable, and vanishing forward response variable. The first stage aims to minimize the sum of all newly added forward response values and all vanishing forward response values, achieving the minimum value under the constraints of the total output values and the non-negativity constraints of all variables. The second stage maintains the sum of all newly added forward response values and all vanishing forward response values at a minimum. The first stage minimizes the sum of the forward response values of all cross-surface element receiving edges, and then solves the problem again with the goal of minimizing the sum of the forward receiving response values. This allows the normalized mirror response value to be received first along the receiving edges of the same-surface element, and migrates along the receiving edges of cross-surface elements when it cannot be received by the receiving edges of the same-surface element. In the second stage, when there are multiple optimal solutions, the forward receiving response variables are arranged in ascending order of response output node number and response receiving node number. Then, the forward newly added response variables are arranged in ascending order of response receiving node number, and the forward disappearing response variables are arranged in ascending order of response output node number. Under the condition that the objective values of the two stages remain unchanged, the solution with the smaller value of the variable corresponding to the arrangement position is selected in turn until a unique forward solution result is determined.Set the surface elements of the next lighting angle layer as reverse response output nodes, and the surface elements of the previous lighting angle layer as reverse response receiving nodes. Connect the reverse response output nodes to reverse response receiving nodes with the same number and a common edge. Set up reverse response addition nodes and reverse response disappearance nodes. Connect the reverse response addition nodes to each reverse response receiving node, and connect each reverse response output node to the reverse response disappearance node. Set reverse response receiving variables for each reverse receiving edge, reverse addition response variables for each reverse response receiving node, and reverse disappearance response variables for each reverse response output node. All reverse variables are limited to not less than zero. Return the corresponding surface elements in the next lighting angle layer to the... A specular response value is determined as the total output of the reverse response output node, such that the sum of all reverse received response values originating from the same reverse response output node and the corresponding reverse vanishing response value equals the corresponding total output. The normalized specular response value of the corresponding surface element in the previous lighting angle layer is determined as the total received value of the reverse response receiving node, such that the sum of all reverse received response values reaching the same reverse response receiving node and the corresponding reverse newly added response value equals the corresponding total received value. The reverse solution adopts the same two-stage linear programming and optimal solution selection order as the forward solution, only swapping the output and receiving relationships between the two lighting angle layers, without changing the surface element number, surface element adjacency relationship, and normalized specular response value. The surface element index of the previous lighting angle layer is... The forward receiving edge of a surface element in the next illumination angle layer and the reverse receiving edge pointing from the same receiving surface element in the next illumination angle layer to the same output surface element in the previous illumination angle layer are determined as the receiving edges with endpoint swaps. The smaller of the forward receiving response value and the reverse receiving response value with endpoint swaps is determined as the bidirectional back-cut mirror response value. A bidirectional back-cut mirror response record is generated, containing the output surface element number, receiving surface element number, illumination angle range, and bidirectional back-cut mirror response value. The bidirectional back-cut mirror response record number is generated in ascending order of illumination angle range start angle value, output surface element number, and receiving surface element number. If the bidirectional back-cut mirror response value is not greater than the numerical calculation tolerance, it is not written into the bidirectional back-cut mirror response record. One billionth of the larger sum of the normalized specular response values of two adjacent lighting angle layers is taken; for each paired forward and reverse receiving edge, the corresponding bidirectional back-cut specular response value is subtracted from the forward and reverse receiving response values respectively to generate the forward receiving response residual value and the reverse receiving response residual value; for each surface element and lighting angle at the middle position of the lighting angle sequence, the forward receiving response residual value reaching the current surface element in the previous lighting angle interval, the reverse receiving response residual value reaching the current surface element in the next lighting angle interval, the forward new response value corresponding to the previous lighting angle interval, and the reverse new response value corresponding to the next lighting angle interval are added together to obtain the sum of the inflow response and the new response;The sum of the forward receiving response remaining value from the current surface element in the next illumination angle interval, the reverse receiving response remaining value from the current surface element in the previous illumination angle interval, the forward disappearing response value corresponding to the next illumination angle interval, and the reverse disappearing response value corresponding to the previous illumination angle interval is obtained to get the sum of the outflow response and the disappearing response. The sum of the inflow response and the new response is subtracted from the sum of the outflow response and the disappearing response to generate the unclosed mirror response value corresponding to the current surface element and the current illumination angle. For the starting position of the illumination angle sequence, the remaining receiving response value, the new response value, and the disappearing response value corresponding to the previous illumination angle interval that do not exist are all treated as zero. For the termination position of the illumination angle sequence, the remaining value of the receiving response, the newly added response value, and the disappearing response value corresponding to the non-existent subsequent illumination angle interval are all treated as zero; when there is no actual receiving edge, the sum of the remaining values of the corresponding receiving responses is treated as zero; the unclosed mirror response value retains its positive and negative sign, a positive value indicates that after deducting the bidirectional back-cut mirror response value, the remaining amount formed by the inflow response and the newly added response is greater than the remaining amount formed by the outflow response and the disappearing response, and a negative value indicates that the remaining amount formed by the outflow response and the disappearing response is greater than the remaining amount formed by the inflow response and the newly added response, and the unclosed mirror response value is written into the corresponding position of the local corner domain response volume according to the surface element number and the illumination angle;
[0036] In this implementation scheme, by applying forward continuation and reverse back-cut consistency constraints to the normalized specular response values in adjacent illumination angle layers, the bidirectional back-cut specular response values retain only the response migration amounts jointly confirmed by the two solution directions. This reduces the interference of illumination angle changes, local response increases or decreases, and unidirectional solution deviations on the cross-surface element continuation relationship. Furthermore, the unclosed specular response values are used to characterize the remaining responses that cannot be explained by the bidirectional specular response migration, thereby improving the reliability of the bidirectional back-cut specular response records and providing a stable and verifiable data foundation for the construction of specular response back-cut chains and the generation of material corner domain residual vectors.
[0037] Specifically, the steps for connecting bidirectional back-cut mirror response records to form a mirror response back-cut chain are as follows: Arrange all bidirectional back-cut mirror response records in ascending order of the starting angle value of the illumination angle interval; within the same illumination angle interval, arrange the bidirectional back-cut mirror response records in ascending order of output element number, receiving element number, and bidirectional back-cut mirror response record number; and establish a bidirectional back-cut mirror response value to be assigned for each bidirectional back-cut mirror response record, initially using the corresponding bidirectional back-cut mirror response value; in ascending order of illumination angle, connect the receiving element number of the current bidirectional back-cut mirror response record to the output element number of the bidirectional back-cut mirror response record in the next illumination angle interval. The records are linked, requiring the current lighting angle interval's ending angle value to be consistent with the next lighting angle interval's starting angle value, prohibiting crossing intermediate lighting angle intervals. Each bidirectional back-cut mirror response record is treated as a directed record node. A record succession relationship is established between two bidirectional back-cut mirror response records that meet the connection conditions, allowing the same normalized mirror response quantity to be transmitted along continuous lighting angle intervals and continuous surface element paths. Each wheel chain extracts the starting record from the bidirectional back-cut mirror response records whose unassigned bidirectional back-cut mirror response values are greater than the numerical calculation tolerance, sequentially selecting the starting record in ascending order of lighting angle interval starting angle value, output surface element number, successor surface element number, and bidirectional back-cut mirror response record number. From the starting record, the search proceeds step by step to the next lighting angle interval. If the current record satisfies the connection conditions and the bidirectional back-cut mirror response value to be assigned is greater than the numerical calculation tolerance, the next record is directly connected if the current record corresponds to only one next record. If the current record corresponds to multiple next records, the next record with the larger bidirectional back-cut mirror response value to be assigned is connected first. If the bidirectional back-cut mirror response values to be assigned are the same, the next record with the smaller receiving element number and the smaller bidirectional back-cut mirror response record number is selected in sequence until the current record has no next record that satisfies the connection conditions, thus forming a connection sequence. The same bidirectional back-cut mirror response record is allowed to enter multiple connection sequences in different rounds. Each time it enters a connection sequence, only the current bidirectional back-cut mirror response value to be assigned is used, and the sum of the chain response values assigned to each mirror response back-cut chain is not greater than 1. The original bidirectional back-cut mirror response value corresponding to the bidirectional back-cut mirror response record is used to perform branch splitting round by round according to the bidirectional back-cut mirror response value to be assigned when there are multiple output records in the next illumination angle interval corresponding to a receiving surface element; the smallest bidirectional back-cut mirror response value to be assigned in the current connection sequence is determined as the chain response value, and the chain response value is deducted from the bidirectional back-cut mirror response value to be assigned in each bidirectional back-cut mirror response record in the current connection sequence; when the deduction result is not greater than the numerical calculation tolerance, the corresponding bidirectional back-cut mirror response value to be assigned is set to zero, and the corresponding bidirectional back-cut mirror response record is removed from the subsequent connection candidate range; when the deduction result is greater than the numerical calculation tolerance, the corresponding bidirectional back-cut mirror response record is retained to participate in the next round of connection sequence construction;The numerical calculation tolerance is consistent with the numerical calculation tolerance used when writing the bidirectional back-cut mirror response record to prevent floating-point tail differences from causing unterminated repeated allocations. When there is no subsequent record that meets the connection conditions for the current starting record, a mirror response back-cut chain is generated by the connection sequence containing only the current bidirectional back-cut mirror response record, and the current bidirectional back-cut mirror response value to be allocated is determined as the chain response value, so that bidirectional back-cut mirror response values that cannot continue to be connected to subsequent lighting angle intervals are still allocated. The process of selecting the starting record, generating the connection sequence, determining the chain response value, and deducting the bidirectional back-cut mirror response value to be allocated is repeated. The process continues until the bidirectional back-cut mirror response values of all bidirectional back-cut mirror response records are no greater than the numerical calculation tolerance; each round of deduction ensures that at least one bidirectional back-cut mirror response record in the current connection sequence is removed from the subsequent connection candidate range, thus the chain extraction process can terminate within a finite number of rounds; for example, in the first illumination angle interval, the bidirectional back-cut mirror response record pointing from surface element A to surface element B corresponds to a bidirectional back-cut mirror response value of 0.60, and in the next illumination angle interval, the two bidirectional back-cut mirror response records pointing from surface element B to surface elements C and D respectively correspond to bidirectional back-cut mirror response values of 0.60. The back-cut mirror response values are 0.35 and 0.25, respectively. In the first round, the bidirectional back-cut mirror response records corresponding to surface elements A, B, and C are connected first, and 0.35 is determined as the chain response value. After deduction, the bidirectional back-cut mirror response record from surface element A to surface element B has a remaining value of 0.25, while the bidirectional back-cut mirror response record from surface element B to surface element C is set to zero. In the second round, the bidirectional back-cut mirror response records corresponding to surface elements A, B, and D are connected, and 0.25 is determined as the chain response value. After deduction, both records are set to zero, thus establishing the branch position. The 0.60 bidirectional back-cut mirror response value is split into two mirror response back-cut chains with chain response values of 0.35 and 0.25, respectively. Back-cut chain numbers are generated according to the extraction order of the mirror response back-cut chains. For each mirror response back-cut chain, the back-cut chain number, chain response value, starting illumination angle, ending illumination angle, surface element number sequence arranged in ascending order of illumination angle, and bidirectional back-cut mirror response record number sequence are written. This ensures that subsequent chain node observation normal vector generation, surface element observation normal vector weighting, and health baseline response value transfer can read continuous angle paths and corresponding chain response values according to the same mirror response back-cut chain.
[0038] In this implementation scheme, by organizing the bidirectional back-cut mirror response records within the continuous illumination angle range into a mirror response back-cut chain with chain response values and continuous surface element paths, the cross-surface element migration trajectory of the same mirror response quantity during the angle change process is stably maintained, and the duplicate attribution of response quantities caused by bifurcation, merging, and local overlap is avoided. This enhances the continuity, uniqueness, and traceability of mirror response transmission relationships in industrial monitoring scenarios, and provides a reliable chain basis for surface element observation normal vector generation, defect height deviation field solution, and health baseline response value transfer.
[0039] Specifically, the steps for solving the defect height deviation field based on the mirror response back-cutting chain are as follows: Read each chain node according to the surface element number sequence and illumination angle sequence in the mirror response back-cutting chain. The chain node is located by the surface element number, illumination angle, and chain response value of its respective mirror response back-cutting chain. Read the center coordinates of the light-emitting surface corresponding to each illumination angle from the collimating illumination unit installation calibration record. Read the coordinates of the camera optical center in the three-dimensional model coordinate system of the metal detection surface from the camera calibration parameters. Calculate the illumination direction and observation direction based on the center coordinates of the surface elements. For each chain node in the mirror response back-cutting chain, subtract the center coordinates of the surface element from the center coordinates of the collimating illumination unit's light-emitting surface and perform normalization processing to generate the distance from the center of the surface element. The illumination direction unit vector pointing to the collimation illumination unit is generated by subtracting the coordinates of the surface element center from the coordinates of the camera optical center and performing normalization, thus generating the observation direction unit vector pointing from the center of the surface element to the camera optical center. The illumination direction unit vector and the observation direction unit vector are added together and normalized to generate the chain node observation normal vector. When the dot product of the chain node observation normal vector and the corresponding model normal vector is less than zero, the chain node observation normal vector is reversed, so that it faces the outside of the metal detection surface. For multiple chain node observation normal vectors of the same surface element, each chain node observation normal vector is multiplied by the chain response value of its corresponding mirror response tangent chain. The sum of the multiplied vectors is then divided by the sum of the chain response values involved in the calculation, and the calculation results are processed. If normalization is performed, a surface element observation normal vector is generated. When the same surface element has only one chain node observation normal vector, the corresponding chain node observation normal vector is directly determined as the surface element observation normal vector. For each surface element that generates a surface element observation normal vector, the corresponding model normal vector is used as the local normal basis vector. The X-axis direction vector of the 3D model coordinate system of the metal detection surface is projected onto the tangent plane corresponding to the model normal vector and normalized to generate the first tangent basis vector. When the projection length of the tangent plane of the X-axis direction vector is not greater than the vector calculation tolerance, the Y-axis direction vector of the 3D model coordinate system of the metal detection surface is projected onto the tangent plane corresponding to the model normal vector and normalized to generate the first tangent basis vector. The vector calculation tolerance ranges from 10 to the power of -8 to 10 to the power of -10. The sixth power, the specific value is determined based on the repeated calculation error of double-precision floating-point vector projection and normalization processing; the model normal vector and the first tangential basis vector are cross-multiplied and normalized to generate the second tangential basis vector, and the first tangential basis vector, the second tangential basis vector and the model normal vector constitute the local orthogonal coordinate basis of the surface element; the surface element observation normal vector is denoted as n, and the model normal vector is denoted as n0. First, the projection component of the surface element observation normal vector in the direction of the model normal vector is calculated, and then the projection component is subtracted from the surface element observation normal vector to obtain the tangential projection component; the dot product of the surface element observation normal vector and the model normal vector is calculated; when the dot product is greater than the effective lower limit of the normal projection, the tangential projection component is inverted and divided by the corresponding dot product to generate the height deviation gradient vector;When the dot product is not greater than the effective lower limit of the normal projection, the height deviation gradient vector of the current surface element is not generated, and the current surface element and the common edge connected to the current surface element are excluded from the defect height deviation field solution. The effective lower limit of the normal projection is 0.1 to 0.2, and the specific value is determined according to the maximum surface tilt angle allowed to participate in the defect height deviation field solution. The height deviation gradient vector is projected onto the first tangential basis vector and the second tangential basis vector respectively to obtain two local tangential gradient components, and the height deviation gradient vector located in the tangential plane corresponding to the model normal vector is reconstructed according to the two local tangential gradient components. The height deviation value increases along the model normal vector towards the outside of the metal detection surface. The model normal vector decreases in the opposite direction. A defect height deviation greater than zero indicates that the metal detection surface deviates outward relative to the 3D model of the metal detection surface, while a defect height deviation less than zero indicates that the metal detection surface deviates inward relative to the 3D model of the metal detection surface. The edge height deviation increment is generated based on the projection of the average height deviation gradient vector of adjacent surface elements and the center coordinate difference vector of adjacent surface elements onto the tangent plane corresponding to the sum of the model normal vectors of the adjacent surface elements. For each group of adjacent surface elements with a common edge, the two model normal vectors are added and normalized to generate a common normal vector. The plane passing through the midpoint of the center coordinates of the two surface elements and perpendicular to the common normal vector is determined as the common tangent plane. For each surface element, following the ascending order of element numbers, subtract the center coordinates of the smaller-numbered surface element from the center coordinates of the larger-numbered surface element to generate a directed center coordinate difference vector. Subtract the projection component along the common normal vector from this vector to generate a directed center coordinate projection vector within the common tangent plane. Project the height deviation gradient vectors of two adjacent surface elements onto the common tangent plane, and calculate the arithmetic mean of the two projections to generate the average height deviation gradient vector of adjacent surface elements. Perform a dot product between the average height deviation gradient vector of adjacent surface elements and the directed center coordinate projection vector to generate an edge pointing from the smaller-numbered surface element to the larger-numbered surface element. The height deviation increment is denoted as Δhij. When the order of two adjacent surface elements is swapped, the directed center coordinate projection vector is reversed, and the height deviation increment of the reverse edge is determined as -Δhij, so that the height deviation increments of the same common edge in the two directions are opposite numbers. The height deviation value of the reference surface element outside the region is set to zero. The sum of the squares of the differences between the height deviation values of adjacent surface elements and the corresponding edge height deviation increments is used as the objective function. The defect height deviation field is solved by minimizing the objective function. For each candidate abnormal surface element region, the height deviation value of each surface element in the candidate abnormal surface element region is used as the variable to be solved, and the height deviation value of the reference surface element outside the region is fixed to zero.For surface element i with a smaller surface element number and surface element j with a larger surface element number, the difference in height deviation values between the two surface elements is determined as the height deviation value of the surface element with the larger surface element number minus the height deviation value of the surface element with the smaller surface element number. The squared difference between this height deviation value and the edge height deviation increment Δhij is then calculated. The squared differences corresponding to all common edges within the candidate anomaly surface element region and the reference surface element outside the region are collected to form an objective function. Sparse QR decomposition is then used to obtain the height deviation value of each surface element when the objective function is minimized. The candidate anomaly surface element region and the reference surface element outside the region... When multiple connected components are formed, each connected component is solved separately, and at least one outer reference surface element in each connected component is fixed with a height deviation value of zero, so that each connected component has a definite zero height reference. The solution for connected components with unconnected outer reference surface elements is paused, and the effective back-projection pixel count and surface element adjacency relationship of the corresponding surface elements are rechecked. The obtained height deviation value is written into the center coordinates of the corresponding surface element according to the surface element number, generating a defect height deviation field, which provides spatial height basis for the generation of negative height deviation regions, positive height deviation regions, and geometric defect type encoding value sets.
[0040] In this implementation, by converting the normalized mirror response migration relationship under continuous illumination angles in the mirror response back-cut chain into a defect height deviation field with a unified direction and a unified zero height reference, the stable mirror response carried by the chain response value can form a continuous spatial morphological constraint, reducing the interference of single illumination angle, local specular drift and normal estimation fluctuations on the geometric reconstruction results, thereby improving the spatial positioning accuracy, morphological integrity and judgment reliability of the negative height deviation region, positive height deviation region and geometric defect type encoding value set.
[0041] Specifically, the deviation of the unclosed mirror response value and the material response vector from the healthy range is used to form the material angular domain residual vector. The specific steps for fitting the material response primitives and the bearing coefficient are as follows: Read the surface element numbers within the candidate abnormal surface element region according to the candidate abnormal surface element region number, and read the unclosed mirror response value, material response vector, lower limit of the healthy range, and upper limit of the healthy range corresponding to each surface element according to the illumination angle from small to large. The red channel ratio, blue channel ratio, and polarization blanking ratio in the material response vector correspond to the corresponding response fields in the healthy angular domain response benchmark table item by item; for each surface element and illumination within the candidate abnormal surface element region... For each surface element, the components in the material response vector within the corresponding healthy range are set to zero. Components below the lower limit of the healthy range are subtracted from the lower limit, and components above the upper limit are subtracted from the upper limit. These processed components are then combined with the unclosed specular response value to form the material angular domain residual vector. Components below the lower limit retain a negative sign, while those above the upper limit retain a positive sign. For each surface element, the unclosed specular response value, red channel scaling deviation value, blue channel scaling deviation value, and polarization blanking scaling deviation value are arranged in ascending order of illumination angle. The four components at each illumination angle are then sequentially connected to form the corresponding surface element's residual vector. The material corner domain residual vector has four times the number of illumination angles. The material batch number is read from the material traceability tag and bound to the current workpiece when generating the local corner domain response volume. The material defect corner domain response primitive table is established using sample workpieces with the same material batch number and manually verified defect types. The number of samples for each type of material defect is 30 to 80 pieces. The sample workpieces are generated using the same illumination angle sequence, exposure time value, measured irradiance value of the illumination unit, surface element division method, and healthy range deviation processing method as the workpiece to be inspected. For the same material defect type, each sample material... The angular domain residual vector is aligned according to the illumination angle and the order of response components, and the median value is calculated for each component to generate the corresponding material response primitive. The material batch number, response primitive number, material defect type code value, illumination angle sequence, response component order, and material response primitive are associated and written into the material defect angular domain response primitive table. The rust response primitive, oxide spot response primitive, oil film response primitive, and corresponding material defect type code value corresponding to the same material batch number are read from the material defect angular domain response primitive table. The read rust response primitive, oxide spot response primitive, and oil film response primitive only participate in fitting when the illumination angle sequence and response component order are consistent with the current material angular domain residual vector.When no record corresponding to the same material batch number is found in the material defect corner domain response element table, the material response elements corresponding to other material batch numbers are not called. The material response elements and bearing coefficients corresponding to the current surface element are recorded as empty. When generating the joint complex response volume later, only the health baseline response values of each field of the material response vector are retained. After the material response elements are established using defect samples with the same material batch number and written into the material defect corner domain response element table, the fitting is re-executed. For each surface element, the rust response element, oxide spot response element, and oil film response element are set as candidate column vectors respectively. Seven material response elements are established in sequence according to a single material response element, a combination of two material response elements, and a combination of three material response elements. The candidate primitive combination is fitted to the material corner domain residual vector using the active set non-negative least squares method. Each bearing coefficient is restricted to be no less than zero. The objective is to minimize the sum of squared differences between the candidate primitive combination weighted by the bearing coefficients and the material corner domain residual vector. The fitting error is generated by the ratio of the second norm of the fitted residual vector to the second norm of the current material corner domain residual vector. If the second norm of the current material corner domain residual vector is less than 10 to the power of -8, material response primitive fitting is not performed, and the material response primitive and bearing coefficient corresponding to the current surface element are recorded as empty. The allowable value for material reconstruction is between 0.08 and 0.15, with the specific value obtained by fitting the confirmed defect samples in the material defect corner domain response primitive table using the leave-one-out method. The 95th percentile of the fitting error is determined; the effective threshold of the bearing coefficient is taken as the stopping tolerance of the active set non-negative least squares method, and the effective threshold of the bearing coefficient is taken as 10 to the power of -8 to 10 to the power of -6, with the specific value determined based on the double-precision floating-point calculation error and the fluctuation range of the bearing coefficient when the same sample is repeatedly fitted; material response primitives with bearing coefficients greater than the effective threshold of the bearing coefficient are included in the number of response primitives, while material response primitives with bearing coefficients not greater than the effective threshold of the bearing coefficient are not included in the number of response primitives, and the corresponding bearing coefficients are set to zero; the candidate primitive combination with the fewest response primitives is retained from the candidate primitive combination whose fitting error is not greater than the allowable value of material reconstruction; multiple candidate primitive combinations have the same response primitive. When calculating the number of candidate primitives, the candidate primitive combinations with smaller fitting errors and smaller sums of acceptance coefficients are retained sequentially. When the fitting error and the sum of acceptance coefficients are still consistent, the material response primitives in each candidate primitive combination are arranged in ascending order of material defect type coding value, and the candidate primitive combination with the smaller lexicographical order of the material defect type coding value sequence is retained to generate a unique material response primitive and acceptance coefficient. When the fitting error of all seven candidate primitive combinations is greater than the allowable value for material reconstruction, the material response primitive and acceptance coefficient are not retained, and the fitting result corresponding to the current surface element is recorded as empty. When generating the joint complex response volume later, only the health baseline response value of each field of the material response vector is retained, and the current surface element is not written into the material defect type coding value set.The final retained surface element number, response element number, material defect type code value, and bearing coefficient are associated and written into the material response fitting record. This allows the joint complex response volume to read the material response element according to the same surface element number and generate the response changes under the corresponding illumination angle and response components based on the bearing coefficient.
[0042] In this implementation scheme, the deviation directions of the unclosed mirror response value and the material response vector from the healthy range are uniformly organized into a material angular domain residual vector. Sparse fitting is then performed using a material defect angular domain response primitive table. This ensures that the residual response that cannot be explained by mirror migration forms a consistent characterization with material spectral changes and polarization changes within the same illumination angle sequence. This reduces the interference of geometric response residues, health fluctuations, and composite material defects on material defect identification, thereby improving the accuracy, stability, and interpretability of the results of rust response primitives, oxide spot response primitives, and oil film response primitives. This provides a reliable basis for the generation of joint complex response volumes and the determination of the set of material defect type encoding values.
[0043] In this embodiment, a 60mm×40mm×2mm SUS304 metal plate is selected as the workpiece to be inspected. Scratch defect areas and oil film defect areas are set on the metal inspection surface. The scratch defect area extends obliquely along the X-direction of the metal inspection surface, and the oil film defect area is located to one side of the scratch defect area. The metal inspection surface is divided into 12×8 grid units, and each grid unit is further divided into two triangular surface elements along the same diagonal, forming a total of 192 triangular surface elements. Each surface element has a surface element number, surface element center coordinates, model normal vector, and surface element adjacency relationship. Keeping the workpiece position, camera position, and exposure time constant, parallel polarized images and cross-polarized images are acquired sequentially at illumination angles of 15°, 25°, 35°, 45°, 55°, 65°, and 75°. Dark-field images are acquired when the collimating illumination unit is turned off. Based on the workpiece positioning pose, camera calibration parameters, and the 3D model of the metal inspection surface, each image pixel is back-projected onto the corresponding surface element, generating a normalized specular response value and a material response vector. Candidate abnormal surface element regions, reference surface elements outside the regions, and local corner domain response volumes are determined according to the healthy corner domain response reference table. For adjacent illumination angle layers in the local corner domain response volume, the forward and reverse receiving edges are solved separately. Forward and reverse receiving edges with interchanged endpoints are paired to generate bidirectional back-cut specular response records. These records are then connected in ascending order of illumination angle to form specular response back-cut chains. Surface element observation normal vectors are generated based on the chain node observation normal vectors and chain response values corresponding to each specular response back-cut chain. The defect height deviation field is then solved based on the height deviation gradient vectors of adjacent surface elements and the center coordinate difference vectors of adjacent surface elements. The deviation value of the material response vector relative to the healthy range is combined with the unclosed specular response value to form the material corner domain residual vector.
[0044] like Figure 2 As shown, the horizontal and vertical axes represent the X and Y coordinates of surface elements, respectively, while the vertical axis represents the illumination angle. Each discrete height layer corresponds to illumination angles of 15°, 25°, 35°, 45°, 55°, 65°, and 75°. The blue dashed dot chain represents the healthy specular response back-cut chain, maintaining essentially the same surface element positions across illumination angle layers, indicating that the normalized specular response value in the healthy region does not undergo significant cross-element transfer. The orange solid triangular dot chain represents the scratch specular response back-cut chain, continuously connecting different surface elements as the illumination angle changes, indicating that the normalized specular response value in the scratched region forms a cross-element connection between adjacent illumination angle layers. The orange solid contour lines in the XY plane represent the defect height deviation field obtained from the scratch specular response back-cut chain. The orange solid contour lines form a narrow distribution along the scratch extension direction, showing the height deviation range and trend of the scratched region. The green dotted square chain represents the oil film mirror response return chain, with a migration range across surface elements smaller than that of the scratch mirror response return chain. Connecting surface elements with at least one non-zero component in the material corner domain residual vector and sharing a common edge forms a green dashed closed contour. This green dashed closed contour represents the boundary of non-zero surface elements in the material corner domain residual vector, used to display the spatial distribution of the material corner domain residual vector on the metal detection surface.
[0045] Specifically, the steps for generating the joint composite response volume are as follows: Read the surface element numbers corresponding to the candidate abnormal surface element region and the reference surface element outside the region according to the candidate abnormal surface element region number. Establish a data index consistent with the local angular domain response volume according to the candidate abnormal surface element region number, surface element number, illumination angle, and response fields. The response fields sequentially include the normalized specular response value, red channel scale value, blue channel scale value, and polarization blanking scale value. Initialize each data position within the joint composite response volume to zero. Read the health reference response values corresponding to the normalized specular response values of each surface element and each illumination angle from the health angular domain response reference table. Write the health reference response values corresponding to each surface element at the first illumination angle of the illumination angle sequence into the table. The positions of surface elements with the same number in the joint display response volume are used as the starting response values for angle-by-angle transfer. For each illumination angle interval and response output surface element, the health reference response value corresponding to the normalized mirror response value in the health angle domain response reference table is transferred angle-by-angle along the mirror response back-cutting chain according to the proportion of the chain response value of each mirror response back-cutting chain starting from the same response output surface element to the sum of the corresponding chain response values. Health reference response values that do not form a mirror response back-cutting chain are retained in the original surface element. Each illumination angle interval is processed in ascending order of the starting angle value. For each response output surface element in the current illumination angle interval, the chain response value is selected if it is greater than the numerical calculation tolerance, covers the current illumination angle interval, and is within the current illumination angle interval. The algorithm iterates through all mirror response back-cut chains with the current response output element as the chain node, sums all the selected chain response values to generate the sum of the corresponding chain response values for the current response output element within the current illumination angle range. When the sum of the corresponding chain response values exceeds the numerical calculation tolerance, the chain response value of each mirror response back-cut chain is divided by the sum of the corresponding chain response values to generate the transfer ratio of the corresponding mirror response back-cut chain. The sum of all transfer ratios for the same response output element within the same illumination angle range is one. The algorithm then reads the normalized mirror response value corresponding to the response output element within the joint display response body in the current illumination angle layer, multiplies the read normalized mirror response value by the transfer ratio of each mirror response back-cut chain, and calculates the transfer ratio according to the current illumination angle of each mirror response back-cut chain. The receiving surface element number recorded within the interval is used to write the product of each element into the normalized mirror response value position of the corresponding receiving surface element in the joint display response body of the next illumination angle layer. When multiple mirror response back-cut chains reach the same receiving surface element, all the products reaching the same receiving surface element are added together and written into the corresponding normalized mirror response value position. The normalized mirror response value that has completed the transfer is no longer written as an unallocated margin into the surface element with the same number in the next illumination angle layer, so that the normalized mirror response value of the same response output surface element remains consistent in total between adjacent illumination angle layers. When the sum of the corresponding chain response values is not greater than the display response calculation tolerance, the normalized mirror response value corresponding to the response output surface element in the current illumination angle layer is directly written into the surface element with the same number in the next illumination angle layer.The tolerance for the re-enhanced response calculation is taken as one billionth of the maximum value of the healthy baseline response corresponding to the normalized specular response value within the local corner domain response body; when the specular response back-cut chain terminates at the intermediate illumination angle, the normalized specular response values that have been transferred to the termination chain node are retained angle by angle according to the surface elements with the same number; the first illumination angle in the illumination angle sequence only performs the initial response value writing, and the last illumination angle in the illumination angle sequence only receives the normalized specular response value transferred or retained from the previous illumination angle interval, and no further transfer is performed; the healthy baseline response values of each field of the material response vector are retained, and the response changes generated by the retained material response primitives according to the bearing coefficient are superimposed to generate the joint re-enhanced response body; for each table in the candidate abnormal surface element region and the reference surface element outside the region. For each surface element and each illumination angle, the health reference response values corresponding to the red channel scale value, blue channel scale value, and polarization blanking scale value are read from the health angle domain response reference table and written into the corresponding response fields in the joint composite response volume. The final retained material response primitives and their continuation coefficients are read according to the surface element number. The number of components in the material response primitives is four times the number of illumination angles. Each illumination angle corresponds to four consecutive components, which are, in order, the unclosed specular response component, the red channel scale deviation component, the blue channel scale deviation component, and the polarization blanking scale deviation component. The illumination angle sequence in the material response primitives is aligned item by item with the illumination angles in the joint composite response volume, and the four consecutive components are mapped to the normalized specular response. The data positions corresponding to the response value, red channel scale value, blue channel scale value, and polarization blanking scale value are determined. Each component of each material response primitive is multiplied by its corresponding bearing coefficient, and the multiplications corresponding to the same surface element, the same illumination angle, and the same response field are summed to generate the response change of the corresponding response field. The unclosed specular response component and the normalized specular response value are both processed using the normalized response scale after processing the measured irradiance value and exposure time value of the illumination unit. The response change formed by the unclosed specular response component is directly superimposed onto the normalized specular response value at the corresponding position in the joint re-enhanced response body after transfer along the specular response back-cutting chain. The red channel scale deviation component, blue channel scale deviation component, and polarization blanking scale deviation component are respectively correlated with the three components in the material response vector. The proportional values use the same numerical scale. The response changes formed by the three deviation components are superimposed onto the health baseline response values of the three corresponding response fields, without performing inverse normalization or scale conversion. The superimposed normalized mirror response value is set to zero if it is less than zero. The superimposed red channel proportional value, blue channel proportional value, and polarization blanking proportional value are set to zero if they are less than zero, and set to one if they are greater than one. Surface elements that do not retain material response primitives are not superimposed with material response changes; instead, the health baseline response values of each field of the material response vector are used. Finally, all re-display results are written in a fixed order according to the candidate abnormal surface element region number, surface element number, illumination angle, and response field, generating a joint re-display response volume with the same data dimension and item-by-item comparison position as the local angular domain response volume.
[0046] In this implementation scheme, by uniformly replicating the normalized mirror response spatial migration carried by the mirror response back-cutting chain and the material response changes carried by the material response primitives to the same surface element number, illumination angle, and response field position, the jointly replicated response volume can simultaneously retain the response characteristics formed by geometric shape changes and material state changes, and establish a one-to-one correspondence with the local corner domain response volume. This reduces the impact of health baseline response value misalignment, link splitting, and material response superposition deviation on the replication results, thereby providing a complete and comparable data foundation for the calculation of the joint replication closed residual value, the verification of cross-surface element bearing edge replacement, and the verification of zeroing the bearing coefficient of the material response primitives, and improving the reliability of the determination of the geometric defect type coding value set and the material defect type coding value set.
[0047] Specifically, the steps for generating the geometric defect type code value set and the material defect type code value set are as follows: Read the joint complex response volume, local corner domain response volume, upper limit value of the healthy range, and lower limit value of the healthy range according to the candidate abnormal surface element region number. Confirm that the joint complex response volume and the local corner domain response volume use the same surface element numbering order, illumination angle order, and response field order. The response fields sequentially include the normalized specular response value, red channel scale value, blue channel scale value, and polarization blanking scale value. For each surface element, illumination angle, and response field, subtract the lower limit value of the healthy range from the upper limit value of the healthy range to generate the healthy range width value. Repeat the measurement of healthy samples with the same surface element number, the same illumination angle, and the same response field. Three times the standard deviation of the quantity is determined as the effective lower limit of the healthy range width; when the healthy range width value is greater than the effective lower limit of the healthy range width, the corresponding response field is determined as a valid comparison item; when the healthy range width value is not greater than the effective lower limit of the healthy range width, the corresponding response field is determined as an invalid comparison item and is not included in the calculation of the joint re-display closed residual value; when there is no valid comparison item in the candidate abnormal surface element region, the set of geometric defect type coding values and the set of material defect type coding values are set to empty sets, and the diagnosis of the current candidate abnormal surface element region ends; the effective comparison items in the joint re-display response volume and the local corner domain response volume are compared item by item, and the response value in the joint re-display response volume is subtracted from the same surface element number, same illumination angle and the same value in the local corner domain response volume. For measured values under the same response field, the difference is divided by the corresponding healthy range width value and the absolute value is taken. Then, the absolute values of all normalized differences are added together and divided by the number of valid comparison items to generate a joint re-display closure residual value. The allowable value for joint re-display is between 0.08 and 0.15, and is determined by the 95th percentile of the joint re-display closure residual value obtained after joint re-display of confirmed geometric defect samples, confirmed material defect samples, and confirmed composite defect samples. When the joint re-display closure residual value is greater than the allowable value for joint re-display, the replacement of cross-surface element bearing edges and the setting of material response element bearing coefficients to zero are not performed. The set of geometric defect type coding values and the set of material defect type coding values are set to empty sets, and the diagnosis of the current candidate abnormal surface element region ends. When the residual value of the re-display closure is not greater than the allowable value of the joint re-display, the material response primitive and the bearing coefficient remain unchanged. The cross-surface element bearing edge in the mirror response back-cut chain is replaced with the same surface element bearing edge, and the joint re-display closure residual value is recalculated. When replacing, the illumination angle intervals in the mirror response back-cut chain are processed in ascending order. The bearing surface element number of the cross-surface element bearing edge is modified to the corresponding output surface element number, and the modified bearing surface element number is used as the output surface element number of the next illumination angle interval. This continues until the mirror response back-cut chain terminates. The illumination angle interval, chain response value, material response primitive and bearing coefficient remain unchanged. Then, the joint re-display closure residual value is recalculated using the same method of transferring the health baseline response value, superimposing the material response changes and comparing each item.The geometric undo increment threshold is set to 0.10 to 0.25. This threshold is determined by the 5th percentile of the increase in closed residual obtained after replacing the cross-surface element bearing edge of confirmed scratch, dent, and burr samples. When the recalculated closed residual increases by the combined re-enhanced closed residual value to the geometric undo increment threshold, the height deviation of surface elements whose absolute height deviation is not greater than the height calculation tolerance is set to zero. The height calculation tolerance is three times the standard deviation of the height deviation repeatedly calculated from the reference surface elements outside the region, and is limited to the range of 0.01 mm to 0.03 mm. Surface elements with a height deviation less than zero and sharing a common edge are connected to form a negative height deviation region, and surfaces with a height deviation greater than zero and sharing a common edge are connected to form a negative height deviation region. Surface element connections are performed in regions with positive height deviation. During connection, a breadth-first search is performed based on surface element adjacency, and region numbers are generated according to the smallest surface element number within the region. Principal component analysis is performed on the center coordinates of surface elements in regions with negative height deviation. The direction corresponding to the largest eigenvalue of the coordinate covariance matrix is determined as the first principal direction, and the direction corresponding to the second largest eigenvalue is determined as the second principal direction. The center coordinates of each surface element are projected onto the first and second principal directions respectively. The difference between the largest and smallest projected values in the same direction is determined as the projection length of the corresponding principal direction. The effective lower limit of the projection length of the second principal direction is taken as 1% to 5% of the average side length of surface elements in the negative height deviation region. The specific value is determined by repeatedly performing principal component analysis on healthy samples using the second principal direction projection length. When the upper limit of fluctuation is determined, and the projection length of the second principal direction is less than the effective lower limit of the projection length of the second principal direction, the effective lower limit of the projection length of the second principal direction is used in the ratio calculation; when the ratio of the projection length of the first principal direction to the projection length of the second principal direction reaches the lower limit of the scratch length-width ratio, the scratch defect code value is written; the lower limit of the scratch length-width ratio is taken as 4 to 8, and is determined by the 5th percentile of the ratio corresponding to the confirmed scratch sample; negative height deviation areas that have not been written with scratch defect code values and do not contain candidate abnormal surface element boundary surface elements are written with pit defect code values; surface elements in the positive height deviation area whose height deviation value is greater than the height deviation values of all adjacent surface elements in the same positive height deviation area are determined as peak surface elements, where adjacent surface elements are those with the current Surface elements with a common edge and belonging to the same positive height deviation region are identified. Breadth-first search is used to determine the shortest path from the peak element to the boundary element of the positive height deviation region. If multiple shortest paths of the same length exist, they are sorted lexicographically according to the surface element number sequence of each path, and the path with the smallest lexicographical order is selected. The height deviation values of adjacent surface elements within the path are compared sequentially in the direction from the peak element to the region boundary. If the height deviation value of the next surface element is not greater than that of the previous surface element, a burr defect code value is written. The written scratch defect code values, pit defect code values, and burr defect code values are deduplicated and arranged in ascending order of code value to form a set of geometric defect type code values.If the increase in the recalculated closure residual relative to the joint re-emergence closure residual value does not reach the geometric revocation increment threshold, the set of geometric defect type encoding values is set to an empty set; if the joint re-emergence closure residual value is not greater than the joint re-emergence allowable value, the specular response back-cut chain remains unchanged, all material response primitives are set to zero, and the healthy baseline response value corresponding to the normalized specular response value continues to be transferred along the specular response back-cut chain. Each field of the material response vector retains only the healthy baseline response value, and the response changes generated by the material response primitives are no longer superimposed. The joint re-emergence response volume and the joint re-emergence closure residual value are regenerated according to the same surface element number, illumination angle, and response field order; the material revocation increment threshold is set to 0.10 to 0.25, and the material revocation increment threshold is determined by the material response primitives of the confirmed rust samples, confirmed oxide spot samples, and confirmed oil film samples. The 5th percentile value of the increase in the closed residual obtained after setting the coefficient to zero is determined; material response primitives with a bearing coefficient greater than the effective threshold of the bearing coefficient in the material response fitting record are determined as retained material response primitives, and material response primitives with a bearing coefficient not greater than the effective threshold of the bearing coefficient do not participate in the generation of the material defect type coding value set; when the recalculated joint re-emergence closed residual value increases by a factor of 1 to the material withdrawal increment threshold, the material defect type coding values corresponding to the retained rust response primitives, oxide spot response primitives, and oil film response primitives are deduplicated and arranged in ascending order of material defect type coding values to form the material defect type coding value set; when the increase in the recalculated joint re-emergence closed residual value relative to the original joint re-emergence closed residual value does not reach the material withdrawal increment threshold, the material defect type coding value set is set to an empty set.
[0048] In this implementation scheme, by using the joint re-display closed residual value as a unified verification benchmark, and separately examining the necessary contributions of cross-surface element acceptance and material response elements to the re-display results, the response migration caused by geometric morphology and the response changes caused by material state can be independently confirmed within the same candidate abnormal surface element region. This reduces type confusion caused by composite defects, local specular drift, health fluctuations, and single morphological criteria, thereby improving the verifiability, stability, and interpretability of diagnostic results for scratches, dents, burrs, rust, oxide spots, and oil films in industrial monitoring scenarios, and providing clear data basis for the set of geometric defect type coding values and the set of material defect type coding values.
[0049] like Figure 3As shown, a second aspect of the present invention provides an intelligent diagnostic system for industrial visual defects, including an industrial computer, an industrial camera, a collimating illumination unit, an electrically controlled analyzer, an irradiation acquisition device, and a data storage device. The industrial computer is communicatively connected to the industrial camera, the collimating illumination unit, the electrically controlled analyzer, the irradiation acquisition device, and the data storage device. The industrial computer runs an angular domain response construction module, a bidirectional back-cut solution module, a geometric material decoupling module, and a joint complex display diagnostic module. The data storage device is used to store a three-dimensional model of the metal detection surface, a healthy angular domain response benchmark table, a material defect angular domain response primitive table, and intermediate data generated by each module. The intermediate data before the generation of candidate abnormal surface regions is indexed according to the surface element number, illumination angle, and response field. The intermediate data after the generation of candidate abnormal surface regions adds the candidate abnormal surface region number to the corresponding index. The angular domain response construction module controls the industrial camera, collimation illumination unit, and electronically controlled analyzer to acquire multi-angle parallel polarization images, cross-polarization images, and dark-field images. It back-projects image pixels onto surface elements, generating normalized specular response values and material response vectors. Based on the healthy angular domain response benchmark table, it determines candidate abnormal surface element regions and local angular domain response volumes, and writes these volumes to a data storage device. The bidirectional back-cut solution module reads the local angular domain response volumes, solves for the forward and reverse receiving edges of adjacent illumination angle layers, pairs receiving edges with interchanged endpoints, generates bidirectional back-cut specular response records and unclosed specular response values, and connects these records to form a specular response back-cut chain. The geometry-material decoupling module reads the specular response back-cut chain and unclosed specular response values. Based on the mirror response back-cutting chain, the defect height deviation field is solved. The deviation values of the unclosed mirror response value and the material response vector relative to the healthy range are used to form the material angular domain residual vector, and the material response primitive and the bearing coefficient are fitted. The joint display diagnostic module is used to read the mirror response back-cutting chain, the defect height deviation field, the material response primitive and the bearing coefficient. The healthy baseline response value corresponding to the normalized mirror response value is transferred along the mirror response back-cutting chain, and the response change generated by the material response primitive according to the bearing coefficient is superimposed to generate the joint display response volume. The cross-surface element bearing edge is replaced with the same-surface element bearing edge, and the bearing coefficient of the retained material response primitive is set to zero. According to the increase of the closure residual after cancellation relative to the joint display closure residual value, the geometric defect type code value set and the material defect type code value set are generated.The industrial computer performs data processing in the order of corner domain response construction, bidirectional back-cut solution, geometric material decoupling, and joint re-display diagnosis. When there are incompletely written surface element numbers, illumination angles, or response fields in the local corner domain response volume, subsequent processing is paused, and the missing surface element numbers, illumination angles, and response fields are returned. After re-acquiring the corresponding image and updating the local corner domain response volume, subsequent processing continues. After the diagnosis is completed, the candidate abnormal surface element region numbers, geometric defect type code value set, material defect type code value set, and joint re-display closure residual value are sent to the industrial monitoring terminal and written to the data storage device.
[0050] In this implementation scheme, by incorporating multi-angle image acquisition, local angular domain response volume, specular response back-cut chain, defect height deviation field, material response primitives, and joint complex display response volume into a unified data index and sequential processing relationship, the output of each stage can be continuously received at the level of surface element number, illumination angle, and response field. When data is missing, the corresponding acquisition position is returned in a timely manner, reducing the impact of intermediate data misalignment, link interruption, and duplicate calculation on the diagnostic results. This improves the output integrity, processing stability, and result traceability of the geometric defect type coding value set, material defect type coding value set, and joint complex display closed residual value in industrial monitoring scenarios.
[0051] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0052] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. An intelligent diagnostic method for industrial visual defects, characterized in that, Includes the following steps: S1. Acquire multi-angle parallel polarization images, cross-polarization images and dark field images, back-project image pixels onto surface elements, generate normalized specular response values and material response vectors, and determine candidate abnormal surface element regions and local angular domain response volumes based on the healthy angular domain response benchmark table. S2, solve the forward and reverse receiving edges for adjacent lighting angle layers respectively, pair the receiving edges with interchanged endpoints, generate bidirectional back-cut mirror response records and unclosed mirror response values, and connect the bidirectional back-cut mirror response records to form a mirror response back-cut chain. S3, based on the mirror response back-cut chain, solves the defect height deviation field, and forms the material corner domain residual vector by combining the deviation of the unclosed mirror response value and the material response vector relative to the healthy range, and fits the material response primitive and bearing coefficient; S4, transfer the healthy baseline response value corresponding to the normalized mirror response value along the mirror response back tangent chain, and superimpose the response change generated by the material response primitive according to the bearing coefficient to generate a joint complex response body; S5, replace the cross-surface element receiving edge with the same-surface element receiving edge, set the receiving coefficient of the retained material response element to zero, and generate a set of geometric defect type coding values and a set of material defect type coding values based on the increase of the closure residual after cancellation relative to the joint re-manifestation closure residual value.
2. The intelligent diagnostic method for industrial visual defects according to claim 1, characterized in that: The specific steps for acquiring multi-angle parallel polarization images, cross-polarization images, and dark field images, back-projecting image pixels onto surface elements, and generating normalized specular response values and material response vectors are as follows: The workpiece positioning pose value, camera calibration parameters, exposure time value, illumination angle sequence, measured irradiance value of illumination unit and three-dimensional model of metal detection surface are obtained. The three-dimensional model of metal detection surface is divided into surface elements with surface element number, surface element center coordinates, model normal vector and surface element adjacency relationship. Keeping the workpiece position, camera position, and exposure time constant, the collimating illumination unit is turned on sequentially from small to large illumination angles. Parallel polarization images and cross polarization images are acquired at each illumination angle, and dark field images are acquired when the collimating illumination unit is turned off. Based on the workpiece positioning pose value, camera calibration parameters, and three-dimensional model of the metal detection surface, the pixels in the parallel polarization image, cross polarization image, and dark field image are back-projected onto the surface elements; the difference between the parallel polarization brightness value and the cross polarization brightness value is divided by the product of the measured irradiance value of the illumination unit and the exposure time value, and negative values are set to zero to generate a normalized specular response value. Divide the cross-polarized red channel value and blue channel value by the sum of the cross-polarized red, green and blue channel values respectively to generate the red channel ratio value and blue channel ratio value; generate the polarization blanking ratio value according to the ratio of the brightness difference between parallel polarization and cross-polarization to the brightness value of parallel polarization; combine the red channel ratio value, blue channel ratio value and polarization blanking ratio value to form the material response vector.
3. The intelligent diagnostic method for industrial visual defects according to claim 2, characterized in that: The specific steps for determining candidate abnormal surface regions and local corner response volumes based on the healthy corner response benchmark table are as follows: The healthy reference response values and healthy ranges of each surface element, each lighting angle, and each response field under the same workpiece model number and material batch number are read from the healthy corner domain response reference table. Surface elements whose normalized specular response value and each component of the material response vector exceed the corresponding healthy range are identified as abnormal surface elements. Abnormal surface elements with common edges are connected to form candidate abnormal surface element regions. A layer of healthy surface elements with common edges to the boundary surface elements of each candidate abnormal surface element region are identified as reference surface elements outside the region. The normalized specular response values and material response vectors of the candidate abnormal surface element regions and the reference surface elements outside the region are arranged according to the surface element number and lighting angle to generate a local corner domain response volume.
4. The intelligent diagnostic method for industrial visual defects according to claim 3, characterized in that: The specific steps for generating bidirectional back-cut mirror response records and unclosed mirror response values are as follows: For each group of adjacent lighting angle layers in the local corner domain response volume, the surface element of the previous lighting angle layer is set as the response output node, the surface element of the next lighting angle layer is set as the response receiving node, and the response output node is connected to the response receiving node with the same number and a common edge. Set up a response addition node and a response disappearance node, connect the response addition node to each response receiving node, connect each response output node to the response disappearance node, and set the corresponding edge variables to the addition response and disappearance response respectively; Using the normalized mirror response value as the total output and total acceptance of nodes, the sum of the outflow response and the disappearance response of each response output node is equal to the total output, and the sum of the inflow response and the new response of each response acceptance node is equal to the total acceptance. First, the sum of the new response and the disappearance response is minimized, and then the sum of the acceptance response values of the cross-surface element is minimized while the corresponding minimum value remains unchanged, so as to obtain the acceptance response value of each forward acceptance edge. Set the next lighting angle layer as the response output layer and the previous lighting angle layer as the response receiving layer. Obtain the receiving response value of each reverse receiving edge according to the same surface element connection range and solution constraints. Pair the forward receiving edge with the reverse receiving edge with the endpoints interchanged. Determine the smaller receiving response value as the bidirectional back-cut mirror response value. Generate a bidirectional back-cut mirror response record containing the output surface element number, receiving surface element number, lighting angle range and bidirectional back-cut mirror response value. For each surface element and lighting angle, subtract the sum of the inflow response value and the new response value of each receiving edge after deducting the bidirectional back-cut mirror response value, and subtract the sum of the outflow response value and the disappearance response value of each receiving edge to generate an unclosed mirror response value.
5. The intelligent diagnostic method for industrial visual defects according to claim 4, characterized in that: The specific steps for forming the mirror response back-cut chain by connecting the bidirectional back-cut mirror response records are as follows: In ascending order of illumination angle, connect the current bidirectional back-cut mirror response record with the record whose receiving element number is the same as the output element number of the bidirectional back-cut mirror response record in the next illumination angle interval; determine the smallest bidirectional back-cut mirror response value in each connection sequence as the chain response value and deduct it from the corresponding record, repeat the record connection and chain response value deduction until all bidirectional back-cut mirror response values are allocated, and generate a mirror response back-cut chain containing chain response values.
6. The intelligent diagnostic method for industrial visual defects according to claim 5, characterized in that: The specific steps for solving the defect height deviation field based on the mirror response back-cutting chain are as follows: For each node in the mirror response back-cut chain, the unit vector of the illumination direction from the center of the surface element to the collimating illumination unit and the unit vector of the observation direction from the center of the surface element to the optical center of the camera are summed and normalized to generate the observation normal vector of the chain node; for multiple observation normal vectors of the same surface element, the chain node observation normal vector is generated by summing and normalizing the weighted sums according to the chain response values of the mirror response back-cut chain to which it belongs. For each surface element whose observation normal vector is generated, the surface element observation normal vector is projected onto the tangent plane corresponding to the model normal vector to generate a height deviation gradient vector. Based on the projection value of the average height deviation gradient vector of adjacent surface elements and the center coordinate difference vector of adjacent surface elements onto the tangent plane corresponding to the sum of the model normal vectors of adjacent surface elements, an edge height deviation increment value is generated. The height deviation value of the reference surface element outside the region is set to zero. The sum of the squares of the differences between the height deviation values of adjacent surface elements and the corresponding edge height deviation increment value is used as the objective function. The defect height deviation field is solved by minimizing the objective function.
7. The intelligent diagnostic method for industrial visual defects according to claim 6, characterized in that: The specific steps for fitting the material response primitives and bearing coefficients by constructing the material angular domain residual vector from the deviation of the unclosed mirror response value and the material response vector relative to the healthy range are as follows: For each surface element and illumination angle within the candidate abnormal surface element region, the components in the material response vector that are within the corresponding healthy range are set to zero, the components that are below the lower limit of the healthy range are subtracted from the lower limit of the healthy range, and the components that are above the upper limit of the healthy range are subtracted from the upper limit of the healthy range. The processed components are then combined with the unclosed mirror response value to form the material angular domain residual vector. Read the rust response primitives, oxide spot response primitives, oil film response primitives, and corresponding material defect type codes corresponding to the same material batch number from the material defect corner domain response primitive table. Use the non-negative least squares method to fit the material corner domain residual vector. Retain the material response primitives and the minimum number of response primitives with fitting errors not exceeding the allowable value of material reconstruction.
8. The intelligent diagnostic method for industrial visual defects according to claim 7, characterized in that: The specific steps for generating the joint, multifaceted response are as follows: For each lighting angle range and response output surface element, according to the proportion of the chain response value of each mirror response back-cut chain starting from the same response output surface element to the sum of the corresponding chain response values, the health reference response value corresponding to the normalized mirror response value in the health angle domain response reference table is transferred angle by angle along the mirror response back-cut chain. The health reference response value that does not form a mirror response back-cut chain is retained in the original surface element. The healthy baseline response values of each field of the material response vector are retained, and the response changes generated by the retained material response primitives according to the bearing coefficient are superimposed to generate a joint complex response body.
9. The intelligent diagnostic method for industrial visual defects according to claim 8, characterized in that: The specific steps for generating the set of geometric defect type encoding values and the set of material defect type encoding values are as follows: The joint complex response volume and the local corner domain response volume are compared item by item. The difference between each item is divided by the difference between the upper limit and lower limit of the corresponding health range. The arithmetic mean of the normalized absolute values of the difference is calculated to generate the joint complex closed residual value. When the combined re-display closure residual value is not greater than the combined re-display allowable value, the material response primitives and bearing coefficients remain unchanged. The cross-surface bearing edge in the mirror response back-cut chain is replaced with the same-surface bearing edge, and the combined re-display closure residual value is recalculated. When the recalculated closure residual value is increased by the combined re-display closure residual value to the geometric reversal increment threshold, the surface elements with a height deviation value less than zero and a common edge are connected as a negative height deviation region, and the surface elements with a height deviation value greater than zero and a common edge are connected as a positive height deviation region. Principal component analysis is performed on the center coordinates of the face elements within the negative height deviation region. When the ratio of the projection length of the first principal direction to the projection length of the second principal direction of the negative height deviation region reaches the lower limit of the scratch length-to-width ratio, a scratch defect code value is written. For negative height deviation regions that do not have a scratch defect code value written and do not intersect with the boundary of the candidate abnormal face element region, a pit defect code value is written. When there is a peak face element in the positive height deviation region with a height deviation value greater than all adjacent face elements and the height deviation value does not increase in the shortest face element path from the peak face element to the region boundary determined according to the face element adjacency relationship, a burr defect code value is written. The written code values are then combined into a set of geometric defect type code values. When the combined re-display closure residual value is not greater than the combined re-display allowable value, the mirror response back-cut chain remains unchanged, all material response primitives are set to zero and the closure residual is recalculated; when the recalculated combined re-display closure residual value is increased by the original combined re-display closure residual value to the material cancellation increment threshold, the coded values corresponding to the retained rust response primitives, oxide spot response primitives and oil film response primitives are combined to form a set of material defect type coded values.
10. An intelligent diagnostic system for industrial visual defects, characterized in that, include: The module includes a corner domain response construction module, a bidirectional back-cut solution module, a geometry-material decoupling module, and a joint complex display diagnostic module, among which: The corner domain response construction module is used to acquire multi-angle parallel polarization images, cross polarization images and dark field images, back-project image pixels onto surface elements, generate normalized specular response values and material response vectors, and determine candidate abnormal surface element regions and local corner domain response volumes based on the healthy corner domain response benchmark table. The bidirectional back-cut solution module is used to solve the forward and reverse receiving edges for adjacent lighting angle layers respectively, pair the receiving edges with interchanged endpoints, generate bidirectional back-cut mirror response records and unclosed mirror response values, and connect the bidirectional back-cut mirror response records to form a mirror response back-cut chain. The geometric material decoupling module is used to solve the defect height deviation field based on the mirror response back tangent chain, and to form the material corner domain residual vector by combining the deviation values of the unclosed mirror response value and the material response vector relative to the healthy range, and to fit the material response primitive and bearing coefficient. The joint re-display diagnostic module is used to transfer the health baseline response value corresponding to the normalized mirror response value along the mirror response back tangent chain, and superimpose the response changes generated by the material response primitives according to the bearing coefficient to generate a joint re-display response body; and respectively replace the bearing edge of the cross-surface element with the bearing edge of the same-surface element, set the bearing coefficient of the retained material response primitive to zero, and generate a set of geometric defect type coding values and a set of material defect type coding values according to the increase of the closure residual after cancellation relative to the joint re-display closure residual value.
Citation Information
Patent Citations
An industrial defect image pixel-level labeling generation method and device
CN118823780B
A cable state fault prediction method based on multi-source data fusion
CN120974849B