Method, device and computer equipment for measuring centerline length of strip-shaped object

By performing specific processing and curve fitting on the image information of irregular strip-shaped objects, the problems of low efficiency and poor accuracy in length measurement of irregular strip-shaped objects in the existing technology are solved, and high-precision and efficient measurement results are achieved.

CN118009894BActive Publication Date: 2024-08-16GUANGDONG COMM POLYTECHNIC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410174411.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-07
Publication Date
2024-08-16
Estimated Expiration
2044-02-07

AI Technical Summary

Technical Problem

It is difficult for existing machine vision systems to accurately measure the length of irregular strip-shaped objects, resulting in low measurement efficiency, poor accuracy, and vulnerability to human factors. It is suitable for measurements of small batches and general accuracy.

Method used

Through anti-binarization processing, connected domain analysis, morphological operations, thinning processing, determination of edge point and support point sequences and interpolation supplementation of the image information of the object to be measured, the curve fitting method is used to accurately restore the strip object. Centerline length.

Benefits of technology

It improves the accuracy and efficiency of centerline length measurement of irregular strip objects, reduces the influence of human factors, and is suitable for large-volume and high-precision measurements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118009894B
    Figure CN118009894B
Patent Text Reader

Abstract

The invention relates to the field of machine vision technology, and discloses a method, a device and a computer device for measuring the centerline length of a strip-shaped object. The invention performs debinarization processing on image information according to a preset threshold value to obtain first image information; performs connected domain analysis on the first image information to determine second image information; performs morphological operation on the second image information according to a preset window to obtain a second morphological image, and optimizes the image information of the object to be measured; uses a refinement algorithm and the second morphological image to determine edge points and centerline images, determines a support point sequence according to the edge points and centerline images, and accurately restores the centerline of the object to be measured; performs interpolation and supplementation on the support point sequence according to the centerline image to obtain an extended support point sequence, so that a curve obtained by subsequent fitting is closer to the centerline of the strip-shaped object; performs curve fitting on the extended support point sequence, and determines the centerline length of the object to be measured according to the length of the curve after fitting, thereby improving the accuracy of the measurement result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine vision technology, and in particular to a method, a device and a computer device for measuring the centerline length of a strip-shaped object. Background Art

[0002] With the development of industrial production and technology, the market has put forward higher requirements for the accuracy and efficiency of length measurement of various objects. Due to its advantages such as fast, non-contact, high accuracy and good repeatability, the measurement technology based on machine vision that has emerged in recent years has been more and more widely used, greatly improving the quality and efficiency of product inspection and accelerating the automation and intelligentization of industrial production and manufacturing.

[0003] For arcs, ellipses, parabolas and other regular curves generated by predetermined parametric equations, current machine vision-based measurement technologies and systems can quickly and accurately measure their lengths. However, in industry, it is often necessary to measure the length of irregular strip-shaped objects, such as the length of irregular metal workpiece curve contours, the length of surface cracks or defects, and the length of various irregular slender curved workpieces.

[0004] However, measuring the length of irregular strip objects has always been a difficult problem. Current machine vision systems are difficult to measure accurately. Manual measurement methods such as soft tape measurement, rope segment fitting measurement, and roller measurement are still needed in engineering and industrial production. The workload is very large, the efficiency is low, the accuracy is not high, and it is easily affected by human factors. The results are not repeatable, so it is only suitable for small batches and general precision measurements. Summary of the invention

[0005] In view of this, the present invention provides a method, device and computer equipment for measuring the centerline length of a strip-shaped object to solve the problem of low efficiency and poor accuracy in measuring the centerline length of a strip-shaped object in the prior art.

[0006] In a first aspect, the present invention provides a method for measuring the centerline length of a strip-shaped object, the method comprising:

[0007] Performing a debinarization process on the pre-acquired image information of the object to be tested according to a preset threshold value to obtain first image information;

[0008] Performing a connected domain analysis on the first image information to determine second image information;

[0009] Performing morphological operation on the second image information according to the preset window to obtain a second morphological image;

[0010] The second form image is thinned by using a thinning algorithm to obtain a centerline image;

[0011] Determine the edge point according to the centerline image and the second morphological image;

[0012] Determine the support point sequence based on the edge point and center line images;

[0013] Interpolate and supplement the support point sequence according to the center line image to obtain an expanded support point sequence;

[0014] The extended support point sequence is subjected to curve fitting, and the center line length of the object to be measured is determined according to the length of the fitted curve.

[0015] Beneficial effect: according to a preset threshold, the image information of the object to be measured that is pre-acquired is debinarized to obtain the first image information; the first image information is subjected to a connected domain analysis to determine the second image information; the second image information is subjected to a morphological operation according to a preset window to obtain a second morphological image, thereby further optimizing the image information of the object to be measured; the edge point and center line images are determined by using a refinement algorithm and the second morphological image, and the support point sequence is determined according to the edge point and center line images, thereby more accurately restoring the center line of the object to be measured; the support point sequence is interpolated and supplemented according to the center line image to obtain an extended support point sequence, thereby making the curve obtained by subsequent fitting closer to the center line of the strip; finally, the extended support point sequence is subjected to curve fitting, and the center line length of the object to be measured is determined according to the length of the fitted curve, thereby improving the accuracy of the measurement result.

[0016] In an optional implementation, the connected domain analysis includes a first connected domain analysis and a second connected domain analysis, and the performing the connected domain analysis on the first image information to determine the second image information specifically includes:

[0017] Performing a first connected domain analysis on the first image information to fill holes in the first image information and determine second sub-image information;

[0018] Perform a second connected domain analysis on the second sub-image information, remove noise points in the second sub-image information, and determine the second image information.

[0019] In an optional implementation, performing a morphological operation on the second image information according to a preset window to obtain a second morphological image specifically includes:

[0020] Performing morphological opening operation on the second image information to obtain a first morphological image;

[0021] The first morphological image of the preset window is subjected to morphological corrosion processing to determine the second morphological image.

