A method for quantifying the area of defects and closing of bent hairpin-shaped regions
By performing image acquisition, preprocessing, and closure processing on bent fuzz defects, the problem of large deviation between traditional algorithm-quantified area and manual judgment is solved, achieving accurate quantification of defect area and consistent detection, which is suitable for industrial automated inspection.
Patent Information
- Application Number
- CN202511358760.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-23
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-09-23
AI Technical Summary
When identifying and quantifying significantly bent fuzz defects, existing technologies show significant discrepancies between traditional linear skeleton extraction algorithms and human judgment, resulting in poor consistency of detection results and failing to meet the high-precision requirements of industry.
A method for closing curved fuzzy clump-like regions and quantifying defect areas is adopted, including image acquisition, preprocessing, skeletonization, segmentation, arc fitting, and closed region formation. The angle between the fitted arc segments is used to determine whether it exceeds a semicircle. The skeleton segments are completed using convex hull to generate the final defect mask and calculate the area.
It achieves accurate quantification of defect area, improves the consistency and reliability of detection, and the system has anti-interference capabilities under different imaging environments, reducing manual intervention and improving detection efficiency and consistency.
Smart Images

Figure CN120852507B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of image processing and computer vision technology, and in particular to a method for closing curved, fuzzy, clump-like regions and quantifying defect areas in industrial automated inspection. Background Technology
[0002] In the field of industrial defect detection, the identification and quantification of fuzzy defects are crucial. Existing technologies mostly use linear skeleton extraction to identify fuzz; however, when fuzz is significantly bent, the human eye subjectively perceives it as a clump rather than a thin, elongated thread. The defect area quantified by traditional algorithms based on the linear skeleton deviates significantly from human judgment, directly affecting the consistency of product results and failing to meet the high-precision inspection requirements of industrial production.
[0003] To address the aforementioned issues, this invention proposes a method for closing clump-like regions of bent fuzz and quantifying defect area. By performing reasonable clump-like region closure processing on bent fuzz, the defect area can be accurately quantified, improving the consistency and reliability of detection. Summary of the Invention
[0004] In existing industrial defect detection, for significantly bent fuzzy defects, the area quantified by traditional linear skeleton extraction algorithms deviates greatly from human judgment, resulting in poor consistency of results. This invention aims to solve this problem.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] A method for closing curved, fuzzy, clump-like regions and quantifying defect areas includes the following steps:
[0007] Step S1: Acquire images of the target area containing the bent fuzz defect to obtain the original image;
[0008] Step S2: Preprocess the original image to obtain a binarized defect region image, and then perform skeletonization processing on the binarized defect region to obtain a defect skeleton curve with a single pixel width.
[0009] Step S3: Segment the defect skeleton curve to obtain multiple skeleton segments; and perform circular arc fitting on each skeleton segment to obtain the corresponding fitting circle and the start point, end point and midpoint of the circular arc segment.
[0010] Step S4: Construct a triangle based on the start point, end point, and midpoint of the arc segment. Determine whether the arc segment exceeds a semicircle by judging the included angle between the corresponding midpoints of the arcs in the triangle. For arc segments that exceed a semicircle, use the convex hull to complete the area between the beginning and end of the skeleton segment to form a closed region.
[0011] Step S5: Merge all closed regions to generate the final defect mask, calculate the actual area of the defect based on the defect mask, and determine whether the defect is qualified according to the preset area threshold.
[0012] Furthermore, in step S1, image acquisition uses a high-resolution industrial camera with a resolution of 5120×5120 pixels and a pixel size of 0.00345mm / px, and is illuminated by a ring light source.
[0013] Furthermore, the preprocessing in step S2 includes joint bilateral filtering and adaptive threshold segmentation; the local threshold of each pixel is calculated through adaptive threshold segmentation; and the skeletonization process uses the Zhang-Suen skeletonization algorithm.
[0014] Furthermore, the specific process of segmenting the defect skeleton curve in step S3 is as follows: a straight line segment is established between the start and end points of the skeleton curve. The distance from all skeleton control points to this straight line is calculated. The control point with the largest distance is selected. If the distance exceeds a preset threshold, the current line segment is divided into two segments at this control point. The above process is repeated recursively for each subdivided line segment until the maximum deviation of all line segments is less than the threshold. For the three dividing points of adjacent line segments, if the three points are not collinear, a circle is used to fit these three points. The maximum deviation of the actual skeleton curve from the arc in this segment is calculated. If the deviation is less than the threshold, the original two straight line segments are merged into one arc segment. Otherwise, the recursive process continues until it is impossible to merge further.
[0015] Furthermore, in step S3, the geometric algorithm is used to fit the arc of each skeleton segment to obtain the fitted circle and the starting point, ending point and midpoint of the arc segment, where the midpoint of the arc is the point from the starting point along the arc length to the midpoint position.
[0016] Furthermore, the specific method for determining the size of the included angle between the midpoints of the corresponding arcs in the triangle in step S4 is as follows: calculate the cosine value of the included angle between vectors CA and CB, where C is the midpoint of the arc, A is the starting point, and B is the ending point. If the cosine value is less than 0, the included angle is obtuse and the arc segment is less than a semicircle; if the cosine value is greater than 0, the included angle is acute and the arc segment exceeds a semicircle.
[0017] The present invention has the following beneficial effects:
[0018] By fitting circular arcs and performing closure processing, irregular defect areas such as bent fuzz can be naturally clustered. The closed defect areas are highly consistent with actual manual visual inspection results, solving the problem of large deviations between traditional algorithms' quantified area and human judgment. The combined method of bilateral filtering and adaptive threshold segmentation gives the system strong anti-interference capabilities against changes in illumination and subtle noise, enabling stable extraction of defect information under different imaging environments. The skeleton segmentation based on the Ramer algorithm effectively avoids false detections caused by excessive closure of long straight segments, ensuring efficient processing and accurate representation of complex curves or bent defects; simultaneously, the constraint on the radius of the fitted circle further improves processing accuracy. From image acquisition, preprocessing, skeletonization, segmentation, fitting, judgment to area quantization and result output, the entire process is automated, reducing manual intervention and improving detection efficiency and consistency. This method is suitable for the identification and quantification of various bent fuzz defects in industrial automated inspection and can be applied to multiple fields such as textiles, electronics, and precision manufacturing, demonstrating broad applicability. Attached Figure Description
[0019] Figure 1 This is a partial structural schematic diagram of the image capturing device mentioned in an embodiment of the method for closing and quantifying the area of a curved tuft of hair in this invention.
[0020] Figure 2 This is a flowchart mentioned in an embodiment of the method for closing curved tufted regions and quantifying defect area according to the present invention.
[0021] Figures 3a-3c This is a process diagram of image processing mentioned in an embodiment of the method for closing and quantifying the area of curved fuzzy clumps of regions according to the present invention. Figure 3a For the original image, Figure 3b The image after bilateral filtering. Figure 3c This is the defect map extracted after using adaptive thresholding.
[0022] Figures 4a-4c This is a diagram illustrating the process of skeletonization and circle fitting mentioned in an embodiment of the method for closing curved fuzzy clump regions and quantifying defect area of the present invention. Figure 4a The red line in the image represents the skeleton of the defect. Figure 4b The skeleton is divided into multiple segments, represented by colored lines. Figure 4c To determine whether a triangle exceeds a semicircle by fitting a circle to a given line segment and then identifying the triangle type based on its intersection points, we can use this method. Figure 4c The middle part is a schematic diagram of a circle that exceeds half a circle.
[0023] Figure 5This is a schematic diagram of the final result of the method for closing and quantifying the area of a curved tufted region according to the present invention. The defect result is fitted and filled, and the area is calculated. The number of pixels after fitting the defect is 4400, so the area is: 4400×0.00345×0.00345=0.052371mm². Detailed Implementation
[0024] The present invention will now be further described in conjunction with the accompanying drawings and relevant knowledge, and will be described clearly and completely. Obviously, the described applications are only some embodiments of the present invention, and not all embodiments.
[0025] The present invention will be further described in detail below with reference to the accompanying drawings.
[0026] Reference Figures 1-5 As shown in Example 1, a method for closing curved fuzzy clump-like regions and quantifying defect area includes the following steps:
[0027] Step S1: Image Acquisition: A high-resolution industrial camera is used to image the target area containing the bent fuzz defect. The camera resolution is 5120×5120 pixels, capable of acquiring high-quality images with rich details; the pixel size is 0.00345mm / px, suitable for high-precision measurement of minute defects; a ring light source is used for illumination to effectively eliminate the influence of shadows, enhance the contrast between the defect and the background, and acquire the original image. (Refer to...) Figure 1 As shown, this is an image capturing device, which includes a camera lens 1 and a ring light source 2 at the bottom.
[0028] In this invention, a clear original image containing the bent fuzz defect is acquired during the image acquisition process. A high-resolution camera ensures that minute defect details are captured, and a ring light source enhances the contrast between the defect and the background, reducing shadow interference. The industrial camera parameters are adjusted to a resolution of 5120×5120 pixels and a pixel size of 0.00345mm / px. The ring light source is then turned on, and the target area is photographed to obtain the original image.
[0029] Step S2: Image preprocessing and skeletonization; specifically including: joint bilateral filtering, which denoises the original image while maintaining clear edges. The spatial weight parameter is 7, and the grayscale weight parameter is 9. These parameters can be flexibly adjusted according to the actual noise level to reduce the interference of image noise on subsequent processing.
[0030] In this invention, joint bilateral filtering is used to remove noise from the original image while maintaining the clarity of defect edges. This avoids noise being misidentified as a defect or interfering with defect identification, ensuring the accuracy of subsequent segmentation. By setting the spatial weight parameter to 7 and the grayscale weight parameter to 9, joint bilateral filtering is applied to the original image. By weighted averaging of the neighboring pixels of each pixel in the image, the weights consider both spatial distance and grayscale similarity, achieving noise removal while preserving edges.
[0031] Adaptive threshold segmentation applies a local adaptive thresholding algorithm, using 200×200 pixels as processing blocks, calculating the local threshold for each pixel to obtain a binary mask, achieving highly robust defect segmentation, and accurately separating the defect region from the background.
[0032] Adaptive thresholding segmentation automatically adjusts the segmentation threshold based on the brightness distribution of local image regions, separating defect areas from the background to obtain binary defect areas. It can accurately separate defect areas even in complex backgrounds or under varying lighting conditions, improving the robustness of defect segmentation. Using a 200×200 pixel processing block, a local threshold is calculated for each pixel within that block. Pixel grayscale values are compared to the local threshold; pixels greater than the threshold are marked as defects (foreground), and pixels less than or equal to the threshold are marked as background, resulting in a binary mask.
[0033] Skeletonization processing involves applying the Zhang-Suen thinning algorithm to the entire binary mask image. This algorithm is an efficient iterative thinning algorithm that can shrink the target region in the binary image into a skeleton line with a single pixel width. Through multiple scans and conditional judgments, pixels are gradually stripped away, preserving the main structure and topological information of the defect, effectively reducing morphological noise, and obtaining a defect skeleton curve with a single pixel width.
[0034] In this invention, the Zhang-Suen skeletonization algorithm shrinks the binarized defect region into a skeleton line with a width of one pixel, preserving the main structure and topological information of the defect. This simplifies the representation of the defect, facilitating subsequent analysis and processing of the defect morphology, while reducing the impact of morphological noise. The binary mask is scanned multiple times. In each scan, a preset condition is used to determine whether a pixel can be stripped, preserving the skeleton pixels. After multiple iterations, a defect skeleton curve with a width of one pixel is finally obtained.
[0035] Step S3: Skeleton curve segmentation processing; specifically including: a skeleton contour line-circular arc hybrid segmentation method based on the Ramer (Douglas-Peucker) algorithm;
[0036] Polygon approximation involves establishing a straight line segment between the start and end points of the skeleton curve, calculating the distance from all skeleton control points to this straight line, selecting the control point with the largest distance, and if this distance exceeds a preset threshold of 4, then dividing the current line segment into two segments at that control point, and recursively repeating the above process for each subdivided line segment until the maximum deviation of all line segments is less than the threshold.
[0037] Arc fusion, to further reduce the number of segments and accurately represent the arc features of the skeleton, examines three dividing points (end points and midpoint) of adjacent line segments based on the polygon approximation results. If the three points are not collinear, an attempt is made to fit them with a circle. If the maximum deviation between the fitted arc and the actual skeleton is less than a threshold of 4, the original two line segments are merged into an arc segment. This process is recursively repeated until no further merging is possible, resulting in multiple skeleton segments.
[0038] For each skeleton segment, a geometric algorithm is used to fit the arc to obtain the corresponding fitted circle, and the starting point A, ending point B, and midpoint C of the arc segment are determined. The midpoint C is the point from the starting point A along the arc length to the midpoint.
[0039] Determining whether an arc segment exceeds a semicircle: Based on the obtuse triangle criterion, construct a triangle with the starting point A, ending point B, and midpoint C of the arc segment. Calculate the cosine of the angle between vectors CA and CB. If the cosine is less than 0, then ∠ACB is an obtuse angle, and the arc segment is less than a semicircle; if the cosine is greater than 0, then ∠ACB is an acute angle, and the arc segment exceeds a semicircle.
[0040] Step S4: Closed region formation. For arc segments determined to exceed a semicircle, the region between the beginning and end of the skeleton segment is filled using the convex hull to form a closed region. Refer to Figure 4 for the skeletonization and fitted circle diagram. Figure 4a The red line in the image represents the skeleton of the defect; Figure 4b The skeleton is divided into multiple segments, represented by colored line segments; Figure 4c To determine whether a triangle exceeds a semicircle by fitting a circle to a given line segment and then identifying the triangle type based on its intersection points, we can use this method. Figure 4c The middle part is a schematic diagram of a circle that exceeds half a circle.
[0041] Step S5: Defect Area Quantization: Merge all closed regions to generate the final defect mask. Based on the pixel size of 0.00345mm / px, calculate the actual area of the defect region using the following formula: Area = Number of defect pixels × 0.00345mm / px × 0.00345mm / px.
[0042] Defect judgment: The area judgment threshold is set to 0.8 square millimeters. When the defect area is greater than this threshold, it is judged as unqualified (NG); otherwise, it is judged as qualified (OK).
[0043] The specific process of the method for closing curved fuzzy clump-like regions and quantifying defect area according to the present invention is as follows: (Refer to...) Figure 2 As shown, the system first captures and acquires the target image. Then, image processing technology is used for defect detection, identifying defect areas in the image. The detected defects are converted into skeleton line structures for subsequent analysis. Based on this skeleton information, the system segments the defects and fits circles. After completing the skeleton-fitted circle, it attempts to combine the intersections of the defects and the fitted circles into triangles and determines whether these triangles are obtuse triangles. If they are not obtuse triangles, the process ends; if they are, it proceeds to the defect filling and merging stage, followed by area calculation and judgment to further evaluate the defects.
[0044] In the process of segmenting the skeleton curve in this invention, the continuous skeleton curve is divided into multiple line segments (straight lines or arcs) that reflect its geometric characteristics. This facilitates targeted processing of different parts of the skeleton curve and accurately expresses the arc-shaped characteristics of the curve. First, the skeleton curve is recursively segmented through polygon approximation to obtain straight line segments; then, the segmentation points of adjacent straight line segments are judged by arc fitting, and if the conditions are met, they are merged into arc segments, ultimately resulting in multiple skeleton segments.
[0045] The geometric algorithm performs arc fitting; it fits each skeleton segment to obtain a circle that approximates the segment along with relevant feature points (start point, end point, and midpoint of the arc). Irregular skeleton segments are represented by regular arcs, facilitating the assessment of their curvature. Using the geometric algorithm, the parameters of the fitted circle are calculated based on the pixel coordinates of the skeleton segments, determining the start point A, end point B, and midpoint C of the arc segment.
[0046] The determination of arc segments based on the included angle of a triangle; determining whether the arc segment exceeds a semicircle, and whether it needs to be closed into a clumped region. Accurately distinguishing hairs with different degrees of curvature, closing curved hairs that exceed a semicircle to conform to the human eye's perception of a clumped region. Constructing a triangle with the starting point A, ending point B, and the midpoint C of the arc, calculating the cosine of the angle between vectors CA and CB, and determining whether the angle is obtuse or acute based on the sign of the cosine value, thus determining whether the arc segment exceeds a semicircle.
[0047] A closed region is formed by completing the arc segment that exceeds the semicircle, thus forming a closed, clustered region.
[0048] This ensures that the quantified defect area matches the clumped area observed manually, improving the accuracy of area quantification. For arc segments determined to exceed a semicircle with a radius within a reasonable range, the area between the beginning and end of the skeleton segment is completed using convex hull to form a closed region.
[0049] Defect area quantification: Based on the final defect mask, the actual area of the defect is calculated. This achieves accurate quantification of the defect area, providing a basis for product conformity assessment. The number of defective pixels in the defect mask is counted, and based on a pixel size of 0.00345 mm / px, the actual defect area is calculated using the formula: Area = Number of defective pixels × 0.00345 mm / px × 0.00345 mm / px.
[0050] Defect judgment: Based on a preset area threshold, determine whether the product is qualified. This automates the product qualification judgment, ensuring consistency of results. The calculated defect area is compared to a preset threshold of 0.8 square millimeters; if it exceeds the threshold, it is judged as NG (Not Good); otherwise, it is judged as OK.
[0051] In this invention, image acquisition provides the basic data for all subsequent processing. High resolution and suitable light source ensure the quality of the original image, enabling joint bilateral filtering and adaptive thresholding to process the image more effectively and improve the accuracy of defect segmentation.
[0052] Furthermore, the combined bilateral filtering for denoising and edge preservation creates favorable conditions for adaptive threshold segmentation, making the segmented binarized defect regions more accurate; and accurate binarized defect regions are a prerequisite for the Zhang-Suen skeletonization algorithm to extract reliable skeleton curves.
[0053] The skeleton curve segmentation process is based on a reliable skeleton curve, which is divided into appropriate line segments to provide a reasonable processing unit for arc fitting. The accuracy of arc fitting directly affects the determination of whether the subsequent arc segment exceeds a semicircle.
[0054] The determination of arc segments based on the included angle of triangles provides a basis for judging the formation of closed regions. Only arc segments exceeding a semicircle are closed, avoiding unnecessary closure. After the closed regions are formed, the merged defect mask is the basis for defect area quantification. The result of defect area quantification is the basis for defect judgment. By using a preset area threshold, the automatic judgment of product qualification is realized, ultimately achieving accurate identification and area quantification of bending and fuzzing defects.
[0055] This invention mainly includes the following processes: image acquisition and preprocessing of the defect area to obtain a skeletonized binary image; segmentation of the skeleton based on the discrete curvature of the skeleton curve; and circular arc fitting of each skeleton segment using a least-squares circle fitting algorithm. The fitting circle determination process includes constraining the radius of the circle obtained by fitting the arc segment. The arc fitting is considered valid only when the radius is within the set minimum and maximum radius range, thus avoiding misjudgment and over-closure. Furthermore, the obtuse triangle determination rule is used to determine whether the fitted arc segment crosses a semicircle. Specifically, on the fitted arc segment, three points—the start point, the end point, and the midpoint of the arc chord—are selected to construct a triangle. The included angle corresponding to the midpoint is calculated. If the included angle is greater than 90 degrees, the arc segment is less than a semicircle and is not closed; if the included angle is less than or equal to 90 degrees, the arc segment crosses a semicircle and is closed. For arc segments determined to cross a semicircle, the fitted arc is used to complete the area between the beginning and end of the skeleton segment, generating a closed region. All closed regions are merged into the final defect mask, and the actual defect area is calibrated according to the pixel size. By setting an area threshold, when the defect area is greater than the threshold, an unacceptable (NG) result is output; otherwise, an acceptable (OK) result is output.
[0056] Example 2, a method for closing curved fuzzy clump-like regions and quantifying defect area, specifically includes: defect skeleton extraction and segmentation:
[0057] First, an adaptive thresholding method is used to extract defective regions from the original image. This method automatically adjusts the segmentation threshold based on the brightness distribution of different regions of the image, ensuring accurate separation of defective regions even under complex backgrounds or varying lighting conditions.
[0058] Subsequently, after the defect region segmentation was completed, the binarized defect region was processed using the Zhang-Suen skeletonization algorithm: The Zhang-Suen algorithm is an efficient iterative thinning algorithm that can shrink the target region in the binary image into a skeleton line with a single pixel width; through multiple scans and conditional judgments, pixels are gradually stripped away, preserving the main structure and topological information of the defect, and effectively reducing morphological noise.
[0059] Finally, a straight line segment is established between the start and end points of the skeleton curve, and the distance from all skeleton control points to this line is calculated. The control point with the largest distance is selected. If this distance exceeds a preset threshold (4 in this invention), the current line segment is divided into two segments at that control point, and the above process is repeated recursively for each subdivided line segment until the maximum deviation of all line segments is less than the threshold. To further reduce the number of segments and better reflect the arc characteristics of the curve, for the three dividing points of adjacent line segments (i.e., the endpoints and the middle common point of two adjacent line segments), if the three points are not collinear, an attempt is made to fit these three points with a circle to obtain an approximate arc. Then, the maximum deviation of the actual skeleton curve from the arc in this segment is calculated. If this deviation is less than a certain threshold (4 in this invention), the original two straight line segments are merged into one arc segment and marked as processed objects; otherwise, the recursive processing continues until no further merging is possible.
[0060] Circle Fitting and Determination: After fitting the circular arc segment of each skeleton contour, in order to determine whether the arc segment is larger than a semicircle (more than 180°), this invention adopts a determination method based on the center point of the arc segment. The specific steps are as follows:
[0061] Arc fitting involves using a geometric algorithm to fit each arc segment to obtain the corresponding circle, and determining the starting point A, ending point B, and center point C of that arc segment. The center point C typically refers to the midpoint of the arc length, that is, the point on the fitted arc where one travels along the arc length from the starting point A to the midpoint.
[0062] To determine the included angle of a triangle, construct a triangle formed by points A, C, and B, and calculate the included angle ∠ACB:
[0063] If ∠ACB is an obtuse angle (the included angle is greater than 90°), then the arc segment is less than a semicircle; if ∠ACB is an acute angle (the included angle is less than 90°), then the arc segment exceeds a semicircle (i.e., the arc length is greater than the corresponding semicircle). This can be determined by the cosine of the angle between vectors CA and CB (cosθ < 0 indicates an obtuse angle, cosθ > 0 indicates an acute angle).
[0064] If the angle is determined to be obtuse, the curvature of the defect does not exceed a semicircle; otherwise, it exceeds a semicircle.
[0065] When a defect bends beyond a semicircle, it appears as a blob to the naked eye. This invention fills the defect and outputs the final fitted area.
[0066] Although some embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and all such changes and variations should be within the scope of the present invention.
Claims
1. A method for closing curved, fuzzy, clump-like regions and quantifying defect area, characterized in that, Includes the following steps: Step S1: Acquire images of the target area containing the bent fuzz defect to obtain the original image; Step S2: Preprocess the original image to obtain a binarized defect region image, and then perform skeletonization processing on the binarized defect region to obtain a defect skeleton curve with a single pixel width. Step S3: Segment the defect skeleton curve to obtain multiple skeleton segments; and perform circular arc fitting on each skeleton segment to obtain the corresponding fitting circle and the start point, end point and midpoint of the circular arc segment. Step S4: Construct a triangle based on the start point, end point, and midpoint of the arc segment. Determine whether the arc segment exceeds a semicircle by judging the included angle between the corresponding midpoints of the arcs in the triangle. For arc segments that exceed a semicircle, use the convex hull to complete the area between the beginning and end of the skeleton segment to form a closed region. Step S5: Merge all closed regions to generate the final defect mask, and calculate the actual area of the defect based on the defect mask; And based on the preset area threshold, the system determines whether the defect is acceptable.
2. The method according to claim 1, characterized in that, In step S1, image acquisition is performed using a high-resolution industrial camera, along with a ring light source for illumination.
3. The method according to claim 1, characterized in that, The preprocessing in step S2 includes joint bilateral filtering and adaptive thresholding; the local threshold for each pixel is calculated through adaptive thresholding; and the skeletonization process uses the Zhang-Suen skeletonization algorithm.
4. The method according to claim 1, characterized in that, The specific process of segmenting the defect skeleton curve in step S3 is as follows: Establish a straight line segment between the start and end points of the skeleton curve, calculate the distance from all skeleton control points to the straight line, select the control point with the largest distance, if the distance exceeds a preset threshold, divide the current line segment into two segments at the control point, and recursively repeat the above process for each subdivided line segment until the maximum deviation of all line segments is less than the threshold; for the three dividing points of adjacent line segments, if the three points are not collinear, fit these three points with a circle, calculate the maximum deviation of the actual skeleton curve from the arc in this segment, if the deviation is less than the threshold, merge the original two straight line segments into one arc segment, otherwise continue the recursive process until it is impossible to merge further.
5. The method according to claim 1, characterized in that, In step S3, the geometric algorithm is used to fit the arc of each skeleton segment to obtain the fitting circle and the starting point, ending point and midpoint of the arc segment, where the midpoint of the arc is the point from the starting point along the arc length to the midpoint position.
6. The method according to claim 1, characterized in that, The specific method for determining the size of the included angle between the midpoints of the corresponding arcs in the triangle in step S4 is as follows: calculate the cosine value of the included angle between vectors CA and CB, where C is the midpoint of the arc, A is the starting point, and B is the ending point. If the cosine value is less than 0, the included angle is obtuse and the arc segment is less than a semicircle; if the cosine value is greater than 0, the included angle is acute and the arc segment exceeds a semicircle.
Citation Information
Patent Citations
Power transmission line hidden risk and fault detection method based on image identification technology
CN105447530A
Defect layering detection method of glass cover plate automatic detection system
CN111189854A