Multi-curvature line structured light high-precision center extraction method and system
By preprocessing and refining the skeleton of the line structured light image, combined with normal field calculation and adaptive grayscale gravity center method, the center of the line structured light is extracted, which solves the high image background requirements and high algorithm complexity in the existing technology. problem, improving detection accuracy and calculation efficiency.
Patent Information
- Application Number
- CN202410174594.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-07
- Publication Date
- 2024-09-13
AI Technical Summary
Existing line structured light center extraction methods have problems such as high image background requirements, high algorithm complexity, and long calculation time.
The multi-curvature line structured light high-precision center extraction method is adopted, and the initial line structured light image is obtained for preprocessing and denoising. The multi-threshold segmentation method is used to obtain the binary image. The EPTA algorithm is used to obtain the skeleton points, and deletion and retention conditions are set for the skeleton. The points are refined, and the center of the line structured light is extracted by combining normal field calculation and adaptive gray center of gravity method.
The detection accuracy and calculation efficiency are improved, the edge interference of the light strip caused by uneven reflection is overcome, and the accurate extraction of the light strip area is achieved.
Smart Images

Figure CN118644540A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic information technology, and in particular to a high-precision center extraction method and extraction system for multi-curvature line structured light. Background Art
[0002] With the rapid development of science and technology, 3D measurement technology has been widely used in computer vision, medical testing, construction monitoring and unmanned driving. In 3D measurement technology, laser is one of the important tools for obtaining 3D information of the surface of an object. Laser can be divided into three types: point laser, line laser and surface laser. Considering measurement accuracy and stability, line laser is the most widely used in practical engineering. The accuracy of point cloud data required for 3D reconstruction depends on the accuracy of extracting the center of line structured light. Therefore, it is necessary to extract the center of line structured light through corresponding algorithms.
[0003] The complexity of line structured light depends on the surface features of the object being measured, the laser light intensity and the surrounding environment. The general structure can be divided into arc segments, sharp angles and straight line segments. Most algorithms often find it difficult to take these features into account. Line structured light center extraction algorithms are mainly divided into two categories: one is the center extraction method based on the geometric center of gravity, such as the extreme value method, edge method, skeleton refinement method, etc., which can better detect the peak value of the laser stripe, but has high requirements on the image background. The other is the center extraction method based on the energy center of gravity, such as the Steger algorithm, directional template method, grayscale center of gravity method, curve fitting method, etc., which has high robustness, but the algorithm is highly complex and takes a long time to calculate. It can be seen that the existing line structured light center extraction methods have the problems of high image background requirements, complex algorithms and long calculation time. Summary of the invention
[0004] The present invention provides a high-precision center extraction method and extraction system for multi-curvature line structured light, so as to solve the problems of high image background requirements, complex algorithms and long calculation time in the existing center extraction methods of line structured light.
[0005] In order to achieve the above object, the present invention is implemented by the following technical solutions:
[0006] In a first aspect, the present invention provides a method for high-precision center extraction of multi-curvature line structured light, comprising:
[0007] Acquire an initial line structured light image of the target line structured light, and perform preprocessing and noise removal on the initial line structured light image to obtain a smoothed line structured light image;
[0008] The multi-threshold segmentation method is used to segment the smooth line structured light image to obtain a binary image;
[0009] Using the EPTA algorithm to obtain all initial skeleton points in the binary image, and constructing skeleton neighborhood points with the initial skeleton points as the center;
[0010] Setting a deletion condition, when the skeleton domain point meets the deletion condition, marking the initial skeleton point corresponding to the skeleton domain point for deletion, setting a retention condition, when the initial skeleton point with the to-be-deleted mark meets the retention condition, canceling the to-be-deleted mark of the initial skeleton point, and deleting the initial skeleton point marked for deletion to obtain the target skeleton point;
[0011] Performing refinement processing on the target skeleton points to remove burrs and obtain final skeleton points;
[0012] A normal field calculation is performed on the final skeleton point to obtain a normal angle of the final skeleton point, and the center of the target line structured light is extracted through the normal angle of the final skeleton point.
[0013] Optionally, the preprocessing and denoising of the initial line structured light image to obtain a smoothed line structured light image includes:
[0014] The initial line structured light image is preprocessed and denoised using Gaussian filtering to obtain a denoised smoothed line structured light image. The Gaussian filtering uses a two-dimensional zero-mean Gaussian function, and its expression is shown in the following formula:
[0015]
[0016] Among them, the parameter σ is the variance.
[0017] Optionally, the adopting a multi-threshold segmentation method to segment the smooth line structured light image to obtain a binary image includes:
[0018] The initial threshold and grayscale of the smooth line structured light image are set, and the pixels in the smooth line structured light image are divided into the first type of pixels and the second type of pixels based on the initial threshold and grayscale. The optimal threshold is determined based on the initial threshold and grayscale using the maximum inter-class variance idea. The determination method is shown in the following formula:
[0019]
[0020]
[0021]
[0022] Among them, Pi is the proportion of points with gray level i in the first category of pixels;
[0023]
[0024]
[0025]
[0026] μ1 is the grayscale mean within a certain range, when the inter-class variance When it is at the maximum, Thbest1 = Th1;
[0027]
[0028]
[0029] Among them, Thbest1 is the best threshold of the first type of pixels, and similarly, the best threshold of the second type of pixels is determined to be Thbest2;
[0030] The smooth line structured light image is separated into a binary image by using the optimal threshold of the first type of pixels and the optimal threshold of the second type of pixels as follows:
[0031]
[0032] Among them, Thbest1 is the best threshold of the first type of pixels, Thbest2 is the best threshold of the second type of pixels, and Th is the initial threshold.
[0033] Optionally, constructing a skeleton neighborhood point with the initial skeleton point as the center includes:
[0034] Eight neighborhoods are constructed with each point in the initial skeleton point as the center point, so that the eight neighborhoods and the center point form a nine-square grid arrangement.
[0035] Optionally, the deletion condition includes:
[0036] D1 (P1×P3=1)&&(P2+P5+P6+P7=0);
[0037] D2 (P3×P5=1)&&(P1+P4+P7+P8=0);
[0038] D3 (P1×P7=1)&&(P3+P4+P5+P8=0);
[0039] D4 (P5×P7=1)&&(P1+P2+P3+P6=0);
[0040] D5 (P2+P4+P6+P8=0)&&(P1+P3+P5+P7=3);
[0041] When the skeleton domain point satisfies any one of the deletion conditions D1-D5, the initial skeleton point corresponding to the skeleton domain point is marked for deletion.
[0042] Optionally, the retention condition includes:
[0043] R1 P1×P3×P4+P 6+ =1;
[0044] R2 P2×P3×P5+P8=1;
[0045] R3 P4×P5×P7+P2=1;
[0046] R4 p1×p2×p7+P4=1;
[0047] When the initial skeleton point with a to-be-deleted mark meets the four retention conditions R1-R4, the to-be-deleted mark of the initial skeleton point is cancelled.
[0048] Optionally, the step of performing a thinning process on the target skeleton points to remove burrs and obtain final skeleton points includes:
[0049] Divide the target skeleton points into endpoints, nodes and bifurcation points, and calculate the first geodesic distance from each point on the target skeleton point to the nearest bifurcation point;
[0050] Calculate the second geodesic distance from each point on the target skeleton to the nearest endpoint, and calculate the sum of the first geodesic distance and the second geodesic distance of each point on the target skeleton;
[0051] Set the minimum branch length. When the sum of the first geodesic distance and the second geodesic distance of each point on the target skeleton is less than the minimum branch length, mark the point as the first burr point, and remove the bifurcation point from the first burr point to obtain the second burr point.
[0052] Compare the first geodesic distance and the second geodesic distance of each point in the second burr point, and when the first geodesic distance of the point is greater than the second geodesic distance, delete the point from the second burr point to obtain a third burr point;
[0053] Find a point in the third burr point where the first geodesic distance is 0 and use the point as the bifurcation point in the third burr point, and compare the second geodesic distance of the bifurcation point in the third burr point with the second geodesic distance of each point in the third burr point. When the second geodesic distance of the bifurcation point in the third burr point is less than the second geodesic distance of a point in the third burr point, use the point as the compensation point.
[0054] The second burr point is removed from the target skeleton point and the replenished point is replenished back to the target skeleton point from which the second burr point is removed to obtain the final skeleton point.
[0055] Optionally, performing normal field calculation on the final skeleton point to obtain the normal angle of the final skeleton point includes:
[0056] With the final skeleton point as the center, a window of size w×w is constructed in the smooth line structured light image, and the gradient of each point in the window is calculated by the Sobel operator [G x (i,j),Gy (i,j)] T , thus obtaining the average gradient of each point, as shown in the following formula:
[0057]
[0058] The average square gradient of the window is as follows:
[0059]
[0060] Window gradient angle Then the normal angle α is calculated as follows:
[0061]
[0062] Where α is the normal angle.
[0063] Optionally, extracting the center of the target line structured light through the normal angle of the final skeleton point includes:
[0064] The initial center in the smooth line structured light image is obtained by the adaptive grayscale centroid iteration method. Let the coordinates of the initial center P be (u i ,v i ), points P0 and P1 are both on the normal line of the point, located on the left and right respectively. The distances from P are L0 and L1 respectively, then the coordinates of P0 and P1 can be expressed as:
[0065] x0=u i -L0·sinα;
[0066] y0=v i -L0·cosα;
[0067] x1=u i +L1·sinα;
[0068] y1=u i +L1·cosα;
[0069] Select n pixels at each end of the normal line of the skeleton point in the filtered image, and use the following calculation formula to calculate the center of the target line structured light:
[0070]
[0071]
[0072] Among them, (u c ,v c ) is the final center coordinate, Gx and Gy are the coordinates of the column and row pixels respectively, p i 、p i′ is the gray level corresponding to the pixel point, m is the power. When 0 < m < 1, the extracted centroid approaches the centroid of the normal distribution closer as m decreases until it reaches stability. Initialize m0 = T, calculate the difference Δo between the centroids obtained when m = m0 and m = m0 / 2. When Δo > ε (ε is the self-defined error range), take m0 = 0.9T for iterative calculation until the condition is satisfied.
[0073] In a second aspect, an embodiment of the present application provides a high-precision center extraction system for multi-curvature line structured light, including a processor and a memory;
[0074] The memory is used to store computer programs;
[0075] The processor is used to implement the method steps described in any one of the first aspect when executing the program stored on the memory.
[0076] Beneficial effects:
[0077] The high-precision center extraction method for multi-curvature line structured light provided by the present invention preprocesses and denoises the initial line structured light image to obtain a smooth line structured light image, segments the smooth line structured light image to obtain a binary image, uses the EPTA algorithm to obtain all initial skeleton points in the binary image, and sets deletion conditions and retention conditions to delete points in the initial skeleton points to obtain target skeleton points, thereby performing thinning processing on the target skeleton points to remove burrs to obtain final skeleton points, and finally calculating the normal field of the final skeleton points to obtain the normal angle of the final skeleton points, and extracting the center of the target line structured light through the normal angle of the final skeleton points; initially obtaining the line structured light center through the improved EPTA (Enhanced Parallel Thinning Algorithm) skeleton thinning method, then calculating the normal field using the Sobel operator, and finally using the adaptive iterative gray centroid method to optimize in the normal direction of the skeleton center to obtain a sub-pixel level center. This method overcomes the interference of the light strip edge caused by uneven reflection, accurately extracts the light strip area, and improves the detection accuracy and calculation efficiency. Description of the Drawings
[0078] Figure 1 It is a flowchart of the high-precision center extraction method for multi-curvature line structured light according to a preferred embodiment of the present invention;
[0079] Figure 2 It is a schematic diagram of Gaussian filtering according to a preferred embodiment of the present invention, where (a) represents before Gaussian filtering and (b) represents after Gaussian filtering;
[0080] Figure 3Schematic diagram of the ROI region of a preferred embodiment of the present invention, wherein (a) represents the original line structured light image, (b) represents the Otsu multi-threshold segmentation, (c) represents the initial ROI region, (d) represents the pixel difference extracted from the regional segmentation, and (e) represents the final extracted ROI region;
[0081] Figure 4 A schematic diagram of neighborhood construction for a preferred embodiment of the present invention;
[0082] Figure 5 A schematic diagram of skeleton point classification according to a preferred embodiment of the present invention;
[0083] Figure 6 A schematic diagram of the nearest bifurcation point search according to a preferred embodiment of the present invention;
[0084] Figure 7 A schematic diagram of sub-pixel center extraction according to a preferred embodiment of the present invention;
[0085] Figure 8 Schematic diagram of the linear structured light image and extraction effect of the preferred embodiment of the present invention, wherein (a) continuous linear structured light, (b) truncated linear structured light, (c) the enlarged part of the local area of the extraction result of (a) by the algorithm of this paper, and (d) the extraction result of (b) by the algorithm of this paper. DETAILED DESCRIPTION
[0086] The technical solution of the present invention is described clearly and completely below. Obviously, the described embodiments are only 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0087] Unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the usual meanings understood by persons with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "one" do not indicate quantity restrictions, but indicate the existence of at least one. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship also changes accordingly.
[0088] Example 1
[0089] See also Figure 1-7The present application embodiment provides a method for extracting the center of a multi-curvature line structured light with high precision, comprising:
[0090] Acquire an initial line structured light image of the target line structured light, and perform preprocessing and noise removal on the initial line structured light image to obtain a smoothed line structured light image;
[0091] The multi-threshold segmentation method is used to segment the smooth line structured light image to obtain a binary image;
[0092] Using the EPTA algorithm to obtain all initial skeleton points in the binary image, and constructing skeleton neighborhood points with the initial skeleton points as the center;
[0093] Setting a deletion condition, when the skeleton domain point meets the deletion condition, marking the initial skeleton point corresponding to the skeleton domain point for deletion, setting a retention condition, when the initial skeleton point with the to-be-deleted mark meets the retention condition, canceling the to-be-deleted mark of the initial skeleton point, and deleting the initial skeleton point marked for deletion to obtain the target skeleton point;
[0094] Performing refinement processing on the target skeleton points to remove burrs and obtain final skeleton points;
[0095] A normal field calculation is performed on the final skeleton point to obtain a normal angle of the final skeleton point, and the center of the target line structured light is extracted through the normal angle of the final skeleton point.
[0096] In the above embodiment, the initial line structured light image is preprocessed and denoised to obtain a smooth line structured light image, and the smooth line structured light image is segmented to obtain a binary image, and the EPTA algorithm is used to obtain all initial skeleton points in the binary image, and deletion conditions and retention conditions are set to delete the points in the initial skeleton points to obtain target skeleton points, so that the target skeleton points are refined to remove burrs to obtain final skeleton points, and finally the normal field of the final skeleton points is calculated to obtain the normal angle of the final skeleton points, and the center of the target line structured light is extracted through the normal angle of the final skeleton points; the line structured light center is preliminarily obtained through the improved EPTA (Enhanced Parallel Thinning Algorithm) skeleton refinement method, and then the normal field is calculated using the Sobel operator, and finally the adaptive iterative grayscale centroid method is used to optimize in the normal direction of the skeleton center to obtain the sub-pixel center, which overcomes the interference of the light strip edge caused by uneven reflection, accurately extracts the light strip area, and improves the detection accuracy and calculation efficiency.
[0097] The specific scheme in the embodiment is as follows:
[0098] 1. Gaussian filtering
[0099] The intensity of the laser stripe cross section roughly satisfies the Gaussian distribution. The ideal light stripe is bright, uniform and robust. However, in the actual environment, the surface of the object and the surrounding light are complex and changeable. There are noise and low brightness areas in the image, as well as false light spots formed by object scattering. In order to eliminate the influence of noise, Gaussian filtering is used to smooth the edge of the light stripe. The two-dimensional zero-mean Gaussian function is shown in formula (1):
[0100]
[0101] The parameter σ is the variance, which determines the width of the Gaussian distribution. After filtering with a 3×3 Gaussian convolution kernel, the noise burrs are significantly reduced. The pixel distribution is compared. Figure 2 shown.
[0102] 2. ROI light strip area extraction
[0103] The two-stage Otsu optimal multi-threshold segmentation method is used to segment the line structured light image. The initial threshold Th is set. The image has a total of L = 256 gray levels (gray levels are 0 to 255). The pixels with gray levels between 0≤P≤Th are divided into the first category. The total number of pixels in this category is N1. The optimal threshold Thbest1 is determined based on the idea of maximum inter-class variance, as shown in formulas (2) to (5).
[0104]
[0105] Where Pi is the proportion of points with gray level i in the first category of pixels.
[0106]
[0107] μ1 is the grayscale mean within a certain range, when the inter-class variance When it is at maximum, Thbest1=Th1.
[0108]
[0109]
[0110] Similarly, the pixels with gray levels Th+1≤P≤255 are classified into the second category, the total number of pixels in this category is N2, and the best threshold Thbest2 is determined. The image is segmented as follows using multiple thresholds and then converted into a binary image.
[0111]
[0112] Analyze the binary image A obtained by the above method to find the break positions. Divide the original image into M regions on a row basis, and use the Otsu algorithm for each region to obtain the threshold Ti of that region. Convert each region into the corresponding binary image B according to the threshold. Use B to fill in the pixels of the broken part in A. Finally, use morphological closing operation to eliminate isolated pixels and smooth the contour of the line structured light bar, increasing the continuity of the light bar. The effect is as Figure 3 shown.
[0113] 3. Improved EPTA skeleton thinning method
[0114] The skeleton obtained by thinning the binary light bar image using the traditional EPTA algorithm usually has redundant pixels and skeleton burrs. To eliminate the redundant pixels among them, construct an 8-neighborhood centered on the skeleton points, and the order of each point is as Figure 4 shown.
[0115] When any one of the deletion conditions of D1 to D5 in the following formula (7) is satisfied by the 8-neighborhood points, tentatively determine that the skeleton point is a deletable point.
[0116] Among them, D1 to D4 can distinguish diagonal redundant pixels, and D5 can distinguish redundant pixels at the bifurcation points.
[0117]
[0118] At the same time, to ensure the continuity of the skeleton, when the skeleton points that meet the deletion conditions meet the four retention conditions of formula (8) R1 to R4, it is determined that the point is not a redundant pixel and can be retained.
[0119]
[0120] The skeleton points are usually divided into three categories: endpoints, nodes, and bifurcation points. As Figure 5 shown, the present invention proposes the following method to remove burrs:
[0121] Find all the endpoints EP(i,j) and bifurcation points BP(i,j) in the single-pixel-wide skeleton points skel(i,j);
[0122] Calculate the geodesic distance (i.e., the optimal path) from each point on the skeleton to the nearest bifurcation point to obtain the set DB(i);
[0123] Calculate the geodesic distance from each point on the skeleton to the nearest endpoint to obtain the set DE(i);
[0124] Set the minimum branch length minT. When DB(i) + DE(i) < minT, mark the point as a suspected burr point to obtain the set of suspected burr points Nubs1(i,j);
[0125] Delete the forking points from Nubs1(i, j), and update the set to Nubs2(i, j) = Nubs1(i, j) - BP(i, j);
[0126] Update the set of skeleton points to skel2(i, j) = skel(i, j) - Nubs2(i, j). Compared with the original skeleton, the new skeleton subtracts the burr points, but may also delete some real skeleton nodes, so a point supplement operation is required;
[0127] When the points on the burr branch are closer to the burr endpoints, satisfying DE(i) < DB(i), delete such points from Nubs2(i, j), and update the set to Nubs3(i, j);
[0128] For each point (i, j) in Nubs3(i, j), construct an 8-neighborhood block on the original skeleton image for searching, and the search path is as Figure 6 shown. Find the point with a value of 0 in DB(i), that is, the nearest forking point nearB to (i, j), and return the position of this forking point;
[0129] In Nubs3(i, j), if DE(i, j) > DE(nearB), it means that this point belongs to the skeleton node, and supplement this point in skel2(i, j) to obtain the final skeleton skel3(i, j).
[0130] 4. Sobel operator calculation method for normal field
[0131] The Sobel operator is often used for the calculation of the direction field in fingerprint images. In the present invention, the normal field of the skeleton points in the light stripe is calculated, and then the center of the new light stripe is optimized by using the centroid method in the normal direction. Taking the skeleton point as the center, construct a window of size w×w in the filtered image, and calculate the gradient [G x (i, j), G y (i, j)] T of each point in the window through the Sobel operator, so as to obtain the average gradient of each point, as shown in formula (9)
[0132]
[0133] Then the average square gradient of the window is as shown in formula (10)
[0134]
[0135] Window gradient angle Then the normal angle α is as follows
[0136]
[0137] 5. Optimization by adaptive gray centroid iteration method
[0138] After calculating the normal angles of each skeleton point, the sub-pixel center is optimized by using the adaptive gray center of gravity iterative method in the normal direction of this point, as Figure 7 shown.
[0139] Let the coordinates of the initial center P be (u i , v i ). Points P0 and P1 are both on the normal line of this point, located on the left and right sides respectively, and the distances from P are L0 and L1 respectively. Then the coordinates of P0 and P1 can be expressed as:
[0140] x0 = u i - L0·sinα (12)
[0141] y0 = v i - L0·cosα
[0142] x1 = u i + L1·sinα (13)
[0143] y1 = u i + L1·cosα
[0144] n pixel points are selected at both ends of the normal line of the skeleton point in the filtered image, and the new center of the light strip is calculated by using formulas (14) and (15):
[0145]
[0146]
[0147] where (u c , v c ) are the final center coordinates. Gx and Gy are the coordinates of the column and row pixels respectively, p i , p i ' are the gray levels corresponding to the pixel points. m is the power. When 0 < m < 1, the extracted center of gravity approaches the center of gravity of the normal distribution more and more as m decreases until it reaches stability. Initialize m0 = T, calculate the difference Δo between the centers of gravity obtained when m = m0 and m = m0 / 2. When Δo > ε (ε is the self-defined error range), take m0 = 0.9T for iterative calculation until the condition is satisfied.
[0148] Embodiment 2
[0149] Please refer to Figure 8 , this embodiment of the present application also provides a high-precision center extraction system for multi-curvature line structured light, including a processor and a memory;
[0150] The memory is used to store computer programs;
[0151] The processor is used to implement any method step in the method for high-precision center extraction of multi-curvature line structured light when executing the program stored in the memory.
[0152] In order to verify the effectiveness of this algorithm, the platform is designed with a binocular vision system and a tooth model is selected as the test object. The light source is a green line laser, the resolution of the CMOS industrial camera is 2448×2048, and the two-dimensional translation stage can move in the xz direction with a minimum resolution of 10μm. Image processing is implemented using MATLAB 2020b software on a computer with an Intel i5-1200H CPU and 16G RAM. The experimental results are analyzed from three aspects: deviation, continuity, and real-time performance, and compared with the extraction effects of the Steger algorithm, the directional template method (DTM), and the dual threshold grayscale centroid method (DT-GGM).
[0153] 1. Deviation
[0154] In practice, the center value of line structured light is often unknown, and the residual is usually used Instead of the true value, the Bessel function is used to obtain the standard error σ to judge the accuracy of the extraction, as shown in formula (16):
[0155]
[0156] where x i is the measured value, n is the number of extracted center points, is the average value of all pixel coordinates. Table 1 shows the results of the four algorithms. Figure 8 (a) and (b) are the error comparisons of the extraction results of two non-uniform linear structured light images. As shown in Table 1, compared with other algorithms, the standard error of this algorithm is the smallest, proving that the algorithm has the highest extraction accuracy. And as shown in (c) and (d), this algorithm has a good extraction effect on low-brightness non-robust and truncated light strips, and there is no breakpoint phenomenon, which shows that the algorithm is highly robust.
[0157] Table 1 Analysis of standard error of center extraction
[0158]
[0159] In order to overcome the problem of unknown center value of the light bar, this paper generates a simulated Gaussian beam image with a size of 401×401 and a known center value. Gaussian noise with a mean of 0 and variances of 0.01, 0.02, 0.03, 0.04, and 0.05 is added to the image. The root mean square error (RMSE) of the center extracted by the four algorithms under different noises deviates from the true center is calculated, as shown in formula (17):
[0160]
[0161] Table 2 is the comparison result of the four algorithms. As can be seen from Table 2, the deviation of the Steger algorithm in the extracted light strip center is zero, but in fact the Steger algorithm cannot extract the center points at both ends of the light beam, and there is a problem of local information loss; the directional template method is most sensitive to noise, and as the noise increases, it gradually fails to achieve the function of center extraction; compared with the other two algorithms, the algorithm in this paper is closer to the result of the Steger algorithm, and the error fluctuation degree is smaller as the noise increases, which proves that the algorithm has good noise resistance and high robustness.
[0162] Table 2 Analysis of the root mean square error of center extraction
[0163]
[0164] Note: / indicates that the algorithm fails to work under this condition and no result can be obtained.
[0165] 2. Continuity
[0166] Continuity is a very important indicator for testing the center extraction algorithm. It directly affects the accuracy of point cloud information in 3D reconstruction, thereby affecting the reconstruction accuracy. In order to verify the algorithm's ability to extract multi-curvature discontinuous light strips, this paper tested multiple laser images obtained by scanning tooth models and selected the four most representative images. This method can accurately obtain the center of the light strip in small curvature and truncated areas, and does not generate redundant points. The connection is smooth and the trend conforms to the characteristics of the light strip structure. Therefore, it can be proved that the algorithm in this paper has a good extraction effect in multi-curvature line structured light.
[0167] 3. Real-time
[0168] In order to analyze the time consumed by the algorithm, four different pictures were selected, and the average of 10 operations was taken for the extraction time of each picture by the four algorithms. The results are shown in Table 3. As can be seen from the table, the Steger algorithm needs to use the Hessian matrix to calculate the normal field, which takes the longest time. The average running time of the algorithm in this paper is about one tenth of the Steger algorithm and about one half of the directional template method. The dual threshold grayscale centroid method has the shortest running time, but the algorithm can only operate between rows or columns, and breakpoints are very likely to appear at the corners of the light strip.
[0169] Table 3 Running time of each algorithm
[0170]
[0171] In order to further verify the extraction effect, three-dimensional reconstruction was performed with the molar area in the model as the object.
[0172] After completing the calibration of the binocular vision system, fix the line laser and make its initial mapping position at the edge of the molar. Starting from the edge, use a two-dimensional translation stage to move every 100μm in the x-direction of space and take a group of photos until the entire molar area is scanned. In this experiment, the left and right cameras each took 101 line structured light images, and the DT-GGM algorithm and the algorithm in this article were used to obtain the center data of the light strips of these photos, and then the two-dimensional center data was converted into three-dimensional point cloud data according to the parameters obtained by calibration. The ICP (Iterative Closest Point) algorithm is a commonly used point cloud registration algorithm. Using the KD-tree (k-dimensional tree) search path can speed up the registration rate.
[24] The ICP algorithm is used to align the left and right point cloud data, and the number of iterations is set to T = 30. As the number of iterations increases, the mean square error between the point clouds gradually decreases until it becomes stable. Compared with the DT-GGM algorithm, the mean square error of the proposed algorithm after convergence is smaller and the convergence time is shorter.
[0173] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A high-precision center extraction method for multi-curvature line structured light, It is characterized in that include: Acquire an initial line structured light image of the target line structured light, and perform preprocessing and noise removal on the initial line structured light image to obtain a smoothed line structured light image; The multi-threshold segmentation method is used to segment the smooth line structured light image to obtain a binary image; Using the EPTA algorithm to obtain all initial skeleton points in the binary image, and constructing skeleton neighborhood points with the initial skeleton points as the center; Setting a deletion condition, when the skeleton domain point meets the deletion condition, marking the initial skeleton point corresponding to the skeleton domain point for deletion, setting a retention condition, when the initial skeleton point with the to-be-deleted mark meets the retention condition, canceling the to-be-deleted mark of the initial skeleton point, and deleting the initial skeleton point marked for deletion but not meeting the retention condition to obtain the target skeleton point; Performing refinement processing on the target skeleton points to remove burrs and obtain final skeleton points; A normal field calculation is performed on the final skeleton point to obtain a normal angle of the final skeleton point, and the center of the target line structured light is extracted through the normal angle of the final skeleton point.
2. The high-precision center extraction method of multi-curvature line structured light according to claim 1, It is characterized in that The preprocessing and denoising of the initial line structured light image to obtain a smoothed line structured light image includes: The initial line structured light image is preprocessed and denoised using Gaussian filtering to obtain a denoised smoothed line structured light image. The Gaussian filtering uses a two-dimensional zero-mean Gaussian function, and its expression is shown in the following formula: Among them, the parameter σ is the variance, (x, y) is the coordinate value of the processed pixel, g(x, y) is the processed pixel, and e is a constant.
3. The high-precision center extraction method of multi-curvature line structured light according to claim 1, It is characterized in that The method of using a multi-threshold segmentation method to segment the smooth line structured light image to obtain a binary image includes: The initial threshold and grayscale of the smooth line structured light image are set, and the pixels in the smooth line structured light image are divided into the first type of pixels and the second type of pixels based on the initial threshold and grayscale. The optimal threshold is determined based on the initial threshold and grayscale using the maximum inter-class variance idea. The determination method is shown in the following formula: Among them, Th is the initial threshold, Pi is the proportion of points with gray level i in the first category of pixels, ω 1 ,ω′ 1 ,ω″ 1 Represents the cumulative probability of this type of pixel; μ 1 is the grayscale mean within a certain range, when the inter-class variance When the maximum value is reached, Thbest1=Th1, μ 1 , μ′ 1 , μ″ 1 Indicates the average level of pixels of this type; Among them, Thbest1 is the best threshold of the first type of pixels, and similarly, the best threshold of the second type of pixels is determined to be Thbest2. Indicates that Th1 corresponding to the maximum is assigned to Thbest1; The smooth line structured light image is separated into a binary image by using the optimal threshold of the first type of pixels and the optimal threshold of the second type of pixels as follows: Among them, Thbest1 is the best threshold of the first type of pixels, Thbest2 is the best threshold of the second type of pixels, Th is the initial threshold, I(i,j) represents the coordinate value of each pixel in the image, i represents the ordinate, and j represents the abscissa.
4. The high-precision center extraction method of multi-curvature line structured light according to claim 1, It is characterized in that The step of constructing a skeleton neighborhood point with the initial skeleton point as the center includes: Eight neighborhoods are constructed with each point in the initial skeleton point as the center point, so that the eight neighborhoods and the center point form a nine-square grid arrangement.
5. The high-precision center extraction method of multi-curvature line structured light according to claim 1, It is characterized in that The deletion conditions include: D1 (P 1 ×P 3 =1)&&(P 2 +P 5 +P 6 +P 7 =0); D2 (P 3 ×P 5 =1)&&(P 1 +P 4 +P 7 +P 8 =0); D3 (P 1 ×P 7 =1)&&(P 3 +P 4 +P 5 +P 8 =0); D4 (P 5 ×P 7 =1)&&(P 1 +P 2 +P 3 +P 6 =0); D5 (P 2 +P 4 +P 6 +P 8 =0)&&(P 1 +P 3 +P 5 +P 7 =3); Among them, && represents and, indicating that the conditions on both sides of && must be met at the same time, and P1-P8 represent 8 neighborhoods respectively; When the skeleton domain point satisfies any one of the deletion conditions D1-D5, the initial skeleton point corresponding to the skeleton domain point is marked for deletion.
6. The high-precision center extraction method of multi-curvature line structured light according to claim 1, It is characterized in that The reservation conditions include: R1P 1 ×P 3 ×P 4 +P 6 =1; R2P 2 ×P 3 ×P 5 +P 8 =1; R3P 4 ×P 5 ×P 7 +P 2 =1; R4P 1 ×P 2 ×P 7 +P 4 =1; Among them, P1-P8 represent 8 neighborhoods respectively. When the initial skeleton point with a to-be-deleted mark meets the four retention conditions R1-R4, the to-be-deleted mark of the initial skeleton point is cancelled.
7. The high-precision center extraction method of multi-curvature line structured light according to claim 1, It is characterized in that The step of performing thinning processing on the target skeleton points to remove burrs and obtain final skeleton points includes: The target skeleton points are divided into endpoints, nodes and bifurcation points, and the first geodesic distance from each point on the target skeleton point to the nearest bifurcation point is calculated; Calculate the second geodesic distance from each point on the target skeleton to the nearest endpoint, and calculate the sum of the first geodesic distance and the second geodesic distance of each point on the target skeleton; Set the minimum branch length. When the sum of the first geodesic distance and the second geodesic distance of each point on the target skeleton is less than the minimum branch length, mark the point as the first burr point, and remove the bifurcation point from the first burr point to obtain the second burr point. Compare the first geodesic distance and the second geodesic distance of each point in the second burr point, and when the first geodesic distance of the point is greater than the second geodesic distance, delete the point from the second burr point to obtain a third burr point; Find a point in the third burr point where the first geodesic distance is 0 and use the point as the bifurcation point in the third burr point, and compare the second geodesic distance of the bifurcation point in the third burr point with the second geodesic distance of each point in the third burr point. When the second geodesic distance of the bifurcation point in the third burr point is less than the second geodesic distance of a point in the third burr point, use the point as the compensation point. The second burr point is removed from the target skeleton point and the replenished point is replenished back to the target skeleton point from which the second burr point is removed to obtain the final skeleton point.
8. The high-precision center extraction method of multi-curvature line structured light according to claim 1, It is characterized in that The step of performing normal field calculation on the final skeleton point to obtain the normal angle of the final skeleton point includes: With the final skeleton point as the center, a window of size w×w is constructed in the smooth line structured light image, and the gradient of each point in the window is calculated by the Sobel operator [G x (i,j),G y (i,j)] T , thus obtaining the average gradient of each point, as shown in the following formula: The average square gradient of the window is as follows: Window gradient angle Then the normal angle α is calculated as follows: Where α is the normal angle, G bx and G by Represents the average square gradient in the x and y directions of the window.
9. The high-precision center extraction method of multi-curvature line structured light according to claim 1, It is characterized in that The extracting the center of the target line structured light through the normal angle of the final skeleton point includes: The initial center of the smooth line structured light image is obtained by the adaptive grayscale centroid iteration method. Let the coordinates of the initial center P be (u i ,v i ), click P 0 , P 1 They are on the normal line of the point, on the left and right sides respectively, and their distances from P are L 0 , L 1 , then P 0 , P 1 The coordinates can be expressed as: x 0 =u i -L 0 ·sinα; y 0 =v i -L 0 ·cosθ; x 1 =u i +L 1 ·sinα; y 1 =u i +L 1 ·cosθ; Select n pixels at both ends of the skeleton point normal line in the filtered image, and use the following calculation formula to calculate the center of the target line structured light: Among them, (u c , v c ) is the final central coordinate, Gx and Gy are the coordinates of column and row pixels respectively, p i , p' i are the gray levels corresponding to the pixel points, m is the power. When 0 < m < 1, the extracted center of gravity approaches the center of gravity of the normal distribution closer and closer as m decreases until it reaches stability. Initialize m 0 = T, calculate the difference Δo of the center of gravity when m = m 0 and m = m 0 / 2. When Δo > ε (ε is the self-defined error range), take m 0 = 0.9T for iterative calculation until the condition is satisfied.
10. A multi-curvature line structured light high-precision center extraction system, It is characterized in that Including processor and memory; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 9 when executing a program stored in a memory.
Citation Information
Patent Citations
Handwritten Chinese character attractiveness evaluation method based on skeleton similarity
CN112712273A
Grape vine winter shearing point detection algorithm
CN113111830A
Method and device for extracting formed welding seam light knife center based on line structured light vision
CN117058103A
Cited By
Laser stripe center extraction method based on gray coefficient binarization
CN121962237A
A laser stripe center extraction method based on gray coefficient binarization
CN121962237B