[0022] In an optional embodiment, the method further includes:

[0023] An edge image is determined based on the first modality image and the second modality image.

[0024] In an optional implementation, the size of the preset window is smaller than the minimum pixel width in the first modality image.

[0025] In an optional implementation, the thinning algorithm includes a first thinning algorithm and a second thinning algorithm, and the thinning algorithm is used to perform thinning processing on the second morphological image to obtain the centerline image, specifically including:

[0026] Performing initial thinning processing on the second morphological image using a first thinning algorithm to obtain a first centerline image;

[0027] Performing secondary thinning processing on the first centerline image using a second thinning algorithm to obtain a second centerline image;

[0028] The maximum connected domain in the second centerline image is retained to obtain a centerline image.

[0029] In an optional implementation, the edge point includes a first edge point and a second edge point, the second morphological image further includes an edge image, and determining the edge point according to the centerline image and the second morphological image includes:

[0030] Extracting a centerline backbone image with a single pixel width from the centerline image;

[0031] Traversing the pixel points of the centerline backbone image, and determining the endpoint pixel points according to the number of pixel points in the neighborhood of each pixel point, the endpoint pixel points including a first endpoint pixel point and a second endpoint pixel point;

[0032] Determine a first edge point according to the first endpoint pixel point and the edge image;

[0033] A second edge point is determined according to the second endpoint pixel point and the edge image.

[0034] In an optional implementation, extracting a centerline backbone image with a single pixel width in the centerline image specifically includes:

[0035] Traversing the centerline image, determining a set of bifurcation points in the centerline image;

[0036] After setting the i-th pixel value of the bifurcation point set to zero, a connected domain analysis is performed to determine a third connected domain, where the third connected domain includes at least one sub-connected domain, and i is a positive integer greater than or equal to 1;

[0037] When the number of sub-connected domains meets the preset standard, the i-th pixel value is restored;

[0038] According to each restored pixel value, the centerline backbone image is determined.

[0039] In an optional implementation, determining a support point sequence according to edge points and center line images includes:

[0040] Traverse the centerline backbone image from the first edge point, and obtain a first sequence according to all traversed pixel points;

[0041] Pixels with different chain code directions are selected in the first sequence to form a second sequence;

[0042] When the vertical distance between the corresponding pixel point from the second pixel point to the second to last pixel point in the second sequence and the line connecting two adjacent pixels in the second sequence is less than a first preset threshold, the corresponding pixel point is determined to be a non-support point;

[0043] A supporting point sequence is determined according to the second sequence and the non-support points.

[0044] In an optional implementation, the centerline image further includes a centerline backbone image, and the support point sequence is interpolated and supplemented according to the centerline image to obtain an expanded support point sequence, including:

[0045] According to the support point sequence and the centerline backbone image, the number of pixels between every two support points is determined;

[0046] When the number of pixel points is greater than the second preset threshold, the number of interpolation points is determined according to the number of pixel points and the second preset threshold;

[0047] Interpolation points that supplement the number of interpolation points are uniformly interpolated between the two corresponding support points to obtain an extended support point sequence.

[0048] In a second aspect, the present invention provides a device for measuring the centerline length of a strip-shaped object, the device comprising:

[0049] A binarization processing module, used for performing a debinarization process on the pre-acquired image information of the object to be tested according to a preset threshold value to obtain first image information;

[0050] A connected domain processing module, used to determine the second image information according to the pixel value in the first image information and the preset pixel value;

[0051] A morphological processing module, used for performing a morphological operation on the second image information according to a preset window to obtain a second morphological image;

[0052] A refinement module, used for performing refinement processing on the second form image using a refinement algorithm to obtain a centerline image;

[0053] An edge point determination module is used to determine edge points according to the centerline image and the second form image;

[0054] A support point determination module is used to determine a support point sequence based on edge points and center line images;

[0055] An expansion module is used to interpolate and supplement the support point sequence according to the center line image to obtain an expanded support point sequence;

[0056] The length determination module is used to perform curve fitting on the extended support point sequence and determine the center line length of the object to be measured according to the length of the fitted curve.

[0057] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for measuring the centerline length of a strip-shaped object according to the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0058] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for measuring the centerline length of a strip-shaped object according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0060] Figure 1 is a flow chart of a method for measuring the centerline length of a strip-shaped object according to an embodiment of the present invention;

[0061] Figure 2 is a schematic diagram of a strip object according to an embodiment of the present invention;

[0062] Figure 3 is a schematic diagram of a result of inverse binarization according to an embodiment of the present invention;

[0063] Figure 4 is a schematic diagram of the result of filling holes and removing background noise according to an embodiment of the present invention;

[0064] Figure 5 is a schematic diagram of the result of removing foreground burrs according to an embodiment of the present invention;

[0065] Figure 6 According to an embodiment of the present invention Figure 5 Schematic diagram of the result of performing a morphological corrosion operation;

[0066] Figure 7 is a schematic diagram of the result of obtaining the edge of a strip-shaped object using a morphological method according to an embodiment of the present invention;

[0067] Figure 8 is a schematic diagram of a result of obtaining a centerline skeleton using a first thinning algorithm according to an embodiment of the present invention;

[0068] Fig. 9 is a result flow chart of extracting a single-pixel width skeleton by combining the second thinning algorithm and the morphological method according to an embodiment of the present invention;

[0069] Figure 10a-10f is a schematic diagram of a process for removing skeleton burrs according to an embodiment of the present invention;

[0070] Fig.11 is a schematic diagram of a result of obtaining a center line of a strip-shaped object according to an embodiment of the present invention;

[0071] Fig.12 is a schematic diagram of a result of a centerline support point sequence obtained by using a reverse polygon approximation algorithm according to an embodiment of the present invention;

[0072] Fig.13 is a schematic diagram of the result of interpolating and expanding a support point sequence according to an embodiment of the present invention;

[0073] Fig.14 is a schematic diagram of the result of fitting a supporting point sequence using a cubic B-spline curve according to an embodiment of the present invention;

