A machine vision-based precision mold defect intelligent detection method and system

By using local variance adaptive gamma correction and multi-scale texture structure tensor processing, combined with curl coherence enhancement and iso-illuminance line curvature constraint, the problem of distinguishing polished texture from shallow scratches in the inspection of glossy surface molds is solved, achieving high-precision defect identification and evaluation.

CN122368041APending Publication Date: 2026-07-10JIANGSU UNITED LEADING TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGSU UNITED LEADING TECH CO LTD
Filing Date
2026-05-27
Publication Date
2026-07-10

Smart Images

  • Figure CN122368041A_ABST
    Figure CN122368041A_ABST
Patent Text Reader

Abstract

This invention discloses a machine vision-based intelligent detection method and system for precision mold defects, belonging to the field of image detection technology. The machine vision-based intelligent detection method for precision mold defects acquires a grayscale image of the mold surface to be inspected, obtains an enhanced mold image through adaptive gamma correction, presets multiple Gaussian smoothing scales for this image, calculates the texture structure tensor for each scale, generates a texture direction field through dual-angle mapping, and performs curl coherence enhancement in conjunction with the texture direction field to obtain a mold curl response map. An iso-illuminance line curvature map is constructed and jointly constrained with the curl response map to obtain a mold defect response map. This map is then subjected to scale-space adaptive fusion to generate a comprehensive mold defect response map. This invention uses the comprehensive mold defect response map to statistically evaluate mold defects and performs intelligent defect detection processing on the mold to be inspected, thereby accurately distinguishing between polished textures and shallow scratches on high-gloss curved surface molds, thus improving detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image detection technology, specifically to a machine vision-based intelligent detection method and system for precision mold defects. Background Technology

[0002] Precision molds are core equipment for manufacturing high-end products such as optical lenses, mobile phone frames, and medical devices. Their surface quality directly determines the yield of injection-molded or die-cast products. As products develop towards high gloss, curved surfaces, and miniaturization, the surface of the mold cavity usually needs to be precision polished to achieve mirror-level smoothness.

[0003] However, during the polishing process, due to the shedding of tool particles or uneven pressure, micron-level shallow scratches are easily generated. Their visual appearance is very similar to the polishing texture. Both the polishing texture and the shallow scratches appear as fine line structures in the image, with similar grayscale contrast. This makes it very easy to misjudge normal textures as defects, resulting in a very high false positive rate, or to miss the detection of real scratches with extremely low contrast. If such defects are not detected, they will be directly copied to the product surface, leading to batch scrapping.

[0004] Existing technology, such as the method and system for mold defect detection based on machine vision disclosed in patent application CN121073881A, involves the following steps: acquiring raw image data of the mold surface; preprocessing the raw image data to obtain target image data; extracting features and optimizing boundaries in the target image data to generate a structured defect feature dataset; screening and quantifying key features in the structured defect feature dataset to obtain quantified evaluation data; classifying defects using the quantified evaluation data in conjunction with a confidence assessment system to obtain defect classification results; comparing the defect classification results with preset standard matching rules; dynamically adjusting detection parameters; and outputting the final defect detection result. This method improves defect detection accuracy and efficiency, adapting to the needs of industrial scenarios.

[0005] Based on the above findings, the limitations of existing technologies include at least the following problems: When performing defect detection on high-gloss curved surface molds, existing technologies fail to establish a refined description of the unique process texture structure on the mold surface. Although multi-light angle acquisition and confidence assessment systems are used to attempt to improve detection accuracy, the multi-scale features extracted by the deep learning network can only represent general texture information. Combined with the processing method of filling boundary gaps using morphological closing operations, it is difficult to accurately distinguish the normal features of polished textures that are continuous in direction, naturally curved, and have regular gray-scale variation, from the defect features of micron-level shallow scratches that are random in direction, straight in path, and cut off the continuity of texture. When the arc-shaped edge of the polished texture and the approximately straight edge of the shallow scratch appear on the high-gloss curved surface at the same time, the uneven illumination of the curved surface itself will cause drastic fluctuations in local contrast, causing the feature response output by the network to confuse regular curved structures with random fracture structures, directly misjudging the edge of the polished texture as a defect. At the same time, the real shallow scratches are difficult to effectively identify due to the weak feature response, ultimately resulting in a decrease in the accuracy of precision mold surface quality assessment. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a machine vision-based intelligent detection method and system for precision mold defects, which solves the problem that existing technologies have difficulty distinguishing between polished textures and shallow scratches on high-gloss curved molds, easily leading to low detection accuracy.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a machine vision-based intelligent detection method for precision mold defects, comprising the following steps: acquiring a grayscale image of the mold surface to be inspected, and performing adaptive gamma correction based on local variance to obtain an enhanced mold image; for the enhanced mold image, presetting multiple different Gaussian smoothing scales, calculating the corresponding texture structure tensor for each scale, and generating a texture orientation field for each scale through dual-angle mapping; based on the texture orientation field and the texture structure tensor, performing orientation field curl coherence enhancement processing to obtain a mold curl response map for each scale; based on the enhanced mold image, constructing an iso-illuminance line curvature map, and performing joint constraint processing with the curl response maps for each scale to obtain a mold defect response map for each scale; performing scale-space adaptive fusion processing on the mold defect response map to generate a comprehensive mold defect response map; based on the comprehensive mold defect response map, statistically analyzing the mold defect evaluation value, and performing intelligent defect detection processing on the mold to be inspected.

[0008] Further, the specific steps for obtaining the mold enhancement image are as follows: perform median filtering on the grayscale image of the mold surface and extract the local grayscale variance map; determine the upper limit threshold of the variance of the local grayscale variance map and perform local variance-driven gamma mapping processing with the local grayscale variance map to determine the gamma coefficient set; based on the gamma coefficient set, perform pixel-by-pixel power-law transformation on the grayscale image of the mold surface to obtain the mold enhancement image.

[0009] Further, the specific steps for calculating the corresponding texture structure tensor at each scale are as follows: For the mold enhancement image, the gradient component set and gradient magnitude set are calculated using a first-order gradient operator; the gradient component set is subjected to gradient autocorrelation mapping to generate a gradient second moment map set; based on the gradient magnitude set, a local contrast weight map is constructed, and the gradient second moment map set is subjected to local contrast-guided modulation processing to generate a modulated gradient second moment map set; based on each preset Gaussian smoothing scale, the modulated gradient second moment map set is smoothed to obtain the texture structure tensor at each scale.

[0010] Furthermore, the specific steps for generating texture orientation fields at various scales through dual-angle mapping are as follows: Based on the texture structure tensor, extract the smooth component set and calculate the pixel normalization factor set; based on the pixel normalization factor set, perform normalization combination transformation on the smooth component set to generate a first mapping component set and a second mapping component set; based on the first mapping component set and the second mapping component set, construct the texture orientation fields at various scales.

[0011] Further, the specific steps to obtain the mold curl response map at each scale are as follows: Based on the texture direction field, the curl scalar set at each scale is calculated using the spatial difference method; based on the texture structure tensor, the feature set is obtained through eigenvalue decomposition, and the directional coherence coefficient set at each scale is constructed; the curl scalar set and the directional coherence coefficient set are subjected to synergistic enhancement processing to obtain the mold curl response map at each scale.

[0012] Further, the specific steps for constructing the iso-illuminance line curvature map are as follows: perform micro-scale Gaussian smoothing on the mold enhancement image and calculate the first-order gradient component and the second-order gradient component; determine the iso-illuminance line curvature value based on the first-order gradient component and the second-order gradient component; construct the iso-illuminance line curvature map based on the iso-illuminance line curvature value.

[0013] Further, the specific steps to obtain the mold defect response map at each scale are as follows: read the curvature value of the iso-illuminance line from the iso-illuminance line curvature map; construct an exponential decay weight set based on a preset regularization coefficient and in combination with the curvature value of the iso-illuminance line; perform pixel-by-pixel constraint processing on the exponential decay weight set and the curl response map to obtain the mold defect response map at each scale.

[0014] Further, the specific steps for generating a comprehensive mold defect response map are as follows: Based on the mold defect response map, determine the local confidence score of its corresponding scale and sort it to generate a confidence ranking feature set; based on the confidence ranking feature set, generate a fusion judgment set; if the fusion judgment set satisfies a preset first constraint condition, perform single-scale dominant response extraction processing on the mold defect response map to generate a comprehensive mold defect response map; if the fusion judgment set satisfies a preset second constraint condition, perform multi-scale balanced response fusion processing on the mold defect response map to generate a comprehensive mold defect response map.

[0015] Furthermore, the specific steps for calculating the mold defect evaluation value are as follows: local extreme point detection is performed on the comprehensive mold defect response map to generate several candidate defect seed points; starting from the candidate defect seed points, response gradient region growth processing is performed to obtain several candidate defect regions; for the candidate defect regions, the region area and the region defect significance value are calculated respectively, and defect aggregation processing is performed to generate the mold defect evaluation value.

[0016] A precision mold defect intelligent detection system based on machine vision includes: an image acquisition and enhancement unit, used to acquire grayscale images of the mold surface of the mold to be inspected, and perform adaptive gamma correction based on local variance to obtain an enhanced mold image;

[0017] A multi-scale texture analysis unit is used to pre-set multiple different Gaussian smoothing scales for the mold enhancement image, calculate the corresponding texture structure tensor for each scale, and generate the texture direction field for each scale through dual angle mapping; a curl enhancement processing unit is used to perform direction field curl coherence enhancement processing based on the texture direction field and the texture structure tensor to obtain the mold curl response map at each scale; a curvature constraint filtering unit is used to construct an iso-illuminance line curvature map based on the mold enhancement image, and perform joint constraint processing with the curl response map at each scale to obtain the mold defect response map at each scale; an adaptive fusion unit is used to perform scale-space adaptive fusion processing on the mold defect response map to generate a comprehensive mold defect response map; a defect evaluation and detection unit is used to statistically evaluate the mold defect value based on the comprehensive mold defect response map and perform intelligent defect detection processing on the mold to be inspected.

[0018] The present invention has the following beneficial effects:

[0019] (1) The machine vision-based intelligent detection method for precision mold defects uses adaptive gamma correction based on local variance to process the grayscale image of the mold surface. This method can effectively improve the problem of abnormal grayscale distribution caused by uneven illumination on the glossy surface. After obtaining the original grayscale image of the mold surface, the image noise is removed by median filtering, and then the local grayscale variance map is extracted. The gamma coefficient is adaptively calculated based on the upper limit threshold of the variance. Finally, the enhanced image is obtained by pixel-by-pixel power law transformation. The enhancement amplitude is dynamically adjusted according to the grayscale change of each region. This can reduce the overly bright pixels in the high-gloss reflection area and improve the detail performance in the dark area, making the boundary between the micron-level shallow scratches and the polishing texture clearer. This better adapts to the imaging characteristics of the glossy surface mold, reduces feature confusion caused by illumination interference, and reduces misjudgment caused by poor image quality in actual detection.

[0020] (2) The machine vision-based intelligent detection method for precision mold defects relies on multi-scale texture structure tensor and dual angle mapping to construct texture direction field, and combines curl coherence enhancement processing to accurately distinguish between normal polished texture and micron-level shallow scratches. In view of the characteristics of continuous and naturally curved polished texture on mold surface, while shallow scratches are random and disrupt the continuity, the texture structure tensor is first calculated at multiple Gaussian smoothing scales. The real texture structure is highlighted by gradient autocorrelation mapping and local contrast modulation. Then, a stable texture direction field is generated by dual angle mapping to completely preserve the texture direction information. On this basis, the curl scalar and direction coherence coefficient are calculated. The curl response map is obtained through collaborative enhancement, which can highlight the texture abrupt change caused by scratches and suppress the interference of regular polished texture. Thus, it can effectively identify shallow scratches covered by polished texture and will not regard continuously curved polished edges as defects, thereby improving the reliability of defect identification in complex texture environment.

[0021] (3) The machine vision-based intelligent detection method for precision mold defects achieves a complete closed loop from feature extraction to quantitative evaluation by combining iso-illuminance line curvature constraint and scale space adaptive fusion, and then combining region growth and area weighted aggregation to calculate the evaluation value. This makes the detection results more in line with actual production needs. After obtaining the curl response map, the iso-illuminance line curvature is used to construct exponential decay weights to constrain the curl response pixel by pixel to enhance the distinction between straight scratches and curved textures. Based on the confidence scores of each scale, single-scale extraction or multi-scale balanced fusion is selected to automatically adapt to the feature distribution of defects of different sizes, avoiding omissions or redundancies caused by a single scale. Furthermore, the seed region is located by local extreme points, and region growth is completed by response gradient. The defect significance value is weighted and aggregated with the region area as the weight to obtain the mold defect evaluation value, so as to ensure that small defects are not ignored and to filter false regions formed by noise interference, thereby improving the accuracy of the detection results.

[0022] (4) The machine vision-based precision mold defect intelligent detection system acquires the original image and performs adaptive gamma correction through the image acquisition and enhancement unit to provide a high-quality image foundation; the multi-scale texture analysis unit accurately extracts the texture direction information of the mold surface through multi-scale Gaussian smoothing and dual angle mapping; the curl enhancement processing unit completes the curl coherence enhancement based on the texture direction field and structural tensor to highlight the texture mutation features caused by defects; the curvature constraint filtering unit combines the curvature map of the iso-illuminance line to constrain and filter the curl response to eliminate normal texture interference; the adaptive fusion unit performs adaptive fusion of multi-scale defect responses to integrate effective defect features at different scales; the defect evaluation and detection unit completes the evaluation value statistics and final defect judgment based on the fusion results, thereby realizing the accurate identification and evaluation of micron-level shallow scratches on the glossy curved surface mold, effectively avoiding the problem of difficulty in distinguishing normal polishing texture from micro defects and high false detection and false detection rates, and thus improving the reliability of defect detection.

[0023] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0024] Figure 1 This is a flowchart of a precision mold defect intelligent detection method based on machine vision according to the present invention.

[0025] Figure 2 This is a flowchart illustrating the specific steps involved in calculating the corresponding texture structure tensor at each scale in a machine vision-based intelligent detection method for precision mold defects according to the present invention.

