Defect concavity and convexity detection algorithm and detection system based on height map and curvature analysis
By combining defect detection algorithms with height map and curvature analysis, the accuracy and adaptability problems of concave and convex defect detection in the prior art are solved, and micron-level concave and convex defect detection is realized, which is suitable for high-precision detection of complex surface morphology.
Patent Information
- Application Number
- CN202510920648.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-07-04
AI Technical Summary
The prior art is difficult to accurately obtain the depth information of defects in the detection of concave and convex defects, traditional methods are difficult to adapt to complex surface morphology, and the generalization ability of methods that rely on large-scale data sets is limited.
Using defect detection algorithm based on height map and curvature analysis, surface height map data is obtained through high-precision three-dimensional measurement equipment, image preprocessing and curvature analysis are performed, and micro surface defects are identified by combining adaptive neighborhood curvature analysis and multi-scale curvature calculation.
It realizes accurate micron-level concave defect detection, improves the adaptability and robustness to complex surfaces, and meets the detection needs of different types of workpieces.
Smart Images

Figure CN120427644A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial defect detection, and in particular to a defect concavity and convexity detection system and method based on height map and curvature analysis. Background Art
[0002] In industrial product inspection, the concavity and convexity of surface defects is a key indicator for assessing product quality. Traditional defect detection methods primarily rely on 2D image analysis, but due to a lack of depth information, it is difficult to accurately distinguish different types of defects. Height mapping is a commonly used 3D surface characterization method that provides depth information of surface topography, making the detection of concavity and convexity defects more intuitive and accurate.
[0003] At present, common methods for detecting concavity and convexity include: morphological analysis: using image processing technology to extract the morphological features of the defect area, such as area and perimeter, but it is difficult to accurately evaluate the depth characteristics of the defect; threshold segmentation: setting a threshold based on height information to distinguish between normal areas and defect areas, but it is difficult to adapt to complex surface morphology; statistical analysis method: analyzing by calculating statistical features such as the mean and variance of the height distribution, but lacks a description of local geometric features; machine learning method: using deep learning and other technologies to train classification models, which can automatically identify defect types, but requires a large amount of labeled data.
[0004] Existing technologies for concave-convex defect detection face the following challenges: relying solely on two-dimensional images, they cannot accurately capture defect depth information; traditional thresholding methods struggle to adapt to different defect types; statistical analysis methods lack the ability to analyze local features such as curvature; and machine learning methods rely on large datasets, limiting their generalization capabilities. Therefore, a method combining height maps and curvature analysis is urgently needed to improve the accuracy and robustness of concave-convex defect detection. Summary of the Invention
[0005] In response to the shortcomings of the existing technology, the present invention aims to provide a defect convexity and concavity detection system and method based on height map and curvature analysis to improve the accuracy of industrial surface defect detection; it can combine the three-dimensional morphology data of the height map with curvature analysis to provide concave and convexity defect detection accurate to the micron level and can identify tiny surface defects; adopt an adaptive neighborhood curvature analysis algorithm to improve the system's adaptability and robustness to complex surface morphologies (such as free-form surfaces and microstructured surfaces); construct a detection scheme suitable for industrial environments, focusing on optimizing detection quality and stability to meet the surface detection needs of different types of workpieces.
[0006] The present invention proposes a defect concavity and convexity detection algorithm based on height map and curvature analysis, which includes the following steps: Step S1: Height data acquisition: Use high-precision 3D measurement equipment to obtain surface height map data to ensure that the resolution and accuracy of the data meet the detection requirements; Step S2: Image preprocessing: denoising, smoothing, and normalizing the height map data to improve data quality. A targeted filtering algorithm is used to remove noise interference from the data, smoothing is used to suppress high-frequency noise, and normalization is used to unify the data scale. This comprehensively improves data quality and provides a reliable data foundation for subsequent analysis.
[0007] Step S3: Curvature analysis: Based on the processed height map data, a local surface model is constructed to calculate the curvature characteristics. With the help of this model, the normal curvature of each surface point is calculated, and the curvature characteristics in the neighborhood of the point are analyzed to obtain complete curvature information.
[0008] Step S4: Defect classification: calculate the normal vector through the local surface model, calculate the concavity and convexity based on the curvature characteristics and the normal vector, and classify the defects based on the concavity and convexity; specifically, the curvature characteristics and height distribution information obtained by curvature analysis are used as the judgment basis, and a professional classification algorithm is used to classify the detected surface defects, accurately distinguishing different types of defects such as convexities and concavities.
[0009] Step S5: Output the results, generate a defect marker map, and calculate the relevant characteristic parameters of the defect. The algorithm calculates key characteristic parameters such as the depth and area of the defect, providing detailed data support for subsequent quality assessment.
[0010] As a further solution of the present invention, in step S3: curvature feature calculation includes: average curvature normal operator K H (v j ) is used to describe the average curvature contribution of vertex j on the local surface, and its calculation formula is as follows: K H (v j )=2H(v j )•n(v j ); where K H (v j ) is the vertex v j The mean curvature normal operator represents the contribution of the vertex to the mean curvature of the local surface, n(v j ) is the vertex v j The unit normal vector represents the normal direction of the surface at that point. The calculation formula is: , where T k T j Represents all containing vertex v j The triangle, v a ,v b ,vc For triangle T k The three vertices of H(v j ) is the vertex v j The average curvature is calculated as: ;k1(v j ) and k2(v j ) is the vertex v j The principal curvatures of the surface are the curvatures of the surface in the directions of maximum and minimum curvature, respectively; As a further solution of the present invention, in step S4: defect classification includes concavity calculation, specifically including single point concavity calculation formula: ; Where Convex(v) is the concavity value of vertex v, which is used to quantify the degree of concavity in the local area; v is the current vertex; N(v) is the set of neighboring vertices of vertex v; K H (v j ) is the neighborhood vertex v j The mean curvature normal operator of Normal(v j ) is the neighborhood vertex v j The unit normal vector of ; |N(v)| is the number of neighboring vertices; The calculation formula for the overall concavity and convexity of the region is: ; Where A(R) is the total area of region R, A(v k ) is the vertex v k Voronoi area, used for weighting, Convex(v k ) is the vertex v k The local concavity value of Directional consistency analysis: The directional consistency coefficient α (R) is used to evaluate the consistency of the concave and convex directions within the region: ; Among them: n(v k ) is the vertex v k The unit normal vector, Convex(v k ) is the vertex v k The local concavity value of α(R) ranges from [0,1]. The larger the value, the higher the directional consistency. th is the set directional threshold, if α(R)≥α th , then the concave and convex directions of the region are consistent, if α(R)<α th , then the concave and convex directions of the region are chaotic.
[0011] As a further solution of the present invention, in step S2: filtering / smoothing is applied to the height map data I to remove noise: I B =Filter(I); The filter function Filter can be any of the following: Median filter: I B (x,y)=median{I(x+i,y+j)|-k≤i,j≤k}; Where x represents the horizontal coordinate of the image, y represents the vertical coordinate of the image, and i and j represent the relative coordinate offset; Mean filtering: ; Gaussian filtering: ; Where G(i,j) is the Gaussian kernel function: ; The filter kernel size k and Gaussian standard deviation σ need to be selected according to the scale characteristics of the vertical stripes.
[0012] As a further solution of the present invention, in step S3: based on the calculated curvature characteristics and height distribution information, the defects are classified: if Convex(v k ) is positive, indicating that the region is convex; if Convex(v k ) is negative, indicating that the area is concave; if Convex(v k ) is close to zero, indicating that the area is a flat area or a smooth surface area.
[0013] As a further solution of the present invention, step S3 further includes: introducing an adaptive curvature threshold adjustment mechanism, the specific steps are as follows: performing curvature distribution statistics on the normal area of the workpiece, and calculating the mean value μ of the curvature H and standard deviation σ H ; Based on statistical results, dynamically set the curvature threshold: H th =μ H +α•σ H ; Among them, α is the adjustment coefficient set by the user, which is used to determine the detection sensitivity of defects.
[0014] As a further solution of the present invention, step S3 further includes: a multi-scale curvature analysis method, which specifically comprises the following steps: using a multi-scale analysis method, decomposing the height map into images of different scales by Gaussian pyramid decomposition; performing curvature calculations at different scales to obtain a set of multi-scale curvature maps K s (x, y); Integrate curvature information at multiple scales to improve the detection capability of defects of different sizes, especially to effectively distinguish large-scale deformation from small-scale defects.
[0015] The present invention also provides a detection system for a defect convexity and concavity detection algorithm based on height map and curvature analysis, comprising: a CCD, a projector, a 3D data acquisition unit, a data processing unit and a display output unit; the CCD: adopts a high-resolution industrial array camera; the projector: adopts a high-resolution digital projector, and realizes structured light encoding by precisely controlling the projection pattern; the 3D data acquisition unit: controls the structured light projection and camera synchronous acquisition, adjusts the camera exposure parameters, projection brightness and trigger timing, and ensures the acquisition accuracy and stability of point cloud data; the data processing unit includes preprocessing, convexity and concavity calculation, and defect classification functional modules; the display output unit: displays the detection results, including defect location, depth, area information, and generates a quality report.
[0016] The present invention utilizes adaptive neighborhood selection: Given the varying complexity of different parts of a surface, a dynamic neighborhood radius adjustment strategy is employed to ensure the accuracy of concavity and convexity calculations. The algorithm monitors local surface curvature changes in real time. When the surface curvature changes dramatically, the neighborhood radius is reduced to focus on details; when the surface is relatively flat, the neighborhood radius is increased to improve computational efficiency. This adaptively selects the neighborhood size for concavity and convexity calculations, ensuring accuracy. Multi-scale curvature calculation: Defects of different sizes appear differently on a surface. To achieve uniform detection of defects of varying scales, the present invention utilizes a multi-scale curvature analysis method. By performing multi-scale decomposition on the height map and calculating curvature at different scales, the algorithm can capture both the macroscopic features of large-scale defects and the subtle characteristics of small-scale defects. Regional adaptive filtering: Considering the varying curvature characteristics of different regions on a surface, the present invention has designed a regional adaptive filtering strategy. Based on the curvature variation characteristics of each region, the algorithm automatically selects the most appropriate filtering parameters, effectively removing noise while preserving the key features of the surface to the greatest extent possible, providing high-quality data for subsequent analysis. Optimize the curvature calculation method: Noise will inevitably be generated during the measurement process, affecting the stability of the curvature estimation. To this end, the present invention uses methods such as weighted least squares fitting to optimize the calculation of local surface curvature. By assigning different weights to different data points, the impact of noise data is reduced, making the curvature estimation more stable and reliable. GPU-based parallel computing: Tasks such as curvature calculation, convexity analysis, and connected area detection have huge computational loads. In order to meet real-time detection needs, the present invention uses parallel computing technologies such as CUDA / OpenCL to distribute these computationally intensive tasks to multiple cores of the GPU for simultaneous processing, greatly shortening the algorithm running time and significantly improving the algorithm execution speed.
[0017] The present invention has the following beneficial effects: the present invention combines the three-dimensional morphology data of the height map with curvature analysis to achieve micron-level concave-convex defect detection and can identify tiny surface defects; adopts an adaptive neighborhood curvature analysis algorithm to improve the system's adaptability and robustness to complex surface morphologies (such as free-form surfaces and microstructured surfaces), and enhances the generalization ability of the detection system; constructs a detection solution suitable for industrial environments, focusing on optimizing detection quality and stability to meet the surface detection needs of different types of workpieces.
[0018] Specifically, in the field of surface defect detection, many existing methods suffer from significant deficiencies in detection accuracy and adaptability. This invention significantly overcomes these limitations through an innovative technical approach. By integrating three-dimensional topographic data from height maps with curvature analysis technology, it achieves ultra-high-precision micron-level concavity and convexity defect detection, enabling precise identification of extremely small surface defects and raising detection accuracy to a new level.
[0019] To address complex industrial scenarios, we developed an adaptive neighborhood curvature analysis algorithm. This algorithm enables the detection system to dynamically adjust analysis parameters based on changes in surface morphology, significantly improving the system's adaptability and robustness to complex surface morphologies such as free-form surfaces and microstructures. This comprehensively enhances the detection system's generalization capabilities and effectively broadens its application range.
[0020] Taking into account the stringent requirements of industrial sites, this invention meticulously constructs a detection solution suitable for industrial environments. During the design process, detection quality and stability were prioritized as core optimization goals. Careful consideration was given to everything from hardware selection to algorithm design to ensure the solution can meet the surface inspection requirements of diverse workpiece types. Whether it's metal parts, plastic housings, or high-precision optical components, reliable detection can be achieved, helping to improve the quality and optimize the efficiency of industrial production.
[0021] In order to more clearly illustrate the structural features and effects of the present invention, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 Schematic diagram of the system architecture of the present invention; Figure 2 It is the algorithm flow chart of the present invention; Figure 3 Schematic diagram of the concavity and convexity calculation results of the present invention. DETAILED DESCRIPTION
[0023] The present invention will be further described below with reference to the accompanying drawings and related knowledge, and described clearly and completely. Obviously, the described applications are only part of the embodiments of the present invention, rather than all of the embodiments.
[0024] This invention provides a defect concavity and convexity detection algorithm based on height map and curvature analysis, comprising the following steps: height data acquisition, image preprocessing, curvature analysis, defect classification, and result output. The height data acquisition step involves using high-precision 3D measurement equipment (such as structured light or laser scanners) to acquire surface height map data, ensuring that the data resolution and accuracy meet detection requirements. The image preprocessing step includes: denoising, using methods such as median filtering or Gaussian filtering to remove sensor noise and ensure data quality; smoothing, using Gaussian filtering or mean filtering to smooth the height map to eliminate high-frequency noise while preserving key curvature features; and normalization, normalizing the height map data to ensure a uniform scale for subsequent analysis. The curvature analysis step involves constructing a local surface model for each surface point based on the height map data and calculating the normal curvature and its neighborhood curvature features. The defect classification step involves analyzing and classifying surface defect types based on the curvature features and height distribution information. Defect types include, but are not limited to, protrusions, depressions, and scratches. The result output steps include: generating a defect marking map, displaying the defect location, and calculating related characteristic parameters such as defect depth, area, and volume. It also includes a multi-scale analysis step, which improves the detection accuracy of defects of different sizes by calculating the curvature characteristics at different scales, and an adaptive threshold selection step, which dynamically adjusts the threshold according to the curvature distribution of the workpiece surface, thereby improving the detection ability of subtle defects.
[0025] Example 1: Reference Figure 1-Figure 3 As shown, the present invention provides a defect concavity and convexity detection algorithm based on height map and curvature analysis. The algorithm effectively identifies and classifies surface concavity and convexity defects by accurately processing the surface height map and analyzing the curvature. Through neighborhood curvature analysis, the algorithm can accurately detect tiny concavity and convexity defects on surfaces of different shapes and sizes. The algorithm includes the following steps: Step S1: Height data acquisition: Use high-precision 3D measurement equipment to obtain surface height map data to ensure that the resolution and accuracy of the data meet the detection requirements.
[0026] Step S2: Image preprocessing: De-noising, smoothing, and normalizing the height map to improve data quality. Specifically, this includes applying filtering / smoothing to the height map I to remove noise: I B =Filter(I); The filter function Filter can be any of the following: Median filter: I B (x,y)=median{I(x+i,y+j)|-k≤i,j≤k} Where x represents the horizontal coordinate of the image, y represents the vertical coordinate of the image, and i and j represent the relative coordinate offset.
[0027] Mean filtering: ; Gaussian filtering: ; Where G(i,j) is the Gaussian kernel function: ;The filter kernel size k and Gaussian standard deviation σ need to be selected according to the scale characteristics of the vertical stripes.
[0028] Step S3: Curvature analysis: Based on the height map data, a local surface model is constructed to calculate the normal curvature of the surface points and the neighborhood curvature characteristics. Specific curvature feature calculation Mean curvature normal operator K H (v j ) is used to describe the average curvature contribution of vertex j on the local surface, and its calculation formula is as follows: K H (v j )=2H(v j )•n(v j ); where K H (v j ) is the vertex v j The mean curvature normal operator represents the contribution of the vertex to the mean curvature of the local surface, n(v j ) is the vertex v j The unit normal vector is calculated as follows: , where T k T j Represents all containing vertex v j The triangle, v a ,v b ,v c For triangle T k The three vertices are arranged in counterclockwise order, indicating the normal direction H(v j ) is the vertex v j The average curvature is calculated as: ; k1(v j ) and k2(v j ) is the vertex v j The principal curvatures represent the curvature of the surface in the directions of maximum and minimum curvature, respectively.
[0029] Step S4: Defect classification: Classify defects (such as convex, concave, etc.) according to curvature characteristics and height distribution information. Concave-convexity calculation: The calculation formula for single-point concavity and convexity is: ; Where Convex(v) is the concavity value of vertex v, which is used to quantify the degree of concavity in the local area; v is the current vertex; N(v) is the set of neighboring vertices of vertex v; K H (v j ) is the neighborhood vertex v j The mean curvature normal operator of Normal(v j ) is the neighborhood vertex v j is the unit normal vector of ; |N(v)| is the number of neighboring vertices.
[0030] The calculation formula for the overall concavity and convexity of the region is: ; Where A(R) is the total area of region R, A(v k ) is the vertex v k The Voronoi area is used for weighting. Convex(v k ) is the vertex v k The local concavity value of .
[0031] Directional consistency analysis: The directional consistency coefficient α (R) is used to evaluate the consistency of the concave and convex directions within the region: ; Among them: n(v k ) is the vertex v k The unit normal vector, Convex(v k ) is the vertex v k The local concavity value of α(R) ranges from [0,1]. The larger the value, the higher the directional consistency.
[0032] α th is the set directional threshold. If α(R)≥α th , then the concave and convex directions of the region are consistent (the whole is convex or concave), if α(R)<α th , then the concave and convex directions of the region are chaotic (further subdivision detection is required); Step S5: Result output: Generate a defect marking map and calculate relevant characteristic parameters of the defect (such as depth, area, etc.).
[0033] Example 2: Reference Figure 1 As shown, the present invention also provides a defect concave-convex detection system based on height map and curvature analysis, specifically CCD1, projector 2, 3D data acquisition unit 3, data processing unit 4 and display output unit 5, and mark 6 is the object to be tested. Among them: CCD: Utilizes a high-resolution industrial area scan camera (at least 15 megapixels) equipped with a low-distortion lens to ensure adequate resolution of surface defects. This invention utilizes a high-resolution industrial area scan camera with at least 15 megapixels, paired with a low-distortion lens. The high pixel count ensures the camera's ability to capture minute details, while the low-distortion lens effectively reduces image distortion. Together, these two ensure the camera's powerful resolution of surface defects, providing clear, accurate raw image data for subsequent inspection.
[0034] Projector system: Utilizing a high-resolution digital projector, this system achieves structured light encoding by precisely controlling the projection pattern (such as sinusoidal stripes or Gray code), improving 3D reconstruction accuracy. Furthermore, the projection angle is optimized to minimize surface reflection interference and ensure the accuracy of the height map data. This invention utilizes a high-resolution digital projector to precisely control projection patterns such as sinusoidal stripes or Gray code to achieve structured light encoding. Structured light encoding significantly improves 3D reconstruction accuracy, enabling more precise 3D information about product surfaces. Furthermore, the system optimizes the projection angle based on the product's surface material and shape to minimize surface reflection interference, ensuring the accuracy of the height map data and laying a solid foundation for subsequent data processing.
[0035] 3D Data Acquisition Unit: This unit controls the synchronization of structured light projection and camera acquisition, adjusting camera exposure parameters, projection brightness, and trigger timing to ensure the accuracy and stability of point cloud data acquisition. This unit is responsible for precisely controlling the synchronization of structured light projection and camera acquisition. By properly adjusting camera exposure parameters, it ensures appropriate image brightness; optimizes projection brightness for clear and discernible projection patterns; and precisely sets trigger timing to achieve seamless coordination between the camera and projector. This fully ensures the accuracy and stability of point cloud data acquisition, providing a reliable data source for data processing.
[0036] The data processing unit runs the present invention's concavity detection algorithm, which includes preprocessing, concavity calculation, and defect classification. This unit integrates these modules, including preprocessing, concavity calculation, and defect classification. The preprocessing module removes noise from the collected data to improve data quality. The concavity calculation module determines the concavity and convexity of the defect based on height maps and curvature analysis. The defect classification module accurately classifies various defects based on the calculation results.
[0037] Display output unit: displays the inspection results, including defect location, depth, area and other information, and generates quality reports.
[0038] Example 3: A defect concavity and convexity detection algorithm based on height map and curvature analysis includes the following steps: Reference Figure 2-Figure 3As shown, height data acquisition: Use a high-precision structured light scanner to obtain surface point cloud data of the workpiece to be inspected. Convert the point cloud data into a height map to ensure that the data resolution and accuracy meet the inspection requirements, providing high-quality raw data for subsequent processing; Furthermore, a high-precision structured light scanner is used to comprehensively scan the surface of the workpiece to acquire surface point cloud data. This point cloud data records the three-dimensional coordinate information of the workpiece surface. Subsequently, a specialized data conversion algorithm is used to convert the point cloud data into a height map. During this process, strict control is exercised over data acquisition and conversion parameters to ensure that the resolution and accuracy of the height map data meet inspection requirements, providing a high-quality raw data foundation for subsequent algorithm processing.
[0039] Image preprocessing: The acquired height map data is subjected to median filtering to remove the noise generated by the sensor; Gaussian filtering is used for smoothing to eliminate high-frequency noise while maintaining the main curvature features; the height map is normalized to ensure that the data is at a uniform scale for subsequent analysis.
[0040] Curvature analysis: Based on the processed height map data, a local surface model is constructed. For each surface point, its normal curvature and neighborhood curvature characteristics are calculated. For each surface point v j , calculate its average curvature H(v j ) and neighborhood curvature characteristics. The specific calculation formula is as follows: ; Among them, k1(v j ) and k2(v j ) is the principal curvature of the point, which represents the curvature of the surface in the maximum and minimum bending directions. In order to evaluate the concave-convexity of the defect, the relationship between the neighborhood curvature characteristics of the point and the normal vector of the point is calculated to obtain the Convex(v k )value.
[0041] Defect classification: Defects are classified based on the calculated curvature characteristics and height distribution information: If Convex(v k ) is positive, indicating that the area is convex; If Convex(v k ) is negative, indicating that the area is concave; If Convex(v k ) is close to zero, indicating that the area is a flat area or a smooth surface area.
[0042] Convex(v k) values are written into the image, and the defect area is determined by threshold segmentation. By calculating the defect area, depth, regional concavity and convexity, and concavity and convexity consistency, the defect type is further accurately classified.
[0043] In other words, preliminary classification is performed by determining the positive or negative sign of the local region's eigenvalues. A positive eigenvalue indicates a raised area; a negative eigenvalue indicates a sunken area; and a eigenvalue close to zero indicates a flat or smooth area. Precise classification involves writing the eigenvalue of each point into the image and using a threshold segmentation algorithm to identify defect areas. Further, by calculating detailed features such as the defect's area, depth, regional convexity, and concave-convexity consistency, precise classification of defect types is achieved, providing comprehensive data support for subsequent quality assessments.
[0044] Result Output: Outputs inspection results as images or data tables, including detailed information about each defect area (such as location, size, depth, etc.). Generates visual reports based on inspection results to facilitate quality analysis and decision-making by engineers.
[0045] Example 4, based on Example 3, introduces an adaptive curvature threshold adjustment mechanism, and the specific steps are as follows: Perform curvature distribution statistics on the normal area of the workpiece and calculate the mean value μ of the curvature H and standard deviation σ H Based on statistical results, the curvature threshold is dynamically set: H th =μ H +α•σ H Wherein, α is an adjustment coefficient set by the user, which is used to determine the detection sensitivity of the defect. The other defect detection steps are the same as those in Example 3.
[0046] Specifically, after the curvature analysis is completed, the normal area (no obvious defects) is selected from the height map for curvature distribution statistics. By collecting and analyzing the curvature values of all points in these normal areas, the mean curvature μ is calculated. H and standard deviation σ H Based on the above statistical results, the curvature threshold H is dynamically set th , the calculation formula is H th =μ H +α•σ H α is a user-defined adjustment factor. Users can determine the defect detection sensitivity based on their actual inspection needs. When the α value is large, the detection threshold is high, and the algorithm is more rigorous in defect detection, which may result in the omission of smaller defects. When the α value is small, the detection threshold is low, and the algorithm is more sensitive to defects, but may also result in more false detections.
[0047] Verified by this embodiment, after the introduction of the adaptive curvature threshold adjustment mechanism, the defect concave-convexity detection algorithm based on height map and curvature analysis can dynamically adjust the detection threshold according to the actual situation of the workpiece surface, further improving the detection capability of subtle defects, enhancing the adaptability and accuracy of the algorithm, and providing more powerful support for enterprises to improve product quality control level.
[0048] Example 5, based on Examples 3 and 4, introduces a multi-scale curvature analysis method. The specific steps are as follows: Using the multi-scale analysis method, the height map is decomposed into images of different scales by Gaussian pyramid decomposition. Curvature calculation is performed at different scales to obtain a set of multi-scale curvature maps K s (x,y). Integrating curvature information at multiple scales improves the ability to detect defects of different sizes, especially effectively distinguishing large-scale deformations from small-scale defects.
[0049] Specifically, a multi-scale analysis method is used to decompose the preprocessed height map into images of different scales through Gaussian pyramid decomposition. Gaussian pyramid decomposition is a process of downsampling an image, with the image resolution gradually decreasing at each layer, resulting in image representations of different scales. Decomposition is generally performed into 3-5 layers to cover defect scales of varying sizes. For each scale image, the curvature analysis steps in Example 3 are repeated to calculate the curvature features of each surface point, resulting in a set of multi-scale curvature maps. Curvature maps at different scales can reflect features of varying sizes. Large-scale curvature maps primarily reflect large-scale deformations and macroscopic features, while small-scale curvature maps focus more on small-scale defects and detailed information. By integrating curvature information from multiple scales, the curvature features at different scales are fused and analyzed. Methods such as weighted summation can be used to combine curvature maps of different scales to improve the detection capability of defects of different sizes. This approach effectively distinguishes large-scale deformations from small-scale defects, preventing interference from large-scale deformations on small-scale defect detection. Verified by this example, after the introduction of the multi-scale curvature analysis method, the defect convexity detection algorithm based on height map and curvature analysis can more effectively detect defects of different sizes, especially accurately distinguishing large-scale deformations from small-scale defects, further improving the accuracy and reliability of detection, and providing stronger support for enterprises to improve product quality control level.
[0050] The technical principles of the present invention have been described above in conjunction with specific embodiments, which are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions based on the principles of the present invention fall within the scope of protection of the present invention. Those skilled in the art will be able to conceive of other specific embodiments of the present invention without inventive effort, and such methods will fall within the scope of protection of the present invention.
Claims
1. Defect concavity and convexity detection algorithm based on height map and curvature analysis, characterized by: The following steps are involved: Step S1: Height data acquisition, using high-precision three-dimensional measurement equipment to obtain surface height map data; Step S2: Image preprocessing, denoising, smoothing and normalizing the height map data; Step S3: Curvature analysis, based on the processed height map data, construct a local surface model and calculate the curvature characteristics; Step S4: defect classification, calculating the normal vector through the local surface model, calculating the concavity and convexity based on the curvature characteristics and the normal vector, and classifying the defects according to the concavity and convexity; Step S5: Output the results, generate a defect marking map, and calculate the relevant characteristic parameters of the defects.
2. The defect concavity and convexity detection algorithm based on height map and curvature analysis according to claim 1, characterized in that: In step S3: curvature feature calculation, including: Mean curvature normal operator K H (v j ) is used to describe the average curvature contribution of vertex j on the local surface, and its calculation formula is as follows: K H (v j )=2H(v j )•n(v j ); where n(v j ) is the vertex v j The unit normal vector represents the normal direction of the surface at that point. The calculation formula is: , where T k T j Represents all containing vertex v j The triangle, v a ,v b ,v c For triangle T k The three vertices of H(v j ) is the vertex v j The average curvature is calculated as: ;k1(v j ) and k2(v j ) is the vertex v j The principal curvatures represent the curvature of the surface in the directions of maximum and minimum curvature, respectively.
3. The defect concavity and convexity detection algorithm based on height map and curvature analysis according to claim 2, characterized in that: In step S4, defect classification includes concavity and convexity calculation, specifically, the single-point concavity and convexity calculation formula is: ; Where Convex(v) is the concavity value of vertex v, which is used to quantify the degree of concavity in the local area; v is the current vertex; N(v) is the set of neighboring vertices of vertex v; K H (v j ) is the neighborhood vertex v j The mean curvature normal operator of Normal(v j ) is the neighborhood vertex v j The unit normal vector of ; |N(v)| is the number of neighboring vertices; The calculation formula for the overall concavity and convexity of the region is: ; Where A(R) is the total area of region R, A(v k ) is the vertex v k Voronoi area, used for weighting, Convex(v k ) is the vertex v k The local concavity value of Directional consistency analysis: The directional consistency coefficient α(R) is used to evaluate the consistency of the concave and convex directions within the region: ; Among them: n(v k ) is the vertex v k The unit normal vector, Convex(v k ) is the vertex v k The local concavity value of α(R) ranges from [0,1]. The larger the value, the higher the directional consistency. th is the set directional threshold, if α(R)≥α th , then the concave and convex directions of the region are consistent, if α(R)<α th , then the concave and convex directions of the region are chaotic.
4. The defect concavity and convexity detection algorithm based on height map and curvature analysis according to claim 3, characterized in that: In step S2: filtering / smoothing is applied to the height map data I to remove noise: I B =Filter(I); The filter function Filter can be any of the following: Median filter: I B (x,y)=median{I(x+i,y+j)|-k≤i,j≤k}; Where x represents the horizontal coordinate of the image, y represents the vertical coordinate of the image, and i and j represent the relative coordinate offset; Mean filtering: ; Gaussian filtering: ; Where G(i,j) is the Gaussian kernel function: ; The filter kernel size k and Gaussian standard deviation σ need to be selected according to the scale characteristics of the vertical stripes.
5. The defect concavity and convexity detection algorithm based on height map and curvature analysis according to claim 4, characterized in that: In step S4: in classifying defects: if Convex(v k ) is positive, indicating that the area is convex; If Convex(v k ) is negative, indicating that the area is concave; if Convex(v k ) is close to zero, indicating that the area is a flat area or a smooth surface area.
6. The defect concavity and convexity detection algorithm based on height map and curvature analysis according to claim 5, characterized in that: The step S3 also includes: introducing an adaptive curvature threshold adjustment mechanism, the specific steps are as follows: performing curvature distribution statistics on the normal area of the workpiece, and calculating the mean value μ of the curvature H and standard deviation σ H ; Based on statistical results, dynamically set the curvature threshold: H th =μ H +α•σ H ; Among them, α is the adjustment coefficient set by the user, which is used to determine the detection sensitivity of defects.
7. The defect concavity and convexity detection algorithm based on height map and curvature analysis according to claim 6, characterized in that: The step S3 also includes: a multi-scale curvature analysis method, which specifically includes the following steps: using a multi-scale analysis method to decompose the height map into images of different scales through Gaussian pyramid decomposition; performing curvature calculations at different scales to obtain a set of multi-scale curvature maps K s (x, y); integrates curvature information at multiple scales to improve the detection capability of defects of different sizes and is used to distinguish large-scale deformation from small-scale defects.
8. A system using the defect concavity and convexity detection algorithm based on height map and curvature analysis as claimed in claim 4, characterized in that: include: CCD, projector, 3D data acquisition unit, data processing unit and display output unit; the CCD adopts a high-resolution industrial area array camera; The projector uses a high-resolution digital projector to achieve structured light coding by precisely controlling the projection pattern; 3D data acquisition unit: controls structured light projection and camera synchronous acquisition, adjusts camera exposure parameters, projection brightness and trigger timing to ensure the accuracy and stability of point cloud data acquisition; data processing unit includes preprocessing, concave-convexity calculation, and defect classification functional modules; display output unit: displays inspection results, including defect location, depth, and area information, and generates quality reports.
Citation Information
Patent Citations
Heat exchanger welding quality visual detection method and system
CN119850605A
Cited By
Sandy bank beach angle morphological characteristic analysis method based on unmanned aerial vehicle technology
CN121600428A