[0074] Fig.15 is a schematic diagram of measurement results of a method for measuring the centerline length of a strip-shaped object according to an embodiment of the present invention;

[0075] Fig.16 is a schematic diagram of a measurement result of a centerline length of a strip-shaped object 1 according to an embodiment of the present invention;

[0076] Fig.17 is a schematic diagram of a measurement result of a centerline length of a strip-shaped object 2 according to an embodiment of the present invention;

[0077] Fig.18 is a schematic diagram of a measurement result of a centerline length of a strip-shaped object 3 according to an embodiment of the present invention;

[0078] Fig.19 is a structural block diagram of a device for measuring the centerline length of a strip-shaped object according to an embodiment of the present invention;

[0079] Fig. 20 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0080] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0081] In this embodiment, a method for measuring the centerline length of a strip-shaped object is provided. Figure 1 is a flow chart of a method for measuring the centerline length of a strip-shaped object according to an embodiment of the present invention. It should be noted that the steps shown in the flow chart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical sequence is shown in the flow chart, in some cases, the steps shown or described can be executed in a different order than that shown here.

[0082] like Figure 1 As shown, the process of the method for measuring the centerline length of a strip object includes the following steps:

[0083] Step S101 : performing debinarization processing on pre-acquired image information of the object to be detected according to a preset threshold value to obtain first image information.

[0084] Exemplarily, the object to be tested may be a strip conductor, specifically, Figure 2 As shown, the image information of the object to be measured can adopt the original picture of the object to be measured taken by an industrial camera, for example, the industrial camera adopts adjustable backlight light source illumination, a 5-megapixel industrial camera, and an industrial lens with a focal length of 25 mm.

[0085] The image information is reversed by using a threshold of 150 to perform binary conversion on the original image (black is the background, the gray value is 0; the white part is the foreground, the gray value is 255), such as Figure 3 As shown, the processed binary image is recorded as the first image information.

[0086] Step S102, performing a connected domain analysis on the first image information to determine second image information;

[0087] Exemplarily, the connected domain analysis method may be used to fill holes in the first image information and remove noise points.

[0088] In a preferred embodiment, the connected domain analysis includes a first connected domain analysis and a second connected domain analysis, and the above step S102 specifically includes:

[0089] Performing a first connected domain analysis on the first image information to fill holes in the first image information and determine second sub-image information;

[0090] Perform a second connected domain analysis on the second sub-image information, remove noise points in the second sub-image information, and determine the second image information.

[0091] For example, Figure 4 The second image information is shown after two 8-domain connected domain analyses are performed on the first image information to fill holes and remove background noise. The first connected domain analysis takes the background color (gray value 0) as the target and retains the largest connected domain, thereby removing holes in the middle of the strip object. Figure 3 There is a hole in the middle and lower part of the middle strip object. The second connected domain analysis takes the foreground color (grayscale value is 255) as the target, retains the largest connected domain, and thus removes the background noise points outside the strip object.

[0092] Step S103: performing a morphological operation on the second image information according to a preset window to obtain a second morphological image.

[0093] Exemplarily, select a preset window size: First, select an appropriate window size according to the requirements. The window size will affect the effect of the morphological operation, so it needs to be selected according to the characteristics of the object to be measured and the expected results. Define morphological operation: According to the specific morphological operation requirements, select appropriate morphological operations, such as corrosion, expansion, opening operation or closing operation. These operations can be used alone or in combination to achieve the expected effect. Apply morphological operation: Use the selected morphological operation to operate on the second image information. The specific implementation method depends on the programming language and image processing library used. Common libraries such as OpenCV, PIL, etc. provide functions for morphological operations. Update the second image information: After the morphological operation, a new second morphological image is obtained. This step usually involves overwriting or replacing the original second image information with the operation result. Iterate or repeat morphological operation: As needed, multiple morphological operations can be performed on the second morphological image to further enhance or weaken specific features.

[0094] In a preferred embodiment, the above step S103 specifically includes:

[0095] Performing morphological opening operation on the second image information to obtain a first morphological image;

[0096] The first morphological image of the preset window is subjected to morphological corrosion processing to determine the second morphological image.

[0097] Exemplarily, a morphological opening operation is performed on the second image information to remove burrs in the foreground to reduce interference with subsequent extraction of the center line of the strip-shaped object. Figure 4 There is an obvious burr in the middle of the ribbon object. Figure 5The result image after the morphological opening operation is performed with a 5×5 rectangular structure element (preset window) as a parameter is recorded as the first morphological image. The edge of the strip object is obtained. The morphological erosion operation is performed on the first morphological image with a 3×3 rectangular structure element as a parameter to obtain the second morphological image.

[0098] The size of the preset window is smaller than the smallest pixel width in the first form image.

[0099] For example, the morphological erosion operation is performed on the first morphological image, and the width of the object is appropriately reduced to improve the algorithm running speed. The size of the rectangular structure element parameter must be smaller than the width of the narrowest part of the strip object to ensure that the strip object remains in the same connected domain after corrosion. In this embodiment, the morphological erosion operation is performed on the first morphological image with a 10×10 rectangular structure element. The results are as follows: Figure 6 This operation is optional and is mainly used to improve the efficiency of subsequent centerline extraction (centerline extraction accounts for most of the running time of the entire algorithm, up to 90% or more). For strip objects with relatively uniform width, the rectangular structural element parameters can be set to be slightly smaller than the width of the object, thereby greatly improving the running speed of the algorithm. For strip objects with a sharp change in the bending direction at the end, this step should be skipped to ensure the accuracy of the measurement.

[0100] The method further includes: determining an edge image according to the first morphological image and the second morphological image. Exemplarily, the edge image of the strip-shaped object with a single pixel width is obtained by subtracting the second morphological image from the first morphological image. Figure 7 is the edge image of the obtained strip-shaped object, and the binary image is recorded as the edge image.

[0101] Step S104: performing a morphological operation on the second image information according to a preset window to obtain a second morphological image.

[0102] For example, the centerline skeleton uses the Zhang-Suen thinning algorithm to thin the second morphological image to obtain a centerline image. The thinning result is as follows: Figure 8 As shown in Figure 2, executing this step accounts for most of the running time of the entire measurement algorithm. Compared with other thinning algorithms, the results of the Zhang-Suen thinning algorithm can fit the center line of the strip object more stably and support parallel operation.

[0103] In a preferred embodiment, the thinning algorithm includes a first thinning algorithm and a second thinning algorithm, and the thinning algorithm is used to perform thinning processing on the second morphological image to obtain the centerline image, specifically including:

[0104] Performing initial thinning processing on the second morphological image using a first thinning algorithm to obtain a first centerline image;

[0105] Performing secondary thinning processing on the first centerline image using a second thinning algorithm to obtain a second centerline image;

[0106] The maximum connected domain in the second centerline image is retained to obtain a centerline image.

[0107] Exemplarily, the above-mentioned Zhang-Suen thinning algorithm has a small amount of pixel redundancy, so the first centerline image is not a single-pixel width contour and needs to be further refined. The Zhang-Suen thinning algorithm is the thinning algorithm used for the initial thinning process. The first centerline image is obtained by thinning the second morphological image with the Zhang-Suen thinning algorithm. The second thinning algorithm uses the Hilditch thinning algorithm to thin the first centerline image, and then performs a connected domain analysis and retains the maximum connected domain (deletes the noise that may appear in the thinning result) to obtain the second centerline image of the binary image. The obtained contour is a single pixel width under the 8-domain definition. The thinning result is as follows: Figure 8 As shown in the figure. The Hilditch thinning algorithm is a serial thinning algorithm that can achieve a more refined thinning effect and can reduce the target outline to a single pixel width. However, if the Hilditch thinning algorithm is used directly without the Zhang-Suen thinning algorithm, the center line of the strip-shaped object may be significantly deviated. Since there are already few target points in the first centerline image that need to be further thinned, this step only takes up a small amount of running time.

[0108] The meaning of the single-pixel-width contour under the 8-domain definition is as follows: ① There is only one foreground point in the 8-domain of the endpoint pixel of the contour line; ② There are only two foreground points in the 8-domain of the common connection point pixel of the contour line; ③ There are 3 or more foreground points in the 8-domain of the bifurcation point pixel of the contour line. It is very important that the obtained contour strictly meets the single-pixel-width contour under the 8-domain definition. This is the prerequisite for the subsequent removal of contour line burrs and the extraction of the complete centerline main branch and its first and last two end points. Therefore, this step is extremely important.

[0109] Step S105, determining edge points according to the centerline image and the second morphological image.

[0110] Exemplarily, edge detection can be performed on the centerline image and the second morphological image respectively using an edge detection algorithm (such as Sobel, Canny, etc.). These algorithms can identify changes in pixel intensity in an image, thereby detecting edge points. According to the results of edge detection, edge points can be further screened by setting a threshold. Only when the pixel intensity change exceeds a certain threshold is it considered an edge point. Since the second morphological image has been subjected to morphological operations, its edges may be more prominent or clear. Therefore, it may be more effective to perform edge detection on the image after morphological operations. The edge points in the centerline image and the second morphological image are matched and compared to determine which points are common edge points. This ensures that the selected edge points exist both on the centerline image and on the second morphological image. The detected edge points are filtered and smoothed to remove noise and abnormal points, so that the position of the edge points is more accurate.

[0111] In a preferred embodiment, the edge point includes a first edge point and a second edge point. The second morphological image also includes an edge image, such as Fig. 9 As shown, the above step S105 includes:

[0112] Step S1051, extracting a centerline backbone image with a single pixel width in the centerline image;

[0113] Exemplarily, the basic idea of ​​burr removal is: first find each bifurcation point set BP, set all pixel values ​​of the bifurcation point set BP to 0, then perform connected domain analysis and retain two connected domains with larger areas, and then restore all pixel values ​​of the bifurcation point set BP to 255. Use a thinning algorithm to process the centerline image. Hilditch thinning algorithm and Zhang-Suen thinning algorithm can be used. These algorithms remove redundant pixels on the centerline in an iterative manner and gradually thin the centerline. When applying the thinning algorithm, set a condition to ensure that the width of the extracted centerline backbone image is a single pixel. This means that during the thinning process, only those adjacent pixels are retained to ensure that the width of the centerline is only one pixel. According to the selected thinning algorithm, set the appropriate number of iterations and termination conditions. When the algorithm iterates to a certain extent or meets specific conditions, stop the thinning process.

[0114] In a preferred embodiment, the above step S1051 specifically includes:

[0115] Step a1, traverse the centerline image to determine a set of bifurcation points in the centerline image;

[0116] Step a2, after setting the i-th pixel value of the bifurcation point set to zero, perform a connected domain analysis to determine a third connected domain, the third connected domain includes at least one sub-connected domain, and i is a positive integer greater than or equal to 1;

[0117] Step a3: when the number of sub-connected domains meets the preset standard, the i-th pixel value is restored;

[0118] Step a4, determining the centerline backbone image according to each restored pixel value.

[0119] For example, the number of foreground pixels in the 8-region surrounding a foreground point (pixel value is 255) is N8(k). The process of skeleton burr removal is as follows: Figure 10a-10f The specific operation method is as follows:

[0120] ① Traverse the second center line image of the image. If you encounter a foreground point P (bifurcation point) with N8(k) greater than or equal to 3, take point P as the seed point and add all points connected to P and with N8(k) greater than or equal to 3 to the bifurcation point set BP (greater than 3 means it is a bifurcation point). If there are m bifurcation points (in this case, m is 3), then m bifurcation point sets will be obtained;

[0121] ② Set the pixel values ​​of all points in the bifurcation point set BP to 0 respectively; then perform connected domain analysis and retain the two connected domains with larger areas. If the difference between the two areas is too large (40 times in this case), it is considered to be the terminal bifurcation point (it often appears when the end of the strip object is not smooth. The bifurcation at this time generally deviates from the center line of the strip object, so it also needs to be removed. At the end of the strip object, this multiple is approximately the ratio of the end width of the strip object to the length of the strip object). Therefore, only the connected domain with the largest area is retained;

[0122] ③ If the number of connected domains retained is 2 (in the case of non-terminal intersections, the preset standard is 2), the pixel values ​​of all points in the bifurcation point set BP are restored to 255 to restore the skeleton to be connected at the intersection;

[0123] ④ Repeat ② and ③ m times to remove the burrs at each bifurcation point respectively;

[0124] ⑤Execute the Hilditch thinning algorithm to delete the redundant foreground points at the intersection and obtain the centerline backbone image.

[0125] Step S1052, traverse the pixel points of the centerline backbone image, and determine the endpoint pixel points according to the number of pixel points in the neighborhood of each pixel point, where the endpoint pixel points include a first endpoint pixel point and a second endpoint pixel point.

[0126] For example, in the centerline backbone image, the pixel point whose number of pixel points in the neighborhood of the corresponding pixel point is 1 is the endpoint pixel point. The strip object includes two endpoints.

[0127] Step S1053, determining a first edge point according to the first endpoint pixel point and the edge image;

[0128] Step S1054, determining a second edge point according to the second endpoint pixel point and the edge image.

[0129] For example, after determining the endpoint, the endpoint is determined based on the centerline backbone image. Since the centerline backbone image is processed by algorithms such as thinning and erosion, the location of the endpoint is not the actual edge point of the strip object, but is still a short distance away from the boundary of the strip object. Therefore, it is necessary to determine the endpoint based on the location of the endpoint pixel and the corresponding edge image, which is the outer contour of the strip object.

[0130] The first endpoint pixel is denoted as p1, and the second endpoint pixel is denoted as p2. If the strip object is significantly bent at the end, the erosion size is set to 1, and the erosion operation in step S103 to improve the thinning efficiency is not required. The nearest intersection of the fitting straight line of the subsequent small terminal segment connected domain (with the same slope, adjusted to pass through p1 and p2) and the edge image foreground is p1 and p2. In this case, p1 and p2 coincide with endP1 and endP2 respectively.

[0131] If the strip object does not bend significantly at such a short end (the total length of the strip object in this case is about 1850 pixels, which is much larger than the erosion size of 10 pixels), the least squares fitting straight line of the small segment connected domain at the end of p1 and p2 is adjusted (the slope remains unchanged, adjusted to pass through p1 and p2), and the nearest neighbor intersection point of the foreground of the edge image of the strip object is used as the two end points of the center line of the strip object, recorded as endP1 and endP2. The two line segments from p1 to endP1 and from p2 to endP2 are taken together with all the foreground points of the center line backbone image as the final center line of the strip object.

[0132] Fig.11 The process of obtaining the center line and two endpoints of the strip object is described, wherein the data point set used for fitting the straight line is obtained by taking a number of connected pixels (50 in this case) from p1 and p2 as the starting points, the slope of the straight line obtained by the least squares fitting result passes through p1 and p2 respectively, endP1 and endP2 are the nearest neighbor intersections of the two straight lines and the foreground of the edge image of the strip object obtained in step S103 at distances p1 and p2, and the two line segments from p1 to endP1 and from p2 to endP2 are used as supplementary line segments of the center line of the strip object in the center line backbone image.

[0133] Step S106, determining a support point sequence according to the edge point and center line image.

[0134] For example, the digital curve reverse polygon approximation algorithm proposed by A Masood is used to obtain the support point sequence of the center line of the strip object. If the center line of the strip object is traversed directly from endP1 to endP2 using the connectivity relationship, and the distances between all the previous and next points are accumulated and summed, the result obtained will be greater than the actual length of the strip object due to the sawtooth effect (4.75% in this case).

[0135] Therefore, according to the position and characteristics of the edge points, those edge points that have a significant impact on the direction of the centerline can be screened out as potential candidate support points. According to the characteristics and direction of the centerline image, the precise position of the support point is determined. This may involve interpolation, fitting, or inference based on a specific algorithm for the centerline. The determined support points are sorted according to their positions on the centerline, and the distance between adjacent support points is ensured to be moderate. Redundant support points can be further screened and removed as needed. The validity and accuracy of the determined support point sequence can be verified by comparing with actual needs and expected results. If necessary, the support point sequence can be adjusted or optimized.

[0136] In a preferred embodiment, the above step S106 includes:

[0137] Traverse the centerline backbone image from the first edge point, and obtain a first sequence according to all traversed pixel points;

[0138] Pixels with different chain code directions are selected in the first sequence to form a second sequence;

[0139] When the vertical distance between the corresponding pixel point from the second pixel point to the second to last pixel point in the second sequence and the line connecting two adjacent pixels in the second sequence is less than a first preset threshold, the corresponding pixel point is determined to be a non-support point;

[0140] A supporting point sequence is determined according to the second sequence and the non-support points.

[0141] For example, the reverse polygon approximation algorithm of the digital curve can be used to obtain the support point sequence of the center line. Specifically, it can be divided into the following two steps:

[0142] ① Extract the chain code inflection point as the second sequence. Use the Freeman chain code (8-connected chain code) to start from the endP1 point, traverse the center line of the strip object, add all the traversed points to the first sequence in turn, and add the points where the Freeman chain code direction changes (hereinafter referred to as the chain code inflection point) to the second sequence. Fig.12 The light gray pixels are the inflection points of the chain code, and the white points are the middle points where the Freeman chain code direction does not change. Because only keeping the inflection points of the chain code can completely restore the center line of the strip object by connecting the end to the end, the inflection points of the chain code have a stronger support effect on the curve.

[0143] ② Extract the support point sequence. Traverse the second point to the second to last point in the second sequence of chain code inflection points to test whether it is a support point. The judgment standard is whether the vertical distance d from the point to the line L connecting the two points before and after in the second sequence reaches the first preset threshold (0.9 in this case). If d<0.9, the point is considered a non-support point and deleted from the second sequence. Repeatedly traverse the second point to the second to last point in the second sequence until there are no points that can be deleted. Finally, the second sequence is the support point sequence.

[0144] Point (x k ,y k ) to the two points before and after (x i ,y i ) and (x j ,y j )The vertical distance d between the line L can be calculated by the following formula.

[0145]

[0146] Step S107: interpolate and supplement the support point sequence according to the center line image to obtain an expanded support point sequence.

[0147] In a preferred embodiment, the centerline image further includes a centerline backbone image, and the above step S107 includes:

[0148] According to the support point sequence and the centerline backbone image, the number of pixels between every two support points is determined;

[0149] When the number of pixel points is greater than the second preset threshold, the number of interpolation points is determined according to the number of pixel points and the second preset threshold;

[0150] Interpolation points that supplement the number of interpolation points are uniformly interpolated between the two corresponding support points to obtain an extended support point sequence.

[0151] For example, some points on the center line of the strip object are used to interpolate and expand the support point sequence to control the distance between adjacent support points. In order to avoid the cumulative measurement error caused by the sawtooth effect, a cubic B-spline curve can be fitted to the support point sequence, and then the length of the center line of the strip object can be estimated by obtaining the length of the B-spline fitting curve.

[0152] However, if the support point sequence of the center line of the strip object is directly used for curve fitting, the fitted B-spline curve will have a large deviation between two support points that are far apart (this curve segment is close to a long straight line segment). Therefore, the support point sequence needs to be interpolated and expanded, and the interpolated points are taken from some points in the first sequence.

[0153] The specific operation is to traverse the support point sequence in turn, and determine the total number of points between the two front and rear support points as N according to the centerline backbone image. When N is greater than the second preset threshold MaxGapNum (MaxGapNum in this case is 20), insert a number of intermediate points evenly so that the number of centerline points between two adjacent points does not exceed MaxGapNum. The number of inserted points insertNum is the result of N divided by MaxGapNum, rounded down. The value of MaxGapNum should be moderate. If it is too large, the fitting curve will still have a large deviation. If it is too small, the smoothness of the fitting curve will be reduced, resulting in a sawtooth effect error in the result. The result after interpolation and expansion of the support point sequence is as follows: Fig.13 As shown (gray pixels).

[0154] Step S108, performing curve fitting on the expanded support point sequence, and determining the centerline length of the object to be measured according to the length of the fitted curve.

[0155] Exemplarily, a cubic B-spline curve is fitted to the interpolated and expanded support point sequence. B-spline curve fitting has the advantages of local modification and high approximation accuracy. A cubic B-spline curve can be fitted for every four support points. The formula for fitting a cubic B-spline curve from four points is as follows:

[0156] P(t)=w0+w1×t+w2×t 2 +w3×t 3 (0≤t≤1)

[0157] in,

[0158]

[0159]

[0160]

[0161] In order to make the fitting result curve pass through the starting point and end point of the center line of the strip object, the first and last points of the support point sequence are copied three times respectively, so that the four initial fitting points P0, P1, P2, and P3 are all the first points of the support points, and the four final fitting points P0, P1, P2, and P3 are all the last points of the support points. Fig.14 is the cubic B-spline curve fitting result (gray curve).

[0162] Get the length of the B-spline fitting curve and get the final measurement result of the length of the center line of the strip object. Traverse each section of the B-spline fitting curve, let t in the formula change from 0 to 1, and increase by 0.01 each time, that is, take 100 points in each section of the B-spline fitting curve, and then add up the distances between all the previous and next points. The result is the final measurement result of the length of the center line of the strip object. Fig.15 It is the final measurement result of the centerline length of the strip object, where “manual measurement length” is the length manually measured when the wire is straightened before bending, and “centerline measurement length of the strip object” is the centerline length measurement result of the algorithm in the state shown in the figure.

[0163] like Fig.16 The figure shows the measurement result of the centerline length of a curved strip hole of a workpiece. The "manually measured length" is the length measured manually by straightening the soft wire after it completely fits the curve, and the result is 220.15mm. The result measured by the method of the present invention is 219.53mm.

[0164] Fig.17 The figure shows the measurement result of the centerline length of a uniform conductor, wherein the "manually measured length" is the length of the conductor manually measured in a straightened state before bending, and the result is 100.00 mm, while the result measured by the method of the present invention is 99.71 mm.

[0165] Fig.18 This is the measurement result of the center line length of a 3mm diameter copper bar. The "manually measured length" is the length manually measured when the copper bar is straightened before bending, and the result is 100.00mm. Since the copper bar will be stretched appropriately after bending, the measurement result will be slightly larger. The result measured by the method of the present invention is 100.63mm.

[0166] The above examples all prove that the length accuracy of the center line of the strip-shaped object measured by the present invention is relatively high.

[0167] The method for measuring the centerline length of a strip-shaped object provided by an embodiment of the present invention performs debinarization processing on pre-acquired image information of an object to be measured according to a preset threshold value to obtain first image information; performs connected domain analysis on the first image information to determine second image information; performs morphological operation on the second image information according to a preset window to obtain a second morphological image, thereby further optimizing the image information of the object to be measured; determines edge points and centerline images using a refinement algorithm and the second morphological image, and determines a support point sequence based on the edge points and the centerline image, thereby more accurately restoring the centerline of the object to be measured; interpolates and supplements the support point sequence based on the centerline image to obtain an extended support point sequence, thereby making the curve obtained by subsequent fitting closer to the centerline of the strip; finally, performs curve fitting on the extended support point sequence, and determines the centerline length of the object to be measured based on the length of the fitted curve, thereby improving the accuracy of the measurement result.

[0168] In this embodiment, a device for measuring the centerline length of a strip-shaped object is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made are not repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0169] This embodiment provides a device for measuring the centerline length of a strip-shaped object. Fig.19 The device comprises:

[0170] A binarization processing module 1901 is used to perform a debinarization process on the pre-acquired image information of the object to be detected according to a preset threshold value to obtain first image information;

[0171] A connected domain processing module 1902 is used to perform connected domain analysis on the first image information to determine second image information;

[0172] The morphological processing module 1903 is used to perform morphological operation on the second image information according to a preset window to obtain a second morphological image;

[0173] A thinning module 1904 is used to perform thinning processing on the second form image using a thinning algorithm to obtain a centerline image;

[0174] An edge point determination module 1905 is used to determine edge points according to the centerline image and the second form image;

[0175] A support point determination module 1906 is used to determine a support point sequence according to edge points and center line images;

[0176] An expansion module 1907 is used to interpolate and supplement the support point sequence according to the center line image to obtain an expanded support point sequence;

[0177] The length determination module 1908 is used to perform curve fitting on the extended support point sequence and determine the centerline length of the object to be measured according to the length of the fitted curve.

[0178] In an optional implementation, the connected domain analysis includes a first connected domain analysis and a second connected domain analysis, and the connected domain processing module specifically includes:

[0179] a filling unit, configured to perform a first connected domain analysis on the first image information, fill holes in the first image information, and determine second sub-image information;

[0180] The denoising unit is used to perform a second connected domain analysis on the second sub-image information, remove noise points in the second sub-image information, and determine the second image information.

[0181] In an optional implementation, the morphological processing module specifically includes:

[0182] An opening operation unit, used for performing a morphological opening operation on the second image information to obtain a first morphological image;

[0183] The erosion unit is used to perform morphological erosion processing using the first morphological image of the preset window to determine the second morphological image.

[0184] In an optional embodiment, the device is also used for:

[0185] An edge image is determined based on the first modality image and the second modality image.

[0186] In an optional implementation, the size of the preset window is smaller than the minimum pixel width in the first modality image.

[0187] In an optional implementation, the refinement algorithm includes a first refinement algorithm and a second refinement algorithm, and the refinement module specifically includes:

[0188] A first thinning unit, configured to perform initial thinning processing on the second morphological image using a first thinning algorithm to obtain a first centerline image;

[0189] A second thinning unit, used for performing secondary thinning processing on the first centerline image using a second thinning algorithm to obtain a second centerline image;

[0190] A centerline unit is determined to retain the maximum connected domain in the second centerline image, thereby obtaining a centerline image.

[0191] In an optional implementation, the edge point includes a first edge point and a second edge point, the second morphological image also includes an edge image, and the edge point determination module includes:

[0192] Determine a centerline backbone unit for extracting a centerline backbone image with a single pixel width in the centerline image;

[0193] An endpoint determination unit is used to traverse the pixel points of the centerline backbone image and determine the endpoint pixel points according to the number of pixel points in the neighborhood of each pixel point, wherein the endpoint pixel points include a first endpoint pixel point and a second endpoint pixel point;

[0194] A first edge point determining unit, configured to determine a first edge point according to a first endpoint pixel point and an edge image;

[0195] The second edge point determining unit is used to determine the second edge point according to the second endpoint pixel point and the edge image.

[0196] In an optional implementation, determining the centerline backbone unit specifically includes:

[0197] A bifurcation point determination subunit is used to traverse the centerline image and determine a set of bifurcation points in the centerline image;

[0198] A connected domain analysis subunit is used to set the i-th pixel value of the bifurcation point set to zero, and then perform a connected domain analysis to determine a third connected domain, where the third connected domain includes at least one sub-connected domain, and i is a positive integer greater than or equal to 1;

[0199] A pixel restoration subunit is used to restore the i-th pixel value when the number of sub-connected domains meets a preset standard;

[0200] The backbone image determination subunit is used to determine the centerline backbone image according to each restored pixel value.

[0201] In an optional implementation, the support point determination module includes:

[0202] A first sequence determination unit, configured to traverse the centerline backbone image from the first edge point, and obtain a first sequence according to all traversed pixel points;

[0203] A second sequence determination unit is used to select pixel points with different chain code directions in the first sequence to form a second sequence;

[0204] a non-support point determination unit, configured to determine that a corresponding pixel point between a second pixel point and a second to last pixel point in the second sequence is a non-support point when a vertical distance between a corresponding pixel point and a line connecting two adjacent pixels in the second sequence is less than a first preset threshold;

[0205] The support point determination unit is used to determine the support point sequence according to the second sequence and the non-support points.

[0206] In an optional implementation, the centerline image further includes a centerline backbone image, and the expansion module includes:

[0207] A determination unit for determining the number of pixels between every two support points according to the support point sequence and the centerline backbone image;

[0208] An interpolation point determination unit, configured to determine the number of interpolation points according to the number of pixels and the second preset threshold when the number of pixels is greater than the second preset threshold;

[0209] The expansion unit is used to uniformly interpolate interpolation points that supplement the number of interpolation points between two corresponding support points to obtain an expanded support point sequence.

[0210] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0211] The strip object centerline length measuring device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0212] The embodiment of the present invention also provides a computer device having the above Fig.19 A device for measuring the center line length of a strip-shaped object is shown.

[0213] See also Fig. 20 , Fig. 20 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig. 20 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 20A processor 10 is taken as an example.

[0214] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0215] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0216] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0217] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0218] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0219] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0220] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for measuring the centerline length of a strip-shaped object, It is characterized in that The method comprises: Performing a debinarization process on the pre-acquired image information of the object to be tested according to a preset threshold value to obtain first image information; Performing a connected domain analysis on the first image information to determine second image information; Performing a morphological operation on the second image information according to a preset window to obtain a second morphological image; Using a thinning algorithm to perform thinning processing on the second morphological image to obtain a centerline image; Determining edge points according to the centerline image and the second morphological image includes: The edge point includes a first edge point and a second edge point, the second morphological image also includes an edge image, and determining the edge point according to the centerline image and the second morphological image includes: Extracting a centerline backbone image with a single pixel width from the centerline image includes: Traversing the centerline image to determine a set of bifurcation points in the centerline image; After setting the i-th pixel value of the bifurcation point set to zero, performing a connected domain analysis to determine a third connected domain, wherein the third connected domain includes at least one sub-connected domain, and i is a positive integer greater than or equal to 1; When the number of the sub-connected domains meets a preset standard, the i-th pixel value is restored; Determine the centerline backbone image according to each restored pixel value; Traversing the pixel points of the centerline backbone image, and determining the endpoint pixel points according to the number of pixel points in the neighborhood of each pixel point, wherein the endpoint pixel points include a first endpoint pixel point and a second endpoint pixel point; Determining the first edge point according to the first endpoint pixel point and the edge image; Determining the second edge point according to the second endpoint pixel point and the edge image; Determining a support point sequence according to the edge point and the center line image includes: Traversing the centerline backbone image from the first edge point, and obtaining a first sequence according to all traversed pixel points; Selecting pixel points with different chain code directions in the first sequence to form a second sequence; When a vertical distance between a corresponding pixel point from the second pixel point to the second to last pixel point in the second sequence and a line connecting two adjacent pixels in the second sequence is less than a first preset threshold, determining that the corresponding pixel point is a non-support point; Determine a supporting point sequence according to the second sequence and the non-support points; Interpolating and supplementing the support point sequence according to the center line image to obtain an expanded support point sequence; The extended support point sequence is subjected to curve fitting, and the length of the center line of the object to be measured is determined according to the length of the fitted curve.

2. The method according to claim 1, It is characterized in that The connected domain analysis includes a first connected domain analysis and a second connected domain analysis. The performing of the connected domain analysis on the first image information to determine the second image information specifically includes: Performing a first connected domain analysis on the first image information to fill holes in the first image information and determine second sub-image information; Perform a second connected domain analysis on the second sub-image information, remove noise points in the second sub-image information, and determine the second image information.

3. The method according to claim 1 or 2, It is characterized in that The performing morphological operation on the second image information according to the preset window to obtain the second morphological image specifically includes: Performing morphological opening operation on the second image information to obtain a first morphological image; The first morphological image is subjected to morphological corrosion processing using a preset window to determine a second morphological image.

4. The method according to claim 3, It is characterized in that The method further comprises: An edge image is determined according to the first morphological image and the second morphological image.

5. The method according to claim 4, It is characterized in that The size of the preset window is smaller than the smallest pixel width in the first morphological image.

6. The method according to claim 5, It is characterized in that The thinning algorithm includes a first thinning algorithm and a second thinning algorithm. The thinning algorithm is used to perform thinning processing on the second morphological image to obtain a centerline image, specifically including: performing initial thinning processing on the second morphological image using the first thinning algorithm to obtain a first centerline image; Performing secondary thinning processing on the first centerline image using the second thinning algorithm to obtain a second centerline image; The maximum connected domain in the second centerline image is retained to obtain the centerline image.

7. The method according to claim 6, It is characterized in that The centerline image also includes a centerline backbone image, and the interpolation and supplementation of the support point sequence according to the centerline image to obtain an expanded support point sequence includes: Determine the number of pixels between every two supporting points according to the supporting point sequence and the centerline backbone image; When the number of pixel points is greater than a second preset threshold, determining the number of interpolation points according to the number of pixel points and the second preset threshold; Interpolation points that supplement the number of interpolation points are uniformly interpolated between the corresponding two supporting points to obtain an extended supporting point sequence.

8. A device for measuring the centerline length of a strip-shaped object, It is characterized in that The device comprises: A binarization processing module, used for performing a debinarization process on the pre-acquired image information of the object to be tested according to a preset threshold value to obtain first image information; A connected domain processing module, used for performing connected domain analysis on the first image information to determine second image information; A morphological processing module, used for performing a morphological operation on the second image information according to a preset window to obtain a second morphological image; A thinning module, used for performing thinning processing on the second morphological image using a thinning algorithm to obtain a centerline image; An edge point determination module, used for determining edge points according to the centerline image and the second morphological image, comprises: The edge point includes a first edge point and a second edge point, the second morphological image also includes an edge image, and determining the edge point according to the centerline image and the second morphological image includes: Extracting a centerline backbone image with a single pixel width from the centerline image includes: Traversing the centerline image to determine a set of bifurcation points in the centerline image; After setting the i-th pixel value of the bifurcation point set to zero, performing a connected domain analysis to determine a third connected domain, wherein the third connected domain includes at least one sub-connected domain, and i is a positive integer greater than or equal to 1; When the number of the sub-connected domains meets a preset standard, the i-th pixel value is restored; Determine the centerline backbone image according to each restored pixel value; Traversing the pixel points of the centerline backbone image, and determining the endpoint pixel points according to the number of pixel points in the neighborhood of each pixel point, wherein the endpoint pixel points include a first endpoint pixel point and a second endpoint pixel point; Determining the first edge point according to the first endpoint pixel point and the edge image; Determining the second edge point according to the second endpoint pixel point and the edge image; A support point determination module, used to determine a support point sequence according to the edge points and the center line image, comprising: Traversing the centerline backbone image from the first edge point, and obtaining a first sequence according to all traversed pixel points; Selecting pixel points with different chain code directions in the first sequence to form a second sequence; When a vertical distance between a corresponding pixel point from the second pixel point to the second to last pixel point in the second sequence and a line connecting two adjacent pixels in the second sequence is less than a first preset threshold, determining that the corresponding pixel point is a non-support point; Determine a supporting point sequence according to the second sequence and the non-support points; An expansion module, used for interpolating and supplementing the support point sequence according to the center line image to obtain an expanded support point sequence; The length determination module is used to perform curve fitting on the extended support point sequence and determine the center line length of the object to be measured according to the length of the fitted curve.

9. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for measuring the centerline length of a strip-shaped object according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for measuring the centerline length of a strip-shaped object according to any one of claims 1 to 7.