[0026] Figure 3 This is a block diagram of a precision mold defect intelligent detection system based on machine vision according to the present invention. Detailed Implementation

[0027] Please see Figure 1This invention provides a technical solution: a machine vision-based intelligent detection method for precision mold defects, comprising the following steps: acquiring a grayscale image of the mold surface to be inspected, including the grayscale value of each pixel and its corresponding two-dimensional coordinates, and performing adaptive gamma correction based on local variance to obtain an enhanced image of the mold; for the enhanced image, pre-setting multiple different Gaussian smoothing scales (e.g., 3), calculating the corresponding texture structure tensor for each scale, and generating texture orientation fields for each scale through dual-angle mapping; and performing orientation field curl coherence enhancement processing based on the texture orientation fields and texture structure tensors. The process involves obtaining mold curl response maps at various scales; constructing corresponding iso-illuminance line curvature maps based on the mold enhancement images, and performing joint constraint processing with the curl response maps at each scale to obtain mold defect response maps at each scale; performing scale-space adaptive fusion processing on the mold defect response maps to generate a comprehensive mold defect response map; statistically analyzing the mold defect evaluation values ​​based on the comprehensive mold defect response map, and performing intelligent defect detection processing on the mold to be inspected, i.e., comparing the mold defect evaluation values ​​with a preset mold defect evaluation threshold. If the mold defect evaluation value is higher than the preset mold defect evaluation threshold, the mold to be inspected has a defect; otherwise, it is qualified.

[0028] The preset steps for the mold defect assessment threshold are as follows:

[0029] Collect a batch of known qualified precision mold samples, no less than 20, and analyze the mold defect evaluation value of each qualified sample. Calculate the maximum value of the defect evaluation value of all qualified samples, and record it as the upper limit of the qualified sample evaluation value.

[0030] The final mold defect assessment threshold is obtained by multiplying the upper limit of the qualified sample evaluation value by a preset safety factor. The safety factor is usually in the range of 1.2 to 1.5. For scenarios that require extremely high pass rate and cannot have any missed detections, the safety factor can be a smaller value (such as 1.2). For scenarios that allow a small number of false detections but require strict control of missed detections, the safety factor can be a larger value (such as 1.5). In this embodiment, the safety factor is preferably 1.2.

[0031] Specifically, the steps to obtain the mold enhancement image of the mold to be inspected are as follows:

[0032] The grayscale image of the mold surface is subjected to median filtering, and a local grayscale variance map is extracted based on the median filtering result. Specifically:

[0033] A 3×3 median filter window can be used to filter the grayscale image of the mold surface. Filtering is performed (to suppress isolated noise points in the image while preserving the fine textures and potential defect contours of the mold surface to the greatest extent possible), where, This represents the two-dimensional coordinates of pixels in an image, with x being the horizontal coordinate and y being the vertical coordinate. The filtered image is obtained after filtering. ;

[0034] use Sliding window ( (Can be preset to 15 pixels), traverse the filtered image. For each pixel, calculate the variance of the grayscale values ​​of all pixels within each window to obtain a local grayscale variance map. The formula for calculating the local gray-level variance is: ;

[0035] in, For pixels The local gray-level variance characterizes the degree of dispersion of gray-level values ​​within the neighborhood of a pixel. For filtered images Any pixel within the middle window grayscale value; This is the average grayscale value of all pixels within the sliding window in the filtered image;

[0036] It should be noted that the local grayscale variance map The specific composition is consistent with the size of the grayscale image of the mold surface, and the spatial coordinates correspond one-to-one. The value of each pixel is the local grayscale variance corresponding to that point. ;

[0037] Determine the upper limit threshold of the variance of the local gray-level variance map, and perform local variance-driven gamma mapping processing on the local gray-level variance map to determine the set of gamma coefficients, specifically as follows:

[0038] Calculate the local grayscale variance map The 95th percentile is set as the upper limit threshold for variance. ;

[0039] For each pixel Based on its local gray-scale variance With upper limit of variance threshold The gamma correction coefficient corresponding to this pixel is calculated through a linear mapping relationship. To form a set of gamma coefficients The formula for calculating the gamma correction factor is:

[0040] ;

[0041] Furthermore, the specific composition of the gamma coefficient set and the local gray-level variance map Consistent in size, with one-to-one spatial coordinates, each element being the gamma correction coefficient for the corresponding pixel. ;

[0042] Based on the gamma coefficient set, a pixel-by-pixel power-law transform is performed on the grayscale image of the mold surface to obtain the mold enhancement image, specifically:

[0043] grayscale image of mold surface For each pixel, call the corresponding gamma coefficient set A pixel-by-pixel power-law transform is performed to achieve adaptive grayscale enhancement, resulting in a mold-enhanced image. The formula for calculating the power-law transform is:

[0044] ;

[0045] in, To enhance the pixels in the image grayscale value, The grayscale value of this pixel in the grayscale image of the mold surface; mold enhancement image. The specific composition is consistent with the size of the grayscale image of the original mold surface and the spatial coordinates correspond one-to-one.

[0046] In this implementation, the original grayscale image is processed by a median filter window of a preset size. This process removes isolated noise while preserving the fine texture and defect contours of the mold surface, avoiding the loss of key features. A fixed-size sliding window is used to traverse and calculate the local grayscale variance, accurately reflecting the degree of grayscale change in each region and maintaining a consistent spatial correspondence with the original image. This ensures that the feature distribution matches the actual surface structure. Secondly, the upper limit threshold of the variance is determined by the quantiles of the local grayscale variance map. Then, a set of gamma coefficients corresponding to each pixel is obtained through linear mapping, enabling automatic adjustment of enhancement parameters as the grayscale changes in the region. Finally, a power-law transformation is performed pixel-by-pixel on the original image according to the gamma coefficients. This effectively reduces abnormal brightness in high-contrast areas while improving detail in low-contrast areas, mitigating the impact of uneven lighting on curved surfaces. This makes the difference between micron-level shallow scratches and normal polished textures more intuitive, reducing the possibility of misjudgment and missed judgment.

[0047] Specifically, such as Figure 2 As shown, the specific steps for calculating the corresponding texture structure tensor at each scale are as follows:

[0048] For the mold enhancement image, a first-order gradient operator is used to calculate the gradient component set (which is the horizontal and vertical gradient components of each pixel) and the gradient magnitude set (which is the gradient magnitude of each pixel), specifically as follows:

[0049] The Sobel operator is used as the first-order gradient operator to enhance the mold image. Perform pixel-by-pixel gradient calculations to obtain the horizontal gradient component maps. and longitudinal gradient component map Together, they constitute the gradient component set. ;

[0050] And the horizontal gradient component map Including the lateral gradient component of each pixel It represents the rate of change of gray level at that point in the horizontal direction (x-axis direction). A positive value indicates that the gray level increases from left to right, and a negative value indicates that the gray level decreases from left to right.

[0051] Vertical gradient component map Including the vertical gradient component of each pixel It represents the rate of change of gray level at that point in the vertical direction (y-axis direction). A positive value indicates that the gray level increases from bottom to top, and a negative value indicates that the gray level decreases from bottom to top.

[0052] Calculate the gradient magnitude of each pixel based on the horizontal and vertical gradient components. The gradient magnitude set is obtained. This includes the gradient magnitude of each pixel. ,Right now: ;

[0053] It should be noted that the lateral gradient component map and longitudinal gradient component map Both images are identical in size to the mold enhancement image and have a one-to-one spatial coordinate correspondence. The value of each pixel is the gradient component in the corresponding direction. Furthermore, the gradient magnitude set is specifically structured as a gradient magnitude map, with the same size as the enhanced image, and the value of each pixel is the gradient magnitude at that point. ;

[0054] Gradient autocorrelation mapping is performed on the gradient component set to generate a gradient second-moment map set (which includes a horizontal gradient squared map, a vertical gradient squared map, and a horizontal-vertical gradient product map, where the value of each pixel in each map corresponds to the horizontal gradient squared, vertical gradient squared, and horizontal-vertical gradient product of that pixel, respectively). Specifically:

[0055] Perform gradient autocorrelation calculation on each pixel, that is, calculate the square of the horizontal gradient component. The square of the longitudinal gradient component The product of the horizontal and vertical gradient components The horizontal gradient squared plots were obtained respectively. Vertical gradient squared plot and the product of horizontal and vertical gradients The three together constitute the gradient second moment atlas. (And these three images have the same size as the enhanced image and their spatial coordinates correspond one-to-one.) The formula for calculating the gradient autocorrelation mapping is:

[0056] ;

[0057] ;

[0058] ;

[0059] in, The value of the square of the horizontal gradient of a pixel represents the square of the horizontal gray level change rate at that point, amplifying the features of areas with large horizontal gradients. The vertical gradient squared value of this pixel represents the square of the vertical gray level change rate at this point, amplifying the features of areas with large vertical gradients. This is the product of the horizontal and vertical gradients of the pixel, representing the correlation between the horizontal and vertical grayscale changes at that point.

[0060] Based on the gradient magnitude set, a local contrast weight map is constructed, and the gradient second moment map set is subjected to local contrast-guided modulation processing to generate a modulated gradient second moment map set, specifically as follows:

[0061] Based on gradient magnitude set A 5×5 sliding window is used to calculate the local contrast of each pixel. It is defined as the difference between the maximum and minimum gradient magnitudes within the window, and the local contrast is normalized to obtain the local contrast weight. Local contrast weights of all pixels Constructing a local contrast weight map ;

[0062] Local contrast weight map Pixel-wise multiplication with the three images in the gradient second moment atlas is performed to achieve local contrast-guided modulation, resulting in a modulated gradient second moment atlas. The specific calculation formula is as follows:

[0063] ;

[0064] ;

[0065] ;

[0066] ;

[0067] in, These are the maximum and minimum values ​​of the local contrast of the pixels corresponding to the gradient magnitude set, respectively; These are the modulated squared values ​​of the transverse gradient, the longitudinal squared gradient, and the gradient product, respectively.

[0068] The modulated gradient second moment atlas consists of three modulated second moment maps, which are identical in size to the original gradient second moment atlas and correspond one-to-one in spatial coordinates.

[0069] Based on each preset Gaussian smoothing scale, the modulated gradient second-order moment map is smoothed using the corresponding Gaussian kernel to obtain the texture structure tensor at each scale, specifically:

[0070] Three different Gaussian smoothing scales are preset, which can be set to... Pixels (corresponding to coarse texture areas) Pixel (corresponding to fine texture area) Pixels (corresponding to sensitive areas of minute defects) cover textures and defects of varying thicknesses at three scales, ensuring comprehensive extraction of multi-scale texture features;

[0071] For each Gaussian smoothing scale Construct the corresponding two-dimensional Gaussian kernel Subsequently, the Gaussian kernel was compared with three graphs from the modulated gradient second moment atlas. Convolution smoothing is performed to obtain smoothed second-order moment components at each scale. The texture structure tensor at this scale is composed of these three smoothing components. The formulas for calculating the Gaussian kernel and smoothing are as follows:

[0072] ;

[0073] ;

[0074] ;

[0075] ;

[0076] ;

[0077] in, It is a two-dimensional Gaussian kernel. The relative coordinates of the Gaussian kernel are given; the size of the Gaussian kernel can be set as follows: ; Pi, with a value of approximately 3.14; This represents the convolution operation; These are the squared horizontal gradient, squared vertical gradient, and gradient multiplication integral after smoothing at this scale, respectively. For pixels at scale The texture structure tensor under the given point represents the texture direction and texture complexity in the neighborhood of that point;

[0078] The specific composition of texture structure tensors at each scale: Each scale corresponds to a set of texture structure tensors. Each pixel corresponds to a symmetric matrix. It consists of three smooth second-order moment components, and the texture structure tensors of the three scales correspond to the texture features of coarse texture, fine texture and small defect region, respectively.

[0079] The specific steps for generating texture orientation fields at various scales through dual-angle mapping are as follows:

[0080] Based on the texture structure tensor, a smoothing component set is extracted, and a pixel normalization factor set (which is the normalization factor for each pixel) is calculated, specifically as follows:

[0081] For the texture structure tensor at each scale, extract three smoothed second-order moment components. This constitutes the smooth component set at this scale. ;

[0082] For each pixel, calculate the normalization factor for that point based on the smooth component set. The normalization factors of all pixels constitute the pixel normalization factor set. The formula for calculating the normalization factor is:

[0083] ;

[0084] in, For pixels at scale The normalization factor is a positive number. It is a non-zero small constant, taking the value of The specific composition of the pixel normalization factor set: a normalization factor map. Consistent with the enhanced image size, the value of each pixel is a normalization factor for that point. ;

[0085] Based on the pixel normalization factor set, a normalized combination transformation is performed on the smooth component set to generate a first mapping component set and a second mapping component set, specifically as follows:

[0086] For each pixel at each scale, call the smoothing component set. and the set of pixel normalization factors Perform a normalized combination transformation to obtain the first mapping component. Second mapping component The two constitute the first mapping component set respectively. Second mapping component set ;

[0087] This combined transformation essentially maps the second-order moment components of the texture structure tensor to vector components of the texture direction. The specific calculation formula is as follows:

[0088] ;

[0089] ;

[0090] in: For pixels at scale The first mapping component corresponds to the horizontal component of the texture direction vector; This is the second mapping component of the pixel, corresponding to the vertical component of the texture direction vector;

[0091] The specific composition of the first and second mapping component sets: both are mapping component maps with the same size as the enhanced image, respectively. The value of each pixel corresponds to the mapped component. ;

[0092] Based on the first and second mapping component sets, texture direction fields at various scales are constructed. The texture direction vector of each pixel in the texture direction field is composed of the first and second mapping components of that pixel, and this texture direction vector is equivalent to a unit vector with twice the angle of the local texture principal direction, specifically:

[0093] For each scale , the first mapping component set Second mapping component set Combine them, the texture direction vector of each pixel From this point and The texture direction vectors of all pixels together constitute the texture direction field at this scale. ;

[0094] The texture direction vector is related to the local texture principal direction. The relationship is: That is, the texture direction vector is equivalent to a unit vector whose local texture principal direction is twice the angle, and its length is always 1. It only represents the direction and not the intensity.

[0095] Local texture main direction Determined by the eigenvalues ​​and eigenvectors of the texture structure tensor, satisfying Combining the calculation formulas for the first and second mapping components, we can derive: Therefore, the texture direction vector The main direction of the local texture is represented;

[0096] The specific composition of the texture orientation field at each scale: Each scale corresponds to one texture orientation field. Consistent with the enhanced image size, each pixel corresponds to a two-dimensional unit vector. The direction of the vector is the main direction of the local texture at that point.

[0097] In this implementation scheme, the gradient operators are used to calculate the horizontal and vertical gradient components and gradient magnitudes, which can accurately reflect the grayscale change rate and intensity of each pixel, fully preserve the gradient features of texture and defects, and perform autocorrelation mapping on the gradient components to amplify the features of areas with large gradients. At the same time, local contrast-guided modulation is used to enhance the real texture features and weaken noise interference. Secondly, convolution smoothing is performed by combining multiple preset Gaussian smoothing scales, which can comprehensively cover texture and defect areas of different thicknesses and generate texture structure tensors corresponding to each scale. Finally, by extracting the smoothing components and calculating the normalization factor, a normalized combination transformation is completed to construct an accurate texture direction field, clearly representing the local texture main direction of each pixel, and fully restoring the continuous direction of normal polished texture, so as to improve the accuracy of subsequent defect detection.

[0098] Specifically, the steps to obtain the mold curl response diagrams at various scales are as follows:

[0099] Based on the texture orientation field, the curl scalar set at each scale (which is the curl scalar of each pixel) is calculated using the spatial difference method, specifically as follows:

[0100] For the texture orientation field at each scale, the curl of each pixel is calculated using the central difference method. Curl characterizes the degree of disorder in the texture orientation field. The greater the curl, the more disordered the texture orientation in that region, and the more likely there is a defect. Then, the absolute value of the curl is taken to obtain the curl scalar. The curl scalars of all pixels constitute the curl scalar set. The formula for calculating using the central difference method is:

[0101] ;

[0102] ;

[0103] ;

[0104] in: For pixels at scale The curl of the texture direction field can be positive or negative. A positive value indicates that the texture direction field rotates counterclockwise, and a negative value indicates that it rotates clockwise. Let be the partial derivative of the second mapping component in the horizontal direction (x-axis direction). This is the partial derivative of the first mapped component in the longitudinal direction (y-axis direction); These are the second and first mapping components of adjacent pixels, respectively; This represents the pixel spacing, with a value of 1 (the default pixel spacing is 1 pixel unit).

[0105] The specific structure of the curl scalar set is: a graph of absolute curl values. Consistent with the enhanced image size, the value for each pixel is the absolute value of the curl at that point. It is used to characterize the degree of disorder in texture direction;

[0106] Based on the texture structure tensor, feature sets at corresponding scales are obtained through eigenvalue decomposition (each feature set contains the first and second eigenvalues ​​of each pixel, with the first eigenvalue not less than the second eigenvalue). Furthermore, a set of directional coherence coefficients for each scale is constructed (each directional coherence coefficient is a pixel). Specifically:

[0107] For the texture structure tensor at each scale, the tensor for each pixel Eigenvalue decomposition yields two eigenvalues. and ,in Two eigenvalues ​​constitute the feature set at this scale. ;

[0108] The directional coherence coefficient of this pixel is calculated based on two feature values. The directional coherence coefficients of all pixels constitute the directional coherence coefficient set. The directional coherence coefficient characterizes the degree of order in local texture directions. The closer the coherence coefficient is to 1, the more ordered the texture directions are; the closer the coherence coefficient is to 0, the more disordered the texture directions are. The formulas for calculating the eigenvalue decomposition and directional coherence coefficient are as follows:

[0109] ;

[0110] ;

[0111] The feature set consists of two eigenvalue maps, namely the first eigenvalue map. Second eigenvalue map Consistent with the size of the enhanced image, the value of each pixel is the corresponding feature value. ;

[0112] The specific composition of the directional coherence coefficient set is: a directional coherence coefficient diagram. Consistent with the enhanced image size, the value for each pixel is the directional coherence coefficient at that point. ;

[0113] By performing synergistic enhancement processing on the curl scalar set and the directional coherence coefficient set, the curl response maps of the mold at various scales are obtained, as follows:

[0114] For each scale, the curl scalar set With direction coherence coefficient set Pixel-by-pixel fusion is performed to achieve synergistic enhancement of the curl response, resulting in a mold curl response map at this scale. The specific calculation formula is as follows:

[0115] ;

[0116] In the formula: For pixels at scale The specific composition of the curl response values ​​for each scale mold is as follows: each scale corresponds to one curl response diagram. Consistent with the enhanced image size, the value for each pixel is the curl response value at that point. The larger the response value, the more likely that point is a defect area.

[0117] In this implementation scheme, the curl scalar of the texture direction field is calculated using the spatial difference method, which can intuitively reflect the degree of disorder in the local texture direction and accurately capture the abrupt changes and disordered distribution of direction caused by scratches. By performing eigenvalue decomposition based on the texture structure tensor and constructing a set of directional coherence coefficients, the degree of order in the texture direction can be accurately measured, distinguishing between continuous and regular polished textures and disordered defect areas. Furthermore, the curl scalar and directional coherence coefficients are subjected to pixel-by-pixel collaborative enhancement processing, which can amplify the curl response in defect areas while suppressing the response values ​​in normal polished texture areas, making the defect location clearly distinguishable from the normal surface. This allows the resulting curl response map to stably highlight micron-level shallow scratches and other minute defects, reducing interference from normal process features.

[0118] Specifically, the steps for constructing the isolux line curvature diagram are as follows:

[0119] The mold enhancement image is subjected to micro-scale Gaussian smoothing, and the first-order and second-order gradient components of each pixel in the smoothed image are calculated, specifically as follows:

[0120] Employing microscale Gaussian smoothing (e.g.) (pixel) for mold enhancement image Smoothing is performed to obtain the smoothed image. The purpose of microscale smoothing is to suppress image noise while preserving the fine structure of defects and textures;

[0121] The smoothed image is calculated using the Sobel operator. First-order gradient component of each pixel The second-order gradient components are calculated using a Laplacian operator (such as a 3×3 Laplacian operator, and through convolution operations). These represent the changes in grayscale change rate in the horizontal and vertical directions, respectively. This represents the mutual influence between the horizontal and vertical grayscale change rates, with the first-order gradient component characterizing the grayscale change rate and the second-order gradient component characterizing the trend of the grayscale change rate.

[0122] Based on the first-order and second-order gradient components, the curvature value of the isoilluminance line for each pixel is determined as follows:

[0123] Based on first-order gradient components and second-order gradient components The curvature of the iso-illuminance line is calculated pixel by pixel using the curvature calculation formula. (Values ​​can be positive or negative; positive values ​​indicate that the isoluminescence line bends counterclockwise, and negative values ​​indicate that it bends clockwise. The larger the absolute value, the more pronounced the curvature of the isoluminescence line.) The curvature values ​​of all pixels constitute the curvature set of the isoluminescence line. The specific calculation formula is as follows:

[0124] ;

[0125] Based on the curvature values ​​of iso-illuminance lines, an iso-illuminance line curvature map is constructed. This iso-illuminance line curvature map has the same spatial resolution as the curl response maps at each scale, with a one-to-one correspondence between the two-dimensional coordinates of each pixel. Specifically:

[0126] Isohyetal Curvature Set Curvature value of each pixel in Taking the absolute value yields the absolute value of curvature. ;

[0127] To enhance the absolute value of curvature using a nonlinear enhancement function, an exponential enhancement function can be employed. ,in, The enhancement factor is a preset value; in this implementation example, it can be 5.0. For located The enhanced isoluminance line curvature value of the pixel;

[0128] in, The default steps are as follows:

[0129] Collect several sets of precision mold sample images with typical surface features. The sample images should cover normal polished texture areas, slight scratch areas, and obvious defect areas. For each sample image, calculate the absolute value of the curvature of the iso-illuminance line of each pixel according to the above method, and count the distribution range of the absolute value of curvature, especially the overlapping range of curvature values ​​between normal texture areas and defect areas.

[0130] Then, in the preset Within the candidate range (e.g., 3.0 to 8.0), candidates are selected sequentially with a fixed step size (e.g., 0.5). The values ​​were used to enhance the sample images, and the separation effect of the enhanced curvature values ​​was observed. That is, for each candidate... The optimal curvature value is determined by calculating the mean difference and intra-class variance of the enhanced curvature value between the normal texture region and the defect region, with the goal of maximizing the ratio of the two. The optimal value obtained from multiple sample images. The average value is taken as the enhancement coefficient;

[0131] The enhanced curvature values ​​are normalized (e.g., by max-min normalization) and mapped to the interval [0, 1] to obtain the normalized curvature values. All normalized curvature values ​​constitute the curvature diagram of iso-illuminance lines. .

[0132] The specific steps to obtain mold defect response maps at various scales are as follows:

[0133] The isoluminance line curvature value is read from the isoluminance line curvature map for each pixel. Specifically, this involves reading the isoluminance line curvature value from the isoluminance line curvature map. Read the normalized curvature value of each pixel one by one. ;

[0134] Based on a preset regularization coefficient and combined with the isoilluminance line curvature value, an exponential decay weight set is constructed (which contains the constraint weight value of each pixel with the same spatial resolution as the isoilluminance line curvature map), specifically as follows:

[0135] Preset regularization coefficient In this implementation example, the value can be 0.8. The larger the value, the slower the weight decays, and the stronger the constraint on regions with greater curvature. The smaller the value, the faster the weight decays, and the weaker the constraint on regions with smaller curvature.

[0136] Wherein, regularization coefficient The default steps are as follows:

[0137] Multiple sets of precision mold sample images were collected, which should include various typical surface conditions, including normal polished texture areas, slightly scratched areas, obviously scratched areas, and sharp texture areas that may cause curvature response. For each sample image, the absolute value of the curvature of the iso-illuminance lines was calculated, and the initial defect response value was calculated based solely on the curl response map without using curvature constraints (i.e., the weight was kept constant at 1), and the distribution range of response values ​​in normal texture areas and real defect areas was recorded.

[0138] In the preset Within the candidate range (e.g., 0.4 to 1.2), candidates are selected sequentially with a fixed step size (e.g., 0.1). Values ​​are used to construct exponentially decaying weight sets, which are then jointly constrained with the curl response plot to obtain each candidate value. Defect response map under the value, for each candidate The value is calculated as the ratio of the average response value of the real defect area to the average response value of the normal texture area in the defect response map, which serves as an evaluation index for the defect enhancement effect.

[0139] Analysis of this evaluation index The trend of value change: when When the value is too small, the weight decays too quickly, and normal sharp textures with large curvature are excessively suppressed. At the same time, some real defects with slightly larger curvature may also be weakened, leading to an increase in the false negative rate. When the value is too large, the weight decays too slowly, and normal sharp textures with large curvature cannot be effectively suppressed, leading to an increase in the false detection rate. Therefore, a value is selected that maximizes the defect enhancement effect evaluation index while simultaneously ensuring the false detection rate is below a preset tolerance threshold (e.g., 5%). The value is taken as the optimal value for this sample. The optimal value obtained for all sample images. The average value is taken as the regularization coefficient;

[0140] For each pixel, based on its normalized curvature value With regularization coefficient The constraint weights of the pixel are constructed using the exponential decay formula. The constraint weights of all pixels constitute an exponentially decaying weight set. This weight set has the same spatial resolution as the iso-illuminance line curvature map, and each pixel corresponds to a constraint weight value. The specific calculation formula is as follows:

[0141] ;

[0142] By performing pixel-by-pixel constraint processing on the exponential decay weight set and the curl response map, mold defect response maps at various scales are obtained, specifically as follows:

[0143] For each preset Gaussian smoothing scale, call the curl response map at that scale. With exponentially decaying weight set Pixel-by-pixel multiplication is performed to enhance the constraint on the curl response, resulting in the mold defect response map at this scale. The specific calculation formula is as follows: ;

[0144] in, For pixels at scale The mold defect response value is as follows;

[0145] The specific composition of the mold defect response map at each scale: Each scale corresponds to one defect response map, with the same size as the enhanced image, and the value of each pixel is the corresponding defect response value. The larger the response value, the higher the probability that the point is a defect.

[0146] In this implementation scheme, the mold enhancement image is processed by micro-scale Gaussian smoothing, which can suppress noise while fully preserving the fine structure of defects and textures, providing a stable basis for curvature calculation. The curvature of the iso-illuminance line is calculated by combining the first and second gradient components, which can accurately capture the curvature of the iso-illuminance line. Then, by reasonably preset the enhancement coefficient and perform nonlinear enhancement and normalization processing, the curvature difference between defects and normal textures is amplified. Furthermore, an exponential decay weight set is constructed based on the regularization coefficient, which, combined with the curvature value, achieves pixel-by-pixel constraint on the curl response map, which can enhance the response of the defect area and suppress the interference of normal curved textures. This makes the final mold defect response map at each scale clearly highlight the defect area and reduce the possibility of misjudgment caused by normal textures.

[0147] Specifically, the steps for generating a comprehensive mold defect response map are as follows:

[0148] Based on the mold defect response map, the local confidence score of each pixel at the corresponding scale is determined and sorted to generate a confidence ranking feature set, which is as follows:

[0149] For three scales The three corresponding mold defect response diagrams Calculate the local confidence score of each pixel at each scale. ;

[0150] The local confidence score is calculated based on the defect response values ​​of the pixel and its 3×3 neighborhood. It is defined as the ratio of the mean to the standard deviation of the defect response values ​​in the neighborhood, and is used to characterize the reliability of the defect response of the pixel. The larger the ratio, the higher the confidence and the more reliable the defect response. The specific calculation formula is as follows:

[0151] ;

[0152] In the formula: For pixels at scale Local confidence score; This is the mean value of the defect response value within a 3×3 neighborhood of the pixel. This represents the standard deviation of the defect response values ​​within this neighborhood.

[0153] Obtain the local confidence map for each scale. Then, the local confidence scores of each pixel at the three scales are sorted in descending order to obtain the confidence rank of that pixel. (Corresponding to the maximum, second largest, and minimum confidence scores respectively), the confidence ranking of all pixels constitutes the confidence ranking feature set. ;

[0154] Based on the confidence level feature set, a fusion judgment set is generated (which includes a first discriminant value, a second discriminant value, the ratio of the highest confidence score to the second highest confidence score as the first discriminant value; and the ratio of the second highest confidence score to the lowest confidence score as the second discriminant value), specifically as follows:

[0155] For each pixel, from the confidence-order feature set Extract the maximum confidence score of this point. Second largest confidence score Minimum confidence score ;

[0156] The ratio of the highest confidence score to the second highest confidence score is the first discriminant value. The ratio of the second-highest confidence score to the lowest confidence score is the second discriminant value. The first and second discriminant values ​​of all pixels together constitute the fusion judgment set. ;

[0157] If the fusion judgment set satisfies the preset first constraint (the first discriminant value is greater than the preset significance threshold, and the second discriminant value is also greater than the preset significance threshold), then the mold defect response map is subjected to single-scale dominant response extraction processing to generate a comprehensive mold defect response map, specifically as follows:

[0158] Preset significant threshold The value is 1.8; the first constraint condition is specifically... and This condition indicates that the confidence level of a certain scale is significantly higher than that of the other two scales, and the defect response of this scale is the most reliable. Therefore, a single-scale dominant response extraction strategy should be adopted.

[0159] For the pixels that satisfy the first constraint, extract their maximum confidence score. Defect response value at the corresponding scale The comprehensive response value of that point is used as the overall response value. Pixels that do not meet the first constraint condition are not processed temporarily and will be handled by the corresponding strategy later. The comprehensive response values ​​of all pixels constitute the comprehensive mold defect response map. ;

[0160] If the fusion judgment set satisfies the preset second constraint (the first discriminant value is less than or equal to the preset significance threshold, and the second discriminant value is also less than or equal to the preset significance threshold), then the mold defect response map is subjected to multi-scale balanced response fusion processing to generate a comprehensive mold defect response map, specifically as follows:

[0161] The second constraint condition is specifically as follows: and This condition indicates that the confidence differences among the three scales are small, necessitating a multi-scale balanced response fusion strategy. The fusion method involves averaging the defect response values ​​across the three scales to obtain the comprehensive response value for that pixel. ;

[0162] If the fusion judgment set does not satisfy the preset first and second constraints, then a dual-scale collaborative processing is performed on the mold defect response map based on the local confidence scores (the defect response values ​​corresponding to the two scales with the highest confidence scores are weighted and summed, with the weights proportional to their respective confidence scores), to generate a comprehensive mold defect response map, specifically as follows:

[0163] When the fusion judgment set does not satisfy either the first or the second constraint, it indicates that two of the three scales have relatively high confidence and little difference, while the confidence of the third scale is significantly low, and a dual-scale collaborative processing strategy needs to be adopted.

[0164] The processing method involves extracting the two scales with the highest confidence scores (i.e., corresponding scales). and scale and The defect response values ​​at these two scales are weighted and summed to obtain the overall response value of the pixel. The weights are proportional to their respective local confidence scores, and the specific calculation formula is as follows:

[0165] ;in: These are the maximum and second-largest local confidence scores for that pixel, respectively. These are the defect response values ​​corresponding to the two scales.

[0166] The specific steps for calculating mold defect assessment values ​​are as follows:

[0167] Local extreme point detection is performed on the comprehensive mold defect response map to generate several candidate defect seed points, specifically as follows:

[0168] A 3×3 neighborhood extreme point detection algorithm is used to analyze the comprehensive mold defect response map. Perform pixel-by-pixel detection to determine if a pixel is a local maximum point within its 3×3 neighborhood. If it is a local maximum point, and the overall defect response value of that point is... Greater than the preset seed point threshold (If the value can be preset to 0.3), then this pixel is identified as a candidate defect seed point;

[0169] All candidate defect seed points constitute the candidate defect seed point set. Where N is the number of candidate defect seed points. Let i be the two-dimensional coordinates of the i-th seed point;

[0170] Starting from the candidate defect seed point, response gradient region growing is performed to obtain several candidate defect regions, as follows:

[0171] For each candidate defect seed point Starting from this point, the response gradient region growth algorithm is used to gradually expand the growth region until the growth termination condition is met. The growth rule is as follows:

[0172] Select the edge pixels of the current growth region, calculate the difference between the combined response value of the edge pixel and the seed pixel, and if the difference is less than the preset gradient threshold... (Default is 0.1), and the overall response value of this edge pixel. If the area below this value is determined to be a normal area, then the edge pixel will be included in the growth area.

[0173] Repeat the above process until no edge pixels that meet the conditions can be included. The growth terminates when: none of the edge pixels in the growth region meet the growth rules, or the area of ​​the growth region reaches the preset maximum area threshold. (Can be preset to 500 pixels);

[0174] Each candidate defect seed point corresponds to a candidate defect region, and all candidate defect regions constitute a candidate defect region set. ,in For the first Each candidate defect region contains the coordinates of all pixels within that region and their overall response value.

[0175] For each candidate defect region, the region area and the region defect significance value (i.e., the ratio of the mean internal response to the mean boundary response) are calculated, and defect aggregation is performed to generate mold defect evaluation values, specifically as follows:

[0176] For each candidate defect region Calculate its area and regional defect significance value Area The number of all pixels in the region; the significance value of regional defects. Defined as the ratio of the mean comprehensive response within a region to the mean comprehensive response at the region boundary. The mean internal response is the average of the comprehensive response values ​​of all pixels within the region, while the mean boundary response is the average of the comprehensive response values ​​of pixels at the region edge.

[0177] The area of ​​each candidate defect region As a weight, and for the regional defect significance value of the corresponding candidate defect region. We perform a weighted summation to obtain the mold defect assessment value. The specific formula is as follows: .

[0178] In this implementation scheme, by calculating and sorting the local confidence scores of defect response maps at each scale, the reliability of defect responses at different scales can be accurately determined. Then, by generating a fusion judgment set, single-scale extraction, multi-scale balanced fusion, or dual-scale collaborative processing can be flexibly selected based on the confidence differences to fully integrate effective information from each scale and avoid the limitations of a single scale. Candidate defect seed points are determined by detecting local extreme points, and combined with response gradient region growth, the defect region outline is accurately delineated, filtering out false interference. Finally, by calculating the region area and the defect significance value, the significance value is weighted and summed with the area as the weight to generate an objective mold defect evaluation value. This can accurately identify minute defects and quantify the severity of defects, thereby improving the accuracy of detection.

[0179] Please see Figure 3 This invention provides a technical solution: a machine vision-based intelligent detection system for precision mold defects, comprising: an image acquisition and enhancement unit for acquiring grayscale images of the mold surface of the mold to be inspected and performing adaptive gamma correction based on local variance to obtain an enhanced mold image; a multi-scale texture analysis unit for presetting multiple different Gaussian smoothing scales on the enhanced mold image, calculating the corresponding texture structure tensor for each scale, and generating texture direction fields for each scale through dual-angle mapping; a curl enhancement processing unit for performing coherent enhancement processing of the direction field curl based on the texture direction field and texture structure tensor to obtain mold curl response maps for each scale; a curvature constraint filtering unit for constructing iso-illuminance line curvature maps based on the enhanced mold image and performing joint constraint processing with the curl response maps for each scale to obtain mold defect response maps for each scale; an adaptive fusion unit for performing scale-space adaptive fusion processing on the mold defect response maps to generate a comprehensive mold defect response map; and a defect assessment and detection unit for calculating mold defect assessment values ​​based on the comprehensive mold defect response map and performing intelligent defect detection processing on the mold to be inspected.

[0180] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

[0181] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A machine vision-based intelligent detection method for defects in precision molds, characterized in that, Includes the following steps: Acquire grayscale images of the mold surface to be inspected and perform adaptive gamma correction based on local variance to obtain an enhanced mold image; For the mold enhancement image, multiple different Gaussian smoothing scales are preset, the corresponding texture structure tensor is calculated for each scale, and the texture direction field of each scale is generated through dual angle mapping; Based on the texture orientation field and the texture structure tensor, coherent enhancement processing of the orientation field curl is performed to obtain the mold curl response map at each scale; Based on the enhanced mold image, an iso-illuminance line curvature map is constructed, and it is jointly constrained with the curl response map at each scale to obtain the mold defect response map at each scale. The mold defect response map is subjected to scale-space adaptive fusion processing to generate a comprehensive mold defect response map; Based on the comprehensive mold defect response map, the mold defect evaluation value is statistically analyzed, and intelligent defect detection processing is performed on the mold to be inspected.

2. The intelligent detection method for precision mold defects based on machine vision according to claim 1, characterized in that, The specific steps to obtain the mold enhancement image are as follows: The grayscale image of the mold surface is subjected to median filtering, and the local grayscale variance map is extracted; Determine the upper limit threshold of the variance of the local gray-scale variance map, and perform local variance-driven gamma mapping processing with the local gray-scale variance map to determine the gamma coefficient set; Based on the set of gamma coefficients, a pixel-by-pixel power-law transformation is performed on the grayscale image of the mold surface to obtain an enhanced mold image.

3. The intelligent detection method for precision mold defects based on machine vision according to claim 1, characterized in that, The specific steps for calculating the corresponding texture structure tensor at each scale are as follows: For the mold enhancement image, the gradient component set and gradient magnitude set are calculated using a first-order gradient operator; The gradient component set is subjected to gradient autocorrelation mapping to generate a gradient second moment map set; Based on the gradient magnitude set, a local contrast weight map is constructed, and the gradient second moment map set is subjected to local contrast-guided modulation processing to generate a modulated gradient second moment map set. Based on each preset Gaussian smoothing scale, the modulation gradient second moment map is smoothed to obtain the texture structure tensor at each scale.

4. The intelligent detection method for precision mold defects based on machine vision according to claim 3, characterized in that, The specific steps for generating texture orientation fields at various scales through dual-angle mapping are as follows: Based on the texture structure tensor, the smoothing component set is extracted, and the pixel normalization factor set is calculated. Based on the pixel normalization factor set, the smooth component set is subjected to normalized combination transformation to generate a first mapping component set and a second mapping component set. Based on the first and second mapping component sets, texture orientation fields at various scales are constructed.

5. The intelligent detection method for precision mold defects based on machine vision according to claim 1, characterized in that, The specific steps to obtain the mold curl response diagrams at various scales are as follows: Based on the texture orientation field, the curl scalar set at each scale is calculated using the spatial difference method; Based on the texture structure tensor, a feature set is obtained through eigenvalue decomposition, and a set of directional coherence coefficients at each scale is constructed. The curl scalar set and the directional coherence coefficient set are subjected to synergistic enhancement processing to obtain the mold curl response map at each scale.

6. The intelligent detection method for precision mold defects based on machine vision according to claim 1, characterized in that, The specific steps for constructing the iso-illuminance line curvature diagram are as follows: The mold enhancement image is subjected to microscale Gaussian smoothing, and the first-order gradient component and the second-order gradient component are calculated. Based on the first-order gradient component and the second-order gradient component, the curvature value of the iso-illuminance line is determined. Based on the curvature values ​​of the iso-illuminance lines, an iso-illuminance line curvature map is constructed.

7. The intelligent detection method for precision mold defects based on machine vision according to claim 6, characterized in that, The specific steps to obtain mold defect response maps at various scales are as follows: Read the curvature values ​​of the isoilluminance lines from the isoilluminance line curvature diagram; Based on the preset regularization coefficient and combined with the curvature value of the isoilluminance line, an exponential decay weight set is constructed. The exponential decay weight set and the curl response map are subjected to pixel-by-pixel constraint processing to obtain mold defect response maps at each scale.

8. The intelligent detection method for precision mold defects based on machine vision according to claim 1, characterized in that, The specific steps for generating a comprehensive mold defect response map are as follows: Based on the mold defect response map, the local confidence score of its corresponding scale is determined and sorted to generate a confidence ranking feature set; Based on the confidence level feature set, a fusion judgment set is generated; If the fusion judgment set satisfies the preset first constraint condition, then the mold defect response map is subjected to single-scale dominant response extraction processing to generate a comprehensive mold defect response map. If the fusion judgment set satisfies the preset second constraint condition, then the mold defect response map is subjected to multi-scale balanced response fusion processing to generate a comprehensive mold defect response map.

9. The intelligent detection method for precision mold defects based on machine vision according to claim 1, characterized in that, The specific steps for calculating mold defect assessment values ​​are as follows: Local extreme point detection is performed on the comprehensive mold defect response map to generate several candidate defect seed points; Starting from the candidate defect seed point, a response gradient region growth process is performed to obtain several candidate defect regions. For the candidate defect regions, the region area and the region defect significance value are calculated respectively, and defect aggregation processing is performed to generate mold defect evaluation values.

10. A machine vision-based intelligent detection system for precision mold defects, employing the machine vision-based intelligent detection method for precision mold defects as described in any one of claims 1-9, characterized in that, include: The image acquisition and enhancement unit is used to acquire grayscale images of the mold surface of the mold to be inspected, and perform adaptive gamma correction based on local variance to obtain an enhanced mold image. The multi-scale texture analysis unit is used to pre-set multiple different Gaussian smoothing scales for the mold enhancement image, calculate the corresponding texture structure tensor for each scale, and generate the texture direction field for each scale through dual angle mapping. The curl enhancement processing unit is used to perform coherent enhancement processing of the curl of the orientation field based on the texture orientation field and the texture structure tensor to obtain the mold curl response map at each scale. The curvature constraint filtering unit is used to construct an iso-illuminance line curvature map based on the mold enhancement image, and perform joint constraint processing with the curl response map at each scale to obtain the mold defect response map at each scale. An adaptive fusion unit is used to perform scale-space adaptive fusion processing on the mold defect response map to generate a comprehensive mold defect response map. The defect assessment and detection unit is used to calculate the mold defect assessment value based on the comprehensive mold defect response map, and to perform intelligent defect detection processing on the mold to be inspected.