An image enhancement-based surface finish detection system for automotive component production molds
By constructing a pseudo-curvature field for geometrically adaptive brightness correction and a texture orthogonal anisotropic diffusion model, the problems of uneven illumination and texture interference in the surface inspection of complex curved molds are solved, and high-precision weak defect detection and surface roughness calculation are achieved.
Patent Information
- Application Number
- CN202511863212.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-03-17
- Estimated Expiration
- 2045-12-11
AI Technical Summary
Existing machine vision inspection technologies struggle to effectively overcome uneven lighting and texture interference on complex curved surfaces, making it difficult to detect minute defects on mold surfaces and prone to misjudgment.
A pseudo-curvature field is constructed for geometrically adaptive brightness correction. A texture orthogonal anisotropic diffusion model is used to distinguish between textures and scratches. Surface roughness is calculated through a surface metrology module to generate a defect saliency map.
It significantly improves the detection rate of weak defects in deep cavities and corner areas and the accuracy of surface roughness calculation, overcomes the detection difficulties of uneven lighting and texture interference on complex curved surfaces, and ensures the accuracy of detection results.
Smart Images

Figure CN121304674B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial machine vision inspection and image processing technology, specifically to a surface finish inspection system for automotive component production molds based on image enhancement. Background Technology
[0002] In the automotive parts manufacturing industry, the surface finish of the mold directly determines the appearance quality and texture consistency of the molded parts. In order to ensure the process standards of the final product, the roughness and potential micro-defects of the mold surface must be strictly inspected. These molds usually have complex geometric curvature and specific texture design. The evaluation of their surface quality often involves a comprehensive analysis of light reflection characteristics, texture flow direction and micro-morphology, which is a key link to ensure production yield.
[0003] While traditional machine vision inspection methods have been applied in industrial settings, they still have significant limitations when dealing with mold surfaces with complex manifold structures and non-uniform reflective properties. Imaging sensors are susceptible to environmental thermal noise interference, and the geometric curvature of the mold leads to extremely uneven illumination distribution, resulting in a significant decrease in signal contrast in deep cavities or corner areas. Furthermore, existing methods struggle to effectively distinguish between design textures and abnormal scratches, lacking an adaptive enhancement mechanism based on local texture flow and curvature characteristics. This leads to the loss of weak defect signals while suppressing background texture interference, or misjudgments due to a single illumination model. Therefore, overcoming the uneven illumination and texture interference of complex curved surfaces, utilizing the differential geometry of images to construct a detection model that can accurately characterize surface manifolds and roughness, and providing an image enhancement-based system for detecting the surface finish of automotive component production molds are problems that urgently need to be solved by those skilled in the art. Summary of the Invention
[0004] The purpose of this invention is to provide an image enhancement-based system for inspecting the surface finish of automotive component manufacturing molds. This system overcomes the inspection challenges caused by uneven illumination distribution and design texture interference on complex geometric surfaces. It achieves geometrically adaptive brightness correction by constructing a pseudo-curvature field, effectively distinguishes textures from scratches using a texture orthogonal anisotropic diffusion model, and significantly improves the detection rate of weak defects in deep cavities and corner areas, as well as the accuracy of surface roughness calculation. Specifically, the technical solution of this invention is as follows:
[0005] The data acquisition module is used to acquire the original grayscale image of the surface of the automotive part mold; and to perform low-pass filtering on the original grayscale image to eliminate imaging thermal noise.
[0006] The manifold reconstruction module is used to construct a structure tensor field based on the differential geometric properties of the image; the structure tensor field describes the local texture flow direction; and the pseudo curvature field of the mold surface is inferred in reverse based on the eigenvalue distribution of the structure tensor field.
[0007] The adaptive enhancement module is used to perform geometric adaptive brightness correction on the original grayscale image based on the pseudo-curvature field to generate a corrected image; it constructs a texture orthogonal anisotropic diffusion model using the characteristic direction of the structure tensor field; and it generates a texture reconstruction reference map based on the texture orthogonal anisotropic diffusion model.
[0008] The surface metrology module is used to calculate the difference between the corrected image and the texture reconstruction reference image to generate a defect saliency map; based on the statistical characteristics of the background area in the defect saliency map, the surface roughness value of the mold surface is calculated.
[0009] Optionally, the manifold reconstruction module constructs a structure tensor field based on the differential geometry of the image, including:
[0010] Call the image gradient vector of the original grayscale image;
[0011] Calculate the outer product of the image gradient vectors to generate the gradient tensor;
[0012] Using a smoothing kernel of a preset scale, the gradient tensor is convolved to generate a structure tensor field;
[0013] Perform eigenvalue decomposition on the structure tensor field to determine the first and second eigenvectors;
[0014] The first eigenvector corresponds to the direction of maximum gradient change, and the second eigenvector corresponds to the direction of texture flow tangent.
[0015] Optionally, the manifold reconstruction module infers the pseudo-curvature field of the mold surface based on the eigenvalue distribution of the structural tensor field, including:
[0016] Obtain the first and second eigenvalues of the structure tensor field;
[0017] Calculate the ratio of the difference between the first eigenvalue and the second eigenvalue to the sum of the eigenvalues, as the degree of anisotropic distortion in the texture;
[0018] Obtain the local brightness gradient magnitude and the global maximum magnitude within the current detection field of view;
[0019] Based on the degree of anisotropic distortion of the texture, and using the normalized local brightness gradient modulus for illumination modulation compensation, the pseudo curvature field is calculated.
[0020] Optionally, the adaptive enhancement module performs geometric adaptive brightness correction on the original grayscale image based on the pseudo-curvature field to generate a corrected image, including:
[0021] Call the original grayscale image and pseudo curvature field;
[0022] Using a preset curvature sensitivity index, a nonlinear mapping is performed on the pseudo-curvature field to obtain the gain coefficient;
[0023] The original grayscale image is multiplied by the gain coefficient to generate the corrected image;
[0024] The gain coefficient is used to enhance brightness gain in regions with greater curvature.
[0025] Optionally, the adaptive enhancement module utilizes the characteristic orientations of the structure tensor field to construct a texture orthogonal anisotropic diffusion model, generating a texture reconstruction reference map, including:
[0026] Establish partial differential equations;
[0027] The partial differential equation uses time as the evolution variable and the corrected image as the initial state.
[0028] Define the diffusion tensor;
[0029] The diffusion tensor is used to control the smoothing intensity of the corrected image in different directions;
[0030] Introduce a fidelity term into the partial differential equation;
[0031] Among them, the fidelity term allows the evolutionary process to correct minor defects;
[0032] Iteratively solve the partial differential equations until the preset stopping condition is met, and output the texture reconstruction reference image.
[0033] Optionally, the adaptive enhancement module defines the diffusion tensor, including:
[0034] Set the diffusion coefficient along the direction of the second feature vector to a first preset value;
[0035] The first preset value is used to establish a strong smoothing effect to heal scratches that cut the texture;
[0036] Set the diffusion coefficient along the direction of the first feature vector to a second preset value;
[0037] The second preset value is used to establish the inhibition of smoothing effect in order to maintain the clarity of the skin texture ridges;
[0038] A diffusion tensor is constructed based on the first eigenvector, the second eigenvector, the first preset value, and the second preset value.
[0039] Optionally, the surface metrology module calculates the difference between the corrected image and the texture reconstruction reference image to generate a defect saliency map, including:
[0040] Calculate the absolute value of the grayscale difference between the corrected image and the texture reconstruction reference image;
[0041] A curvature weighting function is constructed using a pseudo-curvature field;
[0042] Multiply the absolute value by the curvature weighting function to generate a defect saliency map;
[0043] The curvature weighting function is used to amplify the residual signal in deep cavity or corner regions.
[0044] Optionally, the surface measurement module calculates the surface roughness value of the mold surface based on the statistical characteristics of the background area in the defect saliency map, including:
[0045] Set a defect segmentation threshold;
[0046] The background sampling region is determined in response to the fact that the pixel grayscale value in the defect saliency map is lower than the defect segmentation threshold.
[0047] Defect regions are determined in response to pixel grayscale values being higher than or equal to the defect segmentation threshold.
[0048] Calculate the saliency mean within the background sampling region;
[0049] Calculate the root mean square error between the grayscale value of each pixel within the background sampling area and the saliency mean.
[0050] Subtract the preset system photoelectric noise floor from the mean square error to obtain the net variance;
[0051] The surface roughness value is calculated by taking the square root of the net variance and combining it with the preset photoelectric geometric mapping coefficient.
[0052] Compared with the prior art, the present invention has the following beneficial effects:
[0053] 1. This invention infers the pseudo-curvature field of the mold surface by constructing a structural tensor field, and performs geometrically adaptive brightness correction on the original image accordingly. This method utilizes the anisotropic distortion of the texture to invert the surface geometric curvature, enhancing brightness gain in areas of high curvature. This effectively solves the problem of brightness attenuation caused by illumination angles on complex curved surfaces, achieves illumination equalization, avoids noise amplification in flat areas, and thus significantly improves the imaging quality of deep cavities and corner areas.
[0054] 2. This invention utilizes the characteristic directions of the structural tensor field to construct an orthogonal anisotropic diffusion model of texture and generate a texture reconstruction reference image; the system applies a strong smoothing effect in the direction of texture flow tangency to heal scratches, while applying a suppressive smoothing effect in the direction of maximum gradient change to maintain ridge clarity; this mechanism can accurately preserve the ideal skin texture structure and remove abnormal defects, effectively solving the problem of existing technologies being unable to distinguish between designed textures and abnormal scratches.
[0055] 3. This invention generates a defect saliency map by calculating the difference between the corrected image and the texture reconstruction reference map, and constructs a curvature weighting function using a pseudo-curvature field. This weighting function is specifically designed to amplify the residual signal in deep cavity or corner regions to offset the decrease in imaging signal-to-noise ratio caused by large curvature geometry. This design significantly improves the contrast of weak defect signals and overcomes the technical bottleneck of traditional visual inspection in easily missing small defects in complex geometric structures.
[0056] 4. This invention calculates surface roughness values based on the statistical features of the background region in the defect saliency map; it determines the background sampling area by setting a defect segmentation threshold, calculates its net variance and subtracts the preset system photoelectric noise floor, and then performs inversion by combining the photoelectric geometric mapping coefficients; this method effectively eliminates the interference of inherent thermal noise of the imaging sensor, accurately evaluates the physical roughness of the mold surface by utilizing the statistical characteristics of high-frequency speckle in the background, and ensures the objectivity and accuracy of the detection results. Attached Figure Description
[0057] The present invention will be further explained below with reference to the accompanying drawings and embodiments:
[0058] Figure 1 This is a structural diagram of the system of the present invention. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.
[0060] Example 1:
[0061] Please see Figure 1 A surface finish inspection system for automotive component manufacturing molds based on image enhancement, comprising:
[0062] The data acquisition module is used to acquire the original grayscale image of the surface of the automotive part mold; and to perform low-pass filtering on the original grayscale image to eliminate imaging thermal noise.
[0063] The manifold reconstruction module is used to construct a structure tensor field based on the differential geometric properties of the image; the structure tensor field describes the local texture flow direction; and the pseudo curvature field of the mold surface is inferred in reverse based on the eigenvalue distribution of the structure tensor field.
[0064] The adaptive enhancement module is used to perform geometric adaptive brightness correction on the original grayscale image based on the pseudo-curvature field to generate a corrected image; it constructs a texture orthogonal anisotropic diffusion model using the characteristic direction of the structure tensor field; and it generates a texture reconstruction reference map based on the texture orthogonal anisotropic diffusion model.
[0065] The surface metrology module is used to calculate the difference between the corrected image and the texture reconstruction reference image to generate a defect saliency map; based on the statistical features of the background area in the defect saliency map, the surface roughness value of the mold surface is calculated.
[0066] The manifold reconstruction module constructs a structure tensor field based on the differential geometry of the image, including:
[0067] Call the image gradient vector of the original grayscale image;
[0068] Calculate the outer product of the image gradient vectors to generate the gradient tensor;
[0069] Using a smoothing kernel of a preset scale, the gradient tensor is convolved to generate a structure tensor field;
[0070] Perform eigenvalue decomposition on the structure tensor field to determine the first and second eigenvectors;
[0071] The first eigenvector corresponds to the direction of maximum gradient change, and the second eigenvector corresponds to the direction of texture flow tangent.
[0072] This embodiment acquires high-quality initial data through a data acquisition module; an industrial camera acquires raw grayscale images of the surface of the automotive part mold. The image is a two-dimensional matrix. To ensure that the microscopic texture and geometric undulations of the mold surface can be effectively converted into image grayscale information, the data acquisition module is equipped with a high-resolution industrial camera and a diffuse dome light source or a coaxial light source. During the acquisition process, the angle of the light source is adjusted to form a preset angle with the main texture direction of the mold, such as 45 degrees or 90 degrees, to maximize the texture shadow contrast in the image. Considering the industrial environment and the physical characteristics of the imaging sensor itself, in order to eliminate the inherent thermal noise of the imaging sensor, the data acquisition module processes the original grayscale image... Perform low-pass filtering preprocessing, such as using Gaussian smoothing filtering, to provide a smooth data foundation for subsequent differential calculations;
[0073] The manifold reconstruction module constructs a structure tensor field based on the differential geometry of the image to accurately characterize the local texture flow direction; this process specifically includes the following steps:
[0074] Call the original grayscale image The image gradient vector; for each pixel in the image. Calculate its gradient vector ,in, and These represent the first-order partial derivatives of the image in the horizontal and vertical directions, respectively;
[0075] Calculate the outer product of the image gradient vectors to generate the gradient tensor; for each pixel, calculate... , get one A symmetric matrix that describes the degree and direction of grayscale changes within the pixel neighborhood;
[0076] The gradient tensor is convolved with a smoothing kernel of a preset size to generate a structure tensor field. The calculation formula is as follows:
[0077] ;
[0078] Among them, smooth kernel The scale parameter is selected as Gaussian function; parameters The value of needs to cover the minimum repetition period of the mold texture to ensure smoothing of noise points and extraction of stable main texture flow on the integral scale; in practical applications, The value is typically set between 3 and 7 pixels; in this embodiment, it is preferred. This value can effectively match the texture grain of most automotive interior leather textures;
[0079] For structure tensor fields Perform eigenvalue decomposition to determine the first eigenvector. Second eigenvector ; Decomposing the matrix using linear algebra methods , to obtain eigenvalues and And satisfy ; In the corresponding eigenvectors, the first eigenvector The direction of maximum gradient change is indicated, i.e., the direction perpendicular to the dermal ridge line; the second eigenvector. Indicate the direction of the texture flow tangent, that is, the direction along which the texture extends; this step effectively establishes the first basic form describing the local metric of the manifold, providing a directional reference for subsequent anisotropic processing.
[0080] Example 2:
[0081] The manifold reconstruction module infers the pseudo-curvature field of the mold surface based on the eigenvalue distribution of the structural tensor field, including:
[0082] Obtain the first and second eigenvalues of the structure tensor field;
[0083] Calculate the ratio of the difference between the first eigenvalue and the second eigenvalue to the sum of the eigenvalues, as the degree of anisotropic distortion in the texture;
[0084] Obtain the local brightness gradient magnitude and the global maximum magnitude within the current detection field of view;
[0085] Based on the degree of anisotropic distortion of the texture, and using the normalized local brightness gradient modulus for illumination modulation compensation, the pseudo curvature field is calculated.
[0086] After constructing the structure tensor field, the manifold reconstruction module further infers the pseudo-curvature field of the mold surface based on the eigenvalue distribution of the structure tensor field. This step utilizes the degree of anisotropic distortion of texture on the image plane to invert the geometric curvature of the surface; the specific implementation steps are as follows:
[0087] Obtain the first eigenvalue of the structure tensor field Second eigenvalue ;
[0088] Define the original grayscale image The image after low-pass filtering is the brightness field. ,Right now ;
[0089] The ratio of the second eigenvalue to the total energy is used to characterize the geometric rotation feature, and the normalized inverse ratio of the brightness field is used to characterize the degree of illumination attenuation.
[0090] Get the current brightness field At pixel Local brightness value at With global maximum brightness value ;
[0091] It should be noted that the pseudo-curvature field calculated here is not the physical three-dimensional spatial curvature, but rather an equivalent image domain parameter inferred from the image's gray-level distribution characteristics, capable of characterizing the degree of visual geometric curvature; the pseudo-curvature field is calculated based on geometric rotation features and the degree of illumination attenuation. Its mathematical model is as follows:
[0092] ;
[0093] in, To prevent tiny quantities with a denominator of zero; the first term utilizes The saliency detection of the inflection point of texture flow, i.e., the high curvature corner point, when An increase indicates the presence of geometric curvature; the second term uses the inverse ratio of brightness to compensate for the dark areas in the imaging of the deep cavity region; and This is a non-negative weighting coefficient; to balance the weights of geometric deformation detection and illumination compensation, this embodiment sets... In other embodiments, the degree of curvature change of the mold surface can be adjusted accordingly. to Adjust the above coefficients within the range.
[0094] Example 3:
[0095] The adaptive enhancement module performs geometric adaptive brightness correction on the original grayscale image based on the pseudo-curvature field, generating a corrected image, including:
[0096] Call the original grayscale image and pseudo curvature field;
[0097] Using a preset curvature sensitivity index, a nonlinear mapping is performed on the pseudo-curvature field to obtain the gain coefficient;
[0098] The original grayscale image is multiplied by the gain coefficient to generate the corrected image;
[0099] The gain coefficient is used to enhance brightness gain in regions with greater curvature.
[0100] The adaptive enhancement module is based on the solved pseudo-curvature field For the original grayscale image Perform geometric adaptive brightness correction to generate a corrected image. Specifically, calling the original grayscale image. and pseudo-curvature field ;
[0101] Using the preset curvature sensitivity index For example, with a value ranging from 0.5 to 2.0, a nonlinear mapping is performed on the pseudo-curvature field to obtain the gain coefficient. The mapping relationship is defined as follows: Among them, due to the revised The value is larger in deep cavity dark areas or large curvature corners. This mapping relationship can ensure that a gain coefficient greater than 1 is generated in these areas, thereby improving local brightness.
[0102] For illumination compensation intensity, this parameter is adaptively adjusted by the global contrast of the image: the global root mean square contrast of the original image is calculated. The calculation formula is as follows:
[0103]
[0104] in, The dimensions of the image are its length and width. Set the image grayscale mean; ,in, This is a preset compensation reference constant; its value range is typically [value range missing]. In this embodiment, This enables the automatic application of stronger enhancement effects under low-contrast imaging conditions.
[0105] Original grayscale image With gain coefficient Pixel-by-pixel multiplication generates a corrected image. ;Right now By enhancing the brightness gain in areas with greater curvature through this gain coefficient, noise in flat areas can be effectively avoided from being amplified, while compensating for the brightness attenuation caused by the illumination angle in areas with greater curvature, thus achieving illumination equalization.
[0106] Example 4:
[0107] The adaptive enhancement module utilizes the characteristic orientations of the structure tensor field to construct an orthogonal anisotropic diffusion model for texture, generating a texture reconstruction reference map, including:
[0108] Establish partial differential equations;
[0109] The partial differential equation uses time as the evolution variable and the corrected image as the initial state.
[0110] Define the diffusion tensor;
[0111] The diffusion tensor is used to control the smoothing intensity of the corrected image in different directions;
[0112] Introduce a fidelity term into the partial differential equation;
[0113] Among them, the fidelity term allows the evolutionary process to correct minor defects;
[0114] Iteratively solve the partial differential equations until the preset stopping condition is met, and output the texture reconstruction reference image;
[0115] The adaptive enhancement module defines the diffusion tensor, including:
[0116] Set the diffusion coefficient along the direction of the second feature vector to a first preset value;
[0117] The first preset value is used to establish a strong smoothing effect to heal scratches that cut the texture;
[0118] Set the diffusion coefficient along the direction of the first feature vector to a second preset value;
[0119] The second preset value is used to establish the inhibition of smoothing effect in order to maintain the clarity of the skin texture ridges;
[0120] A diffusion tensor is constructed based on the first eigenvector, the second eigenvector, the first preset value, and the second preset value.
[0121] The adaptive enhancement module utilizes the characteristic orientations of the structure tensor field to construct an orthogonal anisotropic diffusion model for texture to generate a texture reconstruction reference image. This process is achieved by solving partial differential equations, specifically including:
[0122] Establish a partial differential equation; this equation is expressed in terms of time. As evolutionary variables, to correct the image The initial state, i.e. The equation is in the following form:
[0123]
[0124] Here, the diffusion tensor needs to be defined. To control the smoothing intensity of the corrected image in different directions; diffusion tensor Feature vectors based on structure tensor and The construction, its expression is:
[0125]
[0126] During this construction process, the local texture coherence index is calculated. ;
[0127] The dynamic diffusion coefficient is defined based on the coherence index:
[0128] Set along the second feature vector Diffusion coefficient along the texture tangent direction :
[0129]
[0130] Set along the first feature vector diffusion coefficient in the gradient direction :
[0131]
[0132] in, This is a preset coherence threshold, for example, 0.5. For isotropic diffusion factors, such as 0.8, This is a minimum value, such as 0.01;
[0133] This logic ensures that in areas with clear textures ( Strong anisotropic diffusion is used to connect fracture textures and protect ridge lines; while in flat or noisy areas ( The diffusion is degenerated into isotropic diffusion to avoid artificially creating erroneous stripe structures in the background noise; finally, the diffusion tensor is constructed based on the above coefficients. ;
[0134] Furthermore, a fidelity term is introduced into the partial differential equation. Considering the diffusion term It contains a second-order spatial differential operator, which physically introduces the inverse square dimension of the spatial scale; therefore, the coefficients of the fidelity term... It needs to be defined as a coupling factor that includes spatial scale compensation, with the dimension being the reciprocal square of the length ( To balance the dimensional differences between diffusion smoothing and the fidelity of the original data; The value is usually set to a small value; a specific range of values is recommended. to The value is a dimensionless parameter set based on the image pixel grid scale. If the image resolution changes by an order of magnitude, this parameter needs to be scaled proportionally. This embodiment sets... This allows the evolutionary process to correct minor defects, meaning it allows the generation of reference diagrams. The defect point deviates from the original corrected image. ;
[0135] Specifically, this embodiment uses the explicit finite difference method to discretize the partial differential equation and construct an iterative evolution formula: ;in, For the number of iterations, The time step must satisfy the numerical stability condition of CFL, for example, taking... To ensure the convergence of the evolution process, the partial differential equation is solved iteratively using numerical methods until a preset stopping condition is met, such as reaching a preset number of iterations or the image change rate falling below a threshold. The output image at this point serves as the texture reconstruction reference image. The reference image retains the ideal texture structure while removing scratches that are orthogonal to the texture.
[0136] Example 5:
[0137] The surface metrology module calculates the difference between the corrected image and the texture reconstruction reference image, generating a defect saliency map, including:
[0138] Calculate the absolute value of the grayscale difference between the corrected image and the texture reconstruction reference image;
[0139] A curvature weighting function is constructed using a pseudo-curvature field;
[0140] Multiply the absolute value by the curvature weighting function to generate a defect saliency map;
[0141] The curvature weighting function is used to amplify the residual signal in deep cavity or corner regions.
[0142] Surface metrology module calculates and corrects images Reference image for texture reconstruction The differences between them generate a defect saliency map. ;because Includes texture and defects, while Only the texture is included; the difference between the two represents the defect signal.
[0143] The calculation process is as follows: Calculate the corrected image. Reference image for texture reconstruction The absolute value of the grayscale difference; for the pseudo-curvature field Amplitude truncation is performed to limit its numerical range to... Within the interval, for example To prevent numerical overflow in subsequent exponential calculations; using a pseudo-curvature field. Constructing curvature weighted functions The function is defined as ,in, This is the curvature gain factor; its value needs to be adjusted according to the dynamic range of the imaging system, and is usually set between 0.8 and 1.5; in this embodiment, it is preferably set to... This value can effectively improve the contrast of weak defect signals at the corners of deep cavities without causing an exponential amplification of background noise.
[0144] Multiply the absolute value by the curvature weighting function to generate a defect significance map. Its formula is:
[0145]
[0146] The curvature weighting function amplifies the residual signal in deep cavity or corner regions to offset the decrease in imaging signal-to-noise ratio caused by large curvature geometry, thereby improving the detection rate of weak defects.
[0147] Example 6:
[0148] The surface measurement module calculates the surface roughness value of the mold surface based on the statistical characteristics of the background area in the defect saliency map, including:
[0149] Set a defect segmentation threshold;
[0150] The background sampling region is determined in response to the fact that the pixel grayscale value in the defect saliency map is lower than the defect segmentation threshold.
[0151] Defect regions are determined in response to pixel grayscale values being higher than or equal to the defect segmentation threshold.
[0152] Calculate the saliency mean within the background sampling region;
[0153] Calculate the root mean square error between the grayscale value of each pixel within the background sampling area and the saliency mean.
[0154] Subtract the preset system photoelectric noise floor from the mean square error to obtain the net variance;
[0155] The surface roughness value is calculated by taking the square root of the net variance and combining it with the preset photoelectric geometric mapping coefficient.
[0156] Surface measurement module based on defect saliency map Statistical characteristics of the background region are used to calculate the surface roughness value of the mold surface. ;
[0157] Set defect segmentation threshold This threshold can be determined based on the histogram statistical properties of the saliency plot; specifically, the 3-Sigma statistical criterion is used to determine the threshold: calculate the defect saliency plot. global mean and global standard deviation Set the defect segmentation threshold as It should be noted that if the histogram distribution of the defect saliency map does not conform to the normal distribution characteristics (e.g., exhibits a bimodal distribution), the Otsu's maximum inter-class variance method can be used to adaptively calculate the defect segmentation threshold. To ensure effective separation of background and defects;
[0158] Therefore, highly significant regions that deviate from the background statistical distribution are identified as defects; in response to pixels in the defect saliency map having a gray value higher than or equal to the defect segmentation threshold. This area is identified as a defect region and is not included in roughness calculation; this is in response to a pixel grayscale value falling below the defect segmentation threshold. This part was identified as the background sampling area. ; Calculate the saliency mean within the background sampling region Its formula is:
[0159]
[0160] in, The total number of pixels in the background sampling area; calculate the root mean square error between the grayscale value of each pixel in the background sampling area and the mean saliency value. :
[0161]
[0162] From the mean squared error Subtract the preset system photoelectric noise substrate The net variance was obtained; the system photoelectric noise floor was measured. It is a constant obtained by converting the residual noise variance of the camera when shooting an ideal mirror surface, and the calibration process of this constant must be carried out under the same camera exposure time, gain and aperture coefficient as the actual mold inspection, representing the inherent energy noise floor of the imaging system.
[0163] The net standard deviation is obtained by taking the square root of the net variance. This takes into account the actual calculation process. It may be smaller than due to over-smoothing Introducing nonnegativity constraint operations, combined with preset photoelectric geometric mapping coefficients The surface roughness value is calculated. :
[0164]
[0165] in, The function is used to ensure that the radicand is non-negative. When the background variance is less than the system noise floor, the roughness is determined to be 0.
[0166] Regarding photoelectric geometric mapping coefficients To determine the accuracy, this embodiment employs the following calibration method: A set of standard color plates with known surface roughness values are selected as calibration samples. These standard color plates must be made of the same or similar metal material as the automotive component mold to be tested, such as P20 mold steel or 7-series aluminum alloy, to eliminate the influence of differences in the bidirectional reflectance distribution function (BRDF) of the materials on the mapping accuracy. The net variance in the system is calculated and squared to obtain the net standard deviation. The net standard deviation, i.e., the root mean square roughness characterizing the optical statistical properties, is established through linear regression analysis. ,Right now Arithmetic mean roughness as defined by industry standards The mapping relationship between them is used to determine the coefficients. The specific values; through this method, the system can indirectly invert the roughness of the physical surface by utilizing the amplitude variation of the high-frequency speckle statistical characteristics of the background region.
[0167] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. An image-enhancement-based automotive component production mold surface finish detection system, characterized by, The method comprises the following steps: a data acquisition module is used to acquire an original gray image of a surface of a mold for an automobile part; the original gray image is subjected to low-pass filtering to eliminate imaging thermal noise; a manifold reconstruction module is used to construct a structure tensor field based on differential geometric characteristics of the image; the structure tensor field describes local texture flow direction; based on eigenvalue distribution of the structure tensor field, a pseudo-curvature field of the surface of the mold is inversely deduced; an adaptive enhancement module is used to perform geometric adaptive brightness correction on the original gray image according to the pseudo-curvature field to generate a corrected image; a texture orthogonal anisotropic diffusion model is constructed using a characteristic direction of the structure tensor field; based on the texture orthogonal anisotropic diffusion model, a texture reconstruction reference image is generated; a surface measurement module is used to calculate differences between the corrected image and the texture reconstruction reference image to generate a defect saliency map; based on statistical characteristics of a background region in the defect saliency map, a surface roughness value of the surface of the mold is calculated. The manifold reconstruction module constructs the structure tensor field based on the differential geometric characteristics of the image, comprising: an image gradient vector of the original gray image is called; an outer product of the image gradient vector is calculated to generate a gradient tensor; the gradient tensor is subjected to convolution operation using a smoothing kernel of a preset scale to generate the structure tensor field; the structure tensor field is subjected to characteristic decomposition to determine a first characteristic vector and a second characteristic vector; the first characteristic vector corresponds to a maximum change direction of the gradient, and the second characteristic vector corresponds to a tangent direction of the texture flow; The manifold reconstruction module inversely deduces the pseudo-curvature field of the surface of the mold according to the eigenvalue distribution of the structure tensor field, comprising: first and second eigenvalues of the structure tensor field are obtained; a ratio of a difference value and a sum value of the first and second eigenvalues is calculated as a texture anisotropic distortion degree; a local brightness gradient module length in a current detection field of view and a global maximum module length are obtained; based on the texture anisotropic distortion degree and using the normalized local brightness gradient module length for illumination modulation compensation, the pseudo-curvature field is calculated.
2. The image enhancement based surface finish detection system for automotive component production mold as claimed in claim 1 wherein, The adaptive enhancement module performs geometric adaptive brightness correction on the original gray image according to the pseudo-curvature field to generate the corrected image, comprising: the original gray image and the pseudo-curvature field are called; a preset curvature sensitivity index is used to perform nonlinear mapping on the pseudo-curvature field to obtain a gain coefficient; the original gray image is multiplied by the gain coefficient to generate the corrected image; the gain coefficient is used to enhance brightness gain in a region with large curvature.
3. The image enhancement based surface finish detection system for automotive component production mold as claimed in claim 1 wherein, The adaptive enhancement module constructs the texture orthogonal anisotropic diffusion model using the characteristic direction of the structure tensor field to generate the texture reconstruction reference image, comprising: a partial differential equation is established; the partial differential equation takes time as an evolution variable and takes the corrected image as an initial state; a diffusion tensor is defined; the diffusion tensor is used to control smoothing strength of the corrected image in different directions; a fidelity term is introduced into the partial differential equation; the fidelity term allows the evolution process to correct small defects; the partial differential equation is iteratively solved until a preset stop condition is reached, and the texture reconstruction reference image is output.
4. The image enhancement based surface finish detection system for automotive component production mold according to claim 3, wherein, The adaptive enhancement module defines the diffusion tensor, comprising: a diffusion coefficient along the second characteristic vector direction is set as a first preset value; The first preset value is used to establish strong smoothing effect to heal the scratch of the cut texture; The diffusion coefficient along the direction of the first feature vector is set as a second preset value; The second preset value is used to establish inhibitory smoothing effect to maintain the clarity of the ridge line of the skin texture; Based on the first feature vector, the second feature vector, the first preset value and the second preset value, a diffusion tensor is constructed.
5. The image enhancement based surface finish detection system for automotive component production mold as claimed in claim 1 wherein, The surface metrology module calculates the difference between the corrected image and the texture reconstruction reference image to generate a defect saliency map, including: The absolute value of the gray difference between the corrected image and the texture reconstruction reference image is calculated; A curvature weighting function is constructed using the pseudo-curvature field; The absolute value is multiplied by the curvature weighting function to generate the defect saliency map; The curvature weighting function is used to amplify the residual signal in the deep cavity or corner area.
6. The image enhancement based surface finish detection system for automotive component production mold according to claim 5, wherein, The surface metrology module calculates the surface roughness value of the mold surface based on the background area statistical characteristics in the defect saliency map, including: A defect segmentation threshold is set; In response to the pixel gray value in the defect saliency map being lower than the defect segmentation threshold, a background sampling area is determined; In response to the pixel gray value being higher than or equal to the defect segmentation threshold, a defect area is determined; The saliency mean value in the background sampling area is calculated; The mean square error of each pixel gray value and the saliency mean value in the background sampling area is calculated; The preset system photoelectric noise floor is subtracted from the mean square error to obtain a net variance; The square root operation is performed on the net variance, and the preset photoelectric geometric mapping coefficient is combined to calculate the surface roughness value.
Citation Information
Patent Citations
Building facade defect intelligent detection method
CN119887763A
Tablet computer image super-resolution enhancement method based on generative adversarial network
CN120580139A