A method for extracting centerline of line structured light based on multi-channel feature fusion

Through multi-channel feature fusion and peak feature processing, the problems of high-light reflection and noise interference in three-dimensional measurement of linear structure light are solved, and high-precision centerline extraction and object surface profile measurement are achieved.

CN118552824BActive Publication Date: 2024-11-15WUHAN INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411025905.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-15
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

The existing three-dimensional linear structure light measurement technology is difficult to accurately extract the center line in high-light reflection and noise environments, resulting in low measurement accuracy and poor robustness.

Method used

Using a multi-channel feature fusion method, by separating the RGB image as the primary and secondary channel HML, using Gaussian convolution and peak feature fusion, combining median filtering, threshold segmentation and differential template algorithms, the linear structure light center line is accurately extracted.

Benefits of technology

It improves the accuracy and robustness of centerline extraction, and can accurately measure the surface profile of the object in a high-light reflection environment, suitable for objects of different materials.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552824B_ABST
    Figure CN118552824B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for extracting the center line of line structured light based on multi-channel feature fusion, comprising: separating a line structured light color image into an RGB image, and determining three grayscale images of primary and secondary channels HML according to the characteristics of light stripe pixels; wherein the primary channel H is a grayscale image with the most effective pixels and the most interference pixels in the RGB image, the secondary channel M is a grayscale image with fewer interference pixels in the RGB image, and the secondary channel L is a grayscale image with the highest ratio of target pixels to interference pixels in the RGB image; respectively obtaining the cross-sectional peaks of each row of pixels of the light stripe in the grayscale images of the primary channel H and the secondary channel M, and fusing the brightness values ​​of the three grayscale images of HML using the peak features; extracting the ROI area of ​​the line structured light stripe from the fused image; and then extracting the center line using the peak features of the secondary channel M and combining the differential template algorithm and the local grayscale centroid method. The present invention effectively improves the centerline extraction accuracy and can accurately measure objects with high light reflection surfaces.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of three-dimensional measurement technology, and in particular to a method for extracting center lines of line structured light based on multi-channel feature fusion. Background Art

[0002] The line structured light 3D visual non-contact measurement method is simple to implement, fast in measurement speed and high in accuracy, and is widely used in the field of 3D measurement. Line structured light is irradiated onto the surface of the object to be measured to form light stripes, which are captured by the camera. The light stripes are affected by factors such as the surface material, geometry, and noise of the object to be measured, and will be discontinuous or distorted. How to quickly and accurately extract the center line of the line structured light is of great significance to improving the accuracy of line structured light 3D measurement.

[0003] At present, there are many studies on the methods of extracting the center line of laser stripes. Common methods include extreme value method, grayscale centroid method, Steger algorithm and edge detection. Among them, the extreme value method and grayscale centroid method are more effective when the grayscale of the laser stripe satisfies Gaussian distribution, but they are easily disturbed by environmental noise and have poor robustness. The Steger algorithm uses the Hessian matrix to obtain the normal vector of the light stripe and takes its normal extreme value as the center point, but the algorithm contains a large amount of convolution and has poor real-time performance. Edge detection obtains edge features by detecting grayscale changes in the image, and this method is easily disturbed by noise.

[0004] In view of these problems, the present invention proposes a line structured light centerline extraction method based on multi-channel feature fusion, which extracts the line structured light centerline based on multi-channel feature fusion to complete the surface profile measurement of the object under test. Summary of the invention

[0005] The purpose of the present invention is to provide a method for extracting the center line of line structured light based on multi-channel feature fusion, which can accurately extract the center line of the line structured light when the surface of the object to be measured has high light reflection during line structured light scanning, and can accurately measure the surface contour information of the object to be measured.

[0006] The technical solution adopted by the present invention is as follows:

[0007] In a first aspect, the present invention provides a method for extracting centerline of line structured light based on multi-channel feature fusion, the method comprising:

[0008] S1. Separate the collected line structured light color image into RGB images, and determine the three grayscale images of primary and secondary channels HML according to the characteristics of light stripe pixels; wherein the primary channel H is the grayscale image with the most effective pixels and the most interference pixels in the RGB image, the secondary channel M is the grayscale image with fewer interference pixels in the RGB image, and the secondary channel L is the grayscale image with the highest ratio of target pixels to interference pixels in the RGB image;

[0009] S2, first perform Gaussian convolution on the grayscale images of channel H and channel M, and then obtain the cross-sectional peak K of each row (column) of the image pixels respectively. H , K M ; The brightness values ​​of the HML images are fused using the peak features, retaining the target pixels of the main channel and weakening the interference pixels;

[0010] S3, using median filtering, threshold segmentation and eight-connected domain pixel area statistics technology to remove interference pixels from the roughly extracted ROI area, so as to accurately extract the ROI area of ​​the line structured light stripes;

[0011] S4. Using the peak features of the secondary channel M, combined with the differential template algorithm and the local grayscale centroid method, the center line of the precise ROI area is quickly and adaptively extracted.

[0012] Following the above technical solution, in step S1, the line structured light image size is W=rows cols; Separate the collected color image into RGB image, and determine the three grayscale images of primary and secondary channels HML according to the characteristics of light streak pixels; Among them, the primary channel H is the grayscale image with the most effective pixels and the most interference pixels in the RGB image, the secondary channel M is the grayscale image with fewer interference pixels in the RGB image, and the secondary channel L is the grayscale image with the highest ratio of target pixels to interference pixels in the RGB image. Among them, effective pixels are pixels with brightness values ​​greater than 0, and effective pixels are divided into target pixels and interference pixels.

[0013] Following the above technical solution, in step S2, 5 5 Gaussian convolution template window for filtering, and then use the method that the first-order derivative is zero and the second-order derivative is less than zero to obtain the cross-sectional peak K of each row (column) of the H and M images respectively. H , K M . Calculating the number of peaks can be divided into the following three steps:

[0014] First, perform a first-order difference on the pixels in the i-th row of the image to obtain the difference value of the i-th row and j-th column. :

[0015]

[0016] Among them, when dealing with the situation where the brightness values ​​of adjacent pixels are equal and flat, it is necessary to The situation is further modified:

[0017]

[0018] Finally, the second-order difference is used to determine the number of peaks, and the total number of peaks in the i-th row of the image is obtained. ;

[0019]

[0020] Thus, the cross-sectional peak number K of each row of pixels of the light stripe in the grayscale image of the main channel H and the secondary channel M is obtained. H and K M .

[0021] Following the above technical solution, the peak feature is used to fuse the brightness value of the HML image. By preprocessing the main channel H by row (column), the target pixels of the main channel H are retained, and the interference pixels of the main channel H are weakened, so as to roughly extract the line structured light stripe ROI area; the method is as follows:

[0022] The peak of the i-th row (column) of the main channel H , indicating that the valid pixels of the main channel H only contain the target pixel, and the grayscale value of the main channel H should be retained at this time:

[0023]

[0024] The peak of the i-th row (column) of the main channel H , indicating that the effective pixels of the main channel H contain the target pixel and a small number of interference pixels; when the peak of the i-th row (column) of the secondary channel M , indicating that the secondary channel has no brightness, the gray value of the main channel H should be retained at this time; when the peak of the i-th row (column) of the secondary channel M , indicating that the secondary channel has brightness, and the gray value of the main channel H should be weakened at this time:

[0025]

[0026] The peak of the i-th row (column) of the main channel H , indicating that the effective pixels of the main channel H contain target pixels and a large number of interference pixels. At this time, the gray value of the main channel H should be weakened:

[0027]

[0028] Among them, μ is the fusion coefficient, t is the peak threshold of the cross section when the main channel H contains a small number of interference pixels, and d is the peak threshold of the cross section when the main channel H contains a large number of interference pixels; The H channel is preprocessed to obtain the gray value of a single pixel in the ROI area. , and They are the pixel grayscale values ​​of the i-th row (column) and j-th column (row) of the HML channel respectively.

[0029] Following the above technical solution, in step S3, each pixel (i, j) in the roughly extracted ROI area is subjected to 7 The median filter template window of 7 is used for convolution and threshold segmentation technology to denoise, and then the seed point area search and pixel quantity statistics method in the eight-connected domain are used to further remove the interference pixels, so as to accurately extract the line structured light stripe ROI area; the threshold segmentation method is:

[0030]

[0031] Among them, the threshold , It is the single pixel gray value of the roughly extracted ROI area.

[0032] The eight-connected domain component filtering algorithm is used to remove the connected components with smaller areas in the ROI area of ​​the roughly extracted line structured light streaks, and retain the connected areas with larger areas; pixels with grayscale values ​​greater than 0 are selected as seed points, new connected components are created and the size of the connected area is initialized to 0, the eight neighborhoods of the current seed point are searched, and the number of unvisited adjacent pixels is counted into the size of the connected area; all connected components are traversed, and the pixels in the connected component area with an area less than 1 / c of ​​the largest connected component area are set to 0 to achieve re-denoising of the line structured light streak ROI area and accurately extract the line structured light streak ROI area; where c is the connected domain area filtering parameter.

[0033] Following the above technical solution, in step S4, when the peak of the i-th row (column) of the secondary channel M , indicating that the effective pixels of the secondary channel only contain the target pixels, and the differential template algorithm is used to quickly extract the center line; when the peak of the i-th row (column) of the secondary channel M , indicating that the effective pixels of the secondary channel include the target pixels and a small number of interference pixels, and the local grayscale centroid method is used to quickly extract the center line.

[0034] The peak of the i-th row (column) of the secondary channel M , use the differential template algorithm to extract the center line, traverse the ROI i-th row (column) to obtain the column (row) coordinates of the maximum template differential value Column (row) coordinates of the minimum template difference value , and then take the mean to determine the column (row) coordinates of the center point of the current ROI:

[0035]

[0036]

[0037] The peak of the i-th row (column) of the secondary channel M , the local grayscale centroid method is used to extract the center line, which is recorded as the center column (row) coordinate of the light stripe. The center point P(i-1, j0) of the previous row (column) i-1 is used as the reference point, and the precise pixel coordinates within the pixel range of the line structure light width w near P(i, j0) are calculated:

[0038]

[0039] Among them, m is the length of the differential template, i is the row (column) coordinate, j is the column (row) coordinate, g(i,j) is the pixel gray value of the accurately extracted ROI area, p(i,j) is the current template differential value, is the column (row) coordinate of the center point of the i-th row (column).

[0040] In a second aspect, the present invention further provides a method for measuring the surface profile of an object, the method comprising:

[0041] S5, generating an ordered three-dimensional point cloud in real time according to the center line extracted by the above method, obtaining the surface contour point cloud of the measured object, and removing outlier noise by Gaussian statistical filtering;

[0042] S6. Read the visualized 3D point cloud data and accurately measure the surface profile information of the object being measured, including the accurate measurement of the surface distance of the object being measured:

[0043] First, the surface contour point cloud of the measured object is segmented by straight-through filtering to obtain the upper surface point cloud and the lower surface point cloud; then the RANSAC algorithm is used to perform plane fitting on the point cloud to obtain: and ;

[0044] Calculate the normal vector angle between the upper and lower surfaces , using the upper surface plane equation as a reference, we get the correction parameters of the lower surface point cloud plane equation: ;

[0045] The surface spacing of the object to be measured is accurately measured as follows: .

[0046] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0047] The present invention determines the primary and secondary channel HML three-grayscale images according to the characteristics of light stripe pixels, and can accurately obtain the line structure light stripe ROI area through the peak characteristics of the image and the multi-channel brightness value fusion method; the peak characteristics of the secondary channel M are used, and the differential template algorithm and the local grayscale centroid method are combined to quickly and adaptively extract the center line of the line structure light stripe for the precise ROI area. The present invention effectively improves the center line extraction accuracy, can more accurately measure objects with high light reflection surfaces, and has a certain universality for objects of different materials. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a flow chart of a surface profile measurement method based on the center line of multi-channel feature fusion line structured light according to an embodiment of the present invention;

[0049] Figure 2 A line structured light image containing noise such as reflected light interference according to an embodiment of the present invention;

[0050] Figure 3 for Figure 2 Separate into three grayscale images of primary and secondary channels HML determined by RGB; among them, Figure 3 (a) in the figure is the grayscale image of the main channel H(B). Figure 3 (b) in the figure is the grayscale image of the secondary channel M(G). Figure 3 (c) in the figure is the grayscale image of the secondary channel L(R);

[0051] Figure 4 is a roughly extracted line structured light stripe ROI area diagram according to an embodiment of the present invention;

[0052] Figure 5 is a ROI area map of line structured light stripes accurately extracted by an embodiment of the present invention;

[0053] Figure 6 is a center line result diagram of the line structured light according to an embodiment of the present invention;

[0054] Figure 7 is a point cloud image of the object under test according to an embodiment of the present invention;

[0055] Figure 8 is a point cloud image of the upper surface of the object to be measured according to an embodiment of the present invention;

[0056] Fig. 9 It is a point cloud image of the lower surface of the object to be measured in an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0058] The present invention designs a detection device using a line laser, a camera and a computer. A line structured light emitter with a wavelength of 450nm is used to irradiate the surface of the object to be measured, so that the laser line is at the center of the camera's field of view. By controlling the motion axis, clear and bright line structured light can be obtained at all times when scanning the object.

[0059] Embodiment 1

[0060] A method for extracting center line of line structured light based on multi-channel feature fusion in this embodiment is as follows: Figure 1 As shown, the following steps are included:

[0061] S1. Separate the collected line structured light color image into RGB images, and determine the three grayscale images of primary and secondary channels HML according to the characteristics of light stripe pixels; wherein the primary channel H is the grayscale image with the most effective pixels and the most interference pixels in the RGB image, the secondary channel M is the grayscale image with fewer interference pixels in the RGB image, and the secondary channel L is the grayscale image with the highest ratio of target pixels to interference pixels in the RGB image;

[0062] S2, first perform Gaussian convolution on the grayscale images of channel H and channel M, and then obtain the cross-sectional peak K of each row (column) of the image pixels respectively. H , K M ; The brightness values ​​of the HML images are fused using the peak features, by retaining the target pixels of the main channel and weakening the interference pixels;

[0063] S3, using median filtering, threshold segmentation and eight-connected domain pixel area statistics technology to remove interference pixels from the roughly extracted ROI area, so as to accurately extract the ROI area of ​​the line structured light stripes;

[0064] S4. Using the peak features of the secondary channel M, combined with the differential template algorithm and the local grayscale centroid method, the center line of the precise ROI area is quickly and adaptively extracted.

[0065] Specifically, in step S1, the line structured light image size is W=rows cols, line structured light stripes containing noise interference such as diffuse reflection and speckle, such as Figure 2 The line structured light stripe image captured by the CCD camera is separated into RGB images, and the primary and secondary channel HML three-grayscale images are determined according to the characteristics of the light stripe pixels, as shown in Figure 3 As shown, Figure 3 (a) in the figure is the grayscale image of the main channel H(B). Figure 3 (b) in the figure is the grayscale image of the secondary channel M(G). Figure 3 (c) in the figure is the grayscale image of the secondary channel L(R).

[0066] The main channel H is the grayscale image with the most effective pixels and the most interference pixels in the RGB image, the secondary channel M is the grayscale image with fewer interference pixels in the RGB image, and the secondary channel L is the grayscale image with the highest ratio of target pixels to interference pixels in the RGB image. Among them, effective pixels are pixels with brightness values ​​greater than 0, and effective pixels are divided into target pixels and interference pixels.

[0067] The interference pixels of the HML three-grayscale image gradually decrease. Generally speaking, the grayscale image with the most pixels is the main channel H, and the grayscale image with the least pixels is the secondary channel L.

[0068] In step S2, 5 5 Gaussian convolution template window for filtering, and then use the method that the first-order derivative is zero and the second-order derivative is less than zero to obtain the cross-sectional peak K of each row of the HM image. H , K M . There are three steps to find the number of peaks:

[0069] First, perform a first-order difference on the pixels in the i-th row of the image to obtain the difference value of the i-th row and j-th column. :

[0070]

[0071] Among them, when dealing with the situation where the brightness values ​​of adjacent pixels are equal and flat, it is necessary to The situation is further modified:

[0072]

[0073] Finally, the second-order difference is used to determine the number of peaks, and the total number of peaks in the i-th row of the image is obtained. ;

[0074]

[0075] Specifically, in step S2, the peak features are used to fuse the brightness values ​​of the HML image, and the main channel H is preprocessed row by row to retain the target pixels of the main channel H and weaken the interference pixels of the main channel H, thereby roughly extracting the line structured light stripe ROI area, such as Figure 4 shown.

[0076] The peak of the i-th row of the main channel H , indicating that the valid pixels of the main channel H only contain the target pixel, and the grayscale value of the main channel H should be retained at this time:

[0077]

[0078] The peak of the i-th row of the main channel H , indicating that the effective pixels of the main channel H contain the target pixels and a small number of interference pixels; when the peak of the i-th row of the secondary channel M , indicating that the secondary channel has no brightness, the gray value of the main channel H should be retained; when the peak of the i-th row of the secondary channel M , indicating that the secondary channel has brightness, and the gray value of the main channel H should be weakened at this time:

[0079]

[0080] The peak of the i-th row of the main channel H , indicating that the effective pixels of the main channel H contain target pixels and a large number of interference pixels. At this time, the gray value of the main channel H should be weakened:

[0081]

[0082] in, The H channel is preprocessed to obtain the gray value of a single pixel in the ROI area. , and are the pixel grayscale values ​​of the i-th row and j-th column of the HML channel respectively.

[0083] It should be noted that in this embodiment, the fusion coefficient μ is 0.03, and the two peak thresholds t and d are 3 and 6 respectively, which are applicable to most situations. Of course, these three parameters can also be set according to actual situations.

[0084] In addition, in this embodiment, the direction of the line structured light stripes is the column direction, that is, the cross-sectional wave peaks and the fusion images need to be obtained along the direction perpendicular to the light stripes.

[0085] Specifically, in step S3, 7 The median filter template window of 7 is used for convolution and threshold segmentation technology to denoise, and then the seed point area search and pixel quantity statistics method in the eight-connected domain are used to further remove the interference pixels, so as to accurately extract the line structured light stripe ROI area:

[0086]

[0087] Among them, the threshold , It is the single pixel gray value of the roughly extracted ROI area.

[0088] The eight-connected domain component filtering algorithm is used to remove the connected components with smaller areas in the ROI area of ​​the roughly extracted line structured light stripes, and the connected areas with larger areas are retained; pixels with grayscale values ​​greater than 0 are selected as seed points, new connected components are created and the size of the connected area is initialized to 0, and the eight neighborhoods of the current seed point are searched, and the number of unvisited adjacent pixels is counted into the size of the connected area; all connected components are traversed, and the pixels in the connected component area with an area less than 1 / 5 of the area of ​​the largest connected component are set to 0, and the line structured light stripe ROI area is accurately extracted, such as Figure 5 shown.

[0089] Specifically, in step S4, when the peak of the i-th row of the secondary channel M , indicating that the effective pixels of the secondary channel only contain the target pixels, and the differential template algorithm is used to quickly extract the center line; when the peak of the i-th row of the secondary channel M , indicating that the effective pixels of the secondary channel include the target pixels and a small number of interference pixels, and the local grayscale centroid method is used to quickly extract the center line; the center line of the line structured light stripe is as follows Figure 6 shown.

[0090] The peak of the i-th row of the secondary channel M , use the differential template algorithm to extract the center line, traverse the ROI i-th row to obtain the column coordinates of the maximum template difference value Column coordinates of the minimum template difference value , and then take the mean to determine the column coordinates of the center point of the current ROI:

[0091]

[0092]

[0093] The peak of the i-th row of the secondary channel M , the local grayscale centroid method is used to extract the center line, recorded as the center column coordinates of the light stripe, the center point P(i-1,j0) of the previous row i-1 is used as the reference point, and the precise pixel coordinates within the range of 20 pixels of the line structure light stripe width near P(i,j0) are calculated:

[0094]

[0095] Among them, m=5 is the length of the differential template, i is the row coordinate and j is the column coordinate, g(i,j) is the pixel gray value of the ROI area accurately extracted, and p(i,j) is the current template differential value. is the column coordinate of the center point of the i-th row.

[0096] Embodiment 2

[0097] A surface profile measurement method based on the center line of multi-channel feature fusion line structured light in this embodiment, such as Figure 1 As shown, the following steps are included:

[0098] S1. Separate the collected line structured light color image into RGB images, and determine the three grayscale images of primary and secondary channels HML according to the characteristics of light stripe pixels; wherein the primary channel H is the grayscale image with the most effective pixels and the most interference pixels in RGB, the secondary channel M is the grayscale image with fewer interference pixels in RGB, and the secondary channel L is the grayscale image with the highest ratio of target pixels to interference pixels in RGB;

[0099] S2, first perform Gaussian convolution on the HM grayscale image, and then obtain the cross-sectional peak K of each row (column) of the image pixels respectively.H , K M ; The brightness values ​​of the HML images are fused using the peak features, by retaining the target pixels of the main channel and weakening the interference pixels;

[0100] S3, using median filtering, threshold segmentation and eight-connected domain pixel area statistics technology to remove interference pixels from the roughly extracted ROI area, so as to accurately extract the ROI area of ​​the line structured light stripes;

[0101] S4, using the peak features of the secondary channel M, combined with the differential template algorithm and the local grayscale centroid method, the center line of the precise ROI area is quickly and adaptively extracted;

[0102] S5. Generate an ordered three-dimensional point cloud in real time according to the center line to obtain the surface contour point cloud of the object being measured;

[0103] S6. Read the visualized 3D point cloud data and accurately measure the surface contour information of the object being measured.

[0104] Specifically, in step S5, an ordered three-dimensional point cloud is generated in real time according to the center line, the surface contour point cloud of the measured object is obtained, and the outlier noise is removed by Gaussian statistical filtering, such as Figure 7 shown.

[0105] Specifically, in step S6, the visualized three-dimensional point cloud data is read , the local average height of the surface of the measured object is measured as .

[0106] Accurately measure the surface distance of the measured object:

[0107] First, the surface contour point cloud of the measured object is segmented by straight-through filtering to obtain the upper surface point cloud and the lower surface point cloud, such as Figure 8 and Fig. 9 As shown; then use the RANSAC algorithm to fit the point cloud to the plane, and get:

[0108]

[0109] ;

[0110] Calculate the normal vector angle between the upper and lower surfaces , using the upper surface plane equation as a reference, we get the correction parameters of the lower surface point cloud plane equation: ;

[0111] The surface spacing of the object to be measured is accurately measured as follows: =1.70234 (mm).

[0112] Calculate the surface roughness of the object as:

[0113] The RANSAC algorithm is used to perform plane fitting on the surface contour of the point cloud to obtain the plane equation:

[0114] ;

[0115] Calculate the distance from a point in a point cloud to the plane equation:

[0116] Calculate the surface roughness of the object as: ;

[0117] in, For 3D point cloud The z coordinate value of , n is the number of point clouds on the surface of the object.

[0118] In summary, the present invention determines the primary and secondary channel HML three grayscale images according to the characteristics of light stripe pixels, and can accurately obtain the line structure light stripe ROI area through the peak characteristics of the image and the multi-channel brightness value fusion method; the peak characteristics of the secondary channel M are used, and the differential template algorithm and the local grayscale centroid method are combined to quickly and adaptively extract the center line of the line structure light stripe for the precise ROI area. The present invention effectively improves the centerline extraction accuracy, can more accurately measure objects with high light reflective surfaces, and has a certain universality for objects of different materials.

[0119] It should be noted that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0120] It should be pointed out that, according to the needs of implementation, the various steps / components described in this application can be split into more steps / components, and two or more steps / components or partial operations of steps / components can be combined into new steps / components to achieve the purpose of the present invention.

[0121] It will be easily understood by those skilled in the art that the above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for extracting centerline of line structured light based on multi-channel feature fusion, characterized in that: The method includes: S1. Separate the line structured light color image into RGB images, and determine the three grayscale images of primary and secondary channels HML according to the characteristics of light stripe pixels; wherein the primary channel H is the grayscale image with the most effective pixels and the most interference pixels in the RGB image, the secondary channel M is the grayscale image with fewer interference pixels in the RGB image, and the secondary channel L is the grayscale image with the highest ratio of target pixels to interference pixels in the RGB image; S2, using the method that the first-order derivative is zero and the second-order derivative is less than zero, respectively obtain the cross-sectional peaks of each row of pixels of the light stripes in the grayscale images of the main channel H and the secondary channel M, and fuse the brightness values ​​of the three grayscale images HML using the peak features to obtain a fused image; S3, extracting the ROI area of ​​the line structured light stripes from the fused image; S4, reusing the peak features of the secondary channel M, and combining the differential template algorithm and the local grayscale centroid method to extract the center line of the ROI area; Among them, the peak features are used to fuse the brightness values ​​of the HML three grayscale images, including: Get the number of cross-sectional peaks K of each row of pixels of the light stripe in the grayscale image of the main channel H and the secondary channel M H and K M ; When the peak of the i-th row of the main channel H , it means that the valid pixels of the main channel H only contain the target pixels, and the grayscale value of the main channel H should be retained at this time: When the peak of the i-th row of the main channel H When , it means that the effective pixels of the main channel H contain the target pixels and a small number of interference pixels; when the peak of the i-th row of the secondary channel M , indicating that the secondary channel has no brightness, the gray value of the main channel H should be retained at this time; when the peak of the i-th row of the secondary channel M , indicating that the secondary channel has brightness, and the gray value of the main channel H should be weakened at this time: The peak of the i-th row of the main channel H , indicating that the effective pixels of the main channel H contain target pixels and a large number of interference pixels. At this time, the gray value of the main channel H should be weakened: Among them, μ is the fusion coefficient, t is the peak threshold of the cross section when the main channel H contains a small number of interference pixels, and d is the peak threshold of the cross section when the main channel H contains a large number of interference pixels; is the gray value of a single pixel in the ROI area, , and are the pixel grayscale values ​​of the i-th row and j-th column of the HML channel respectively.

2. The method for extracting centerline of line structured light based on multi-channel feature fusion according to claim 1, characterized in that: The method for obtaining the cross-sectional peak is as follows: Perform a first-order difference on the pixels in the i-th row of the light stripe in the grayscale image to obtain the difference value in the i-th row and j-th column. : in, is the pixel value of the i-th row and j-th column; right The situation is further modified: Then use the second-order difference to determine the number of peaks and get the total number of peaks in the i-th row of the image. : Where col is the number of columns of image pixels.

3. The method for extracting centerline of line structured light based on multi-channel feature fusion according to claim 1, characterized in that: Before obtaining the cross-sectional peak, the image is convolved by Gaussian, that is, each pixel of the grayscale image of the main channel H and the secondary channel M is convolved by 5 5 Gaussian convolution template window for filtering.

4. The method for extracting centerline of line structured light based on multi-channel feature fusion according to claim 1, characterized in that: Median filtering, threshold segmentation and eight-connected domain pixel area statistics method are used to remove interfering pixels in the fused image, so as to accurately extract the ROI area of ​​the line structured light stripes from the fused image.

5. The method for extracting centerline of line structured light based on multi-channel feature fusion according to claim 4, characterized in that: Threshold segmentation includes: In the formula, the threshold , μ is the fusion coefficient, is the grayscale value of the pixel in the i-th row and j-th column of the main channel H, is the pixel gray value of the i-th row and j-th column of the fused image; The eight-connected domain pixel area statistics method includes: selecting pixels with grayscale values ​​greater than 0 as seed points, creating new connected components and initializing the size of the connected area to 0, searching the eight neighborhoods of the current seed point, and counting the number of unvisited adjacent pixels into the size of the connected area; traversing all connected components, setting the pixels in the connected component area whose area is less than a preset proportion of the maximum connected component area to 0, and accurately extracting the ROI area of ​​the line structured light stripes.

6. The method for extracting centerline of line structured light based on multi-channel feature fusion according to claim 1, characterized in that: Step S4 includes: When the peak of the i-th row of the secondary channel M , indicating that the effective pixels of the secondary channel only contain the target pixels, and the differential template algorithm is used to quickly extract the center line; the method is as follows: Traverse the i-th row of the ROI area and obtain the column coordinates of the maximum template difference value Column coordinates of the minimum template difference value , and then take the mean to determine the column coordinates of the center point of the current ROI: When the peak of the i-th row of the secondary channel M , indicating that the effective pixels of the secondary channel include the target pixels and a small number of interference pixels, and the local grayscale centroid method is used to quickly extract the center line; the method is as follows: Take the center point P(i-1,j0) of the previous row as the reference point, and calculate the pixel coordinates within the pixel range of the line structured light width w near P(i,j0): Where m is the difference template length, g(i,j) is the pixel grayscale value of the i-th row and j-th column of the image, t is the peak threshold of the cross section when the main channel H contains a small number of interfering pixels, and p(i,j) is the current template difference value. is the column coordinate of the center point of the i-th row.

7. A method for measuring the surface profile of an object, characterized in that: The method includes: Acquire a line structured light color image of the object being measured; Extracting the center line using the line structured light center line extraction method based on multi-channel feature fusion as described in any one of claims 1 to 6; Generate an ordered three-dimensional point cloud based on the extracted center line to obtain the surface contour point cloud of the object being measured; Based on the surface contour point cloud of the object to be measured, the surface contour information of the object to be measured is measured.

8. The method for measuring the surface profile of an object according to claim 7, characterized in that: Measure the surface profile information of the object being measured, including: The surface contour point cloud of the measured object is segmented by using straight-through filtering to obtain the upper surface point cloud and the lower surface point cloud; The RANSAC algorithm is used to perform plane fitting on the point cloud, and the plane equations of the upper surface point cloud and the lower surface point cloud are obtained respectively: and ; Calculate the normal vector angle between the upper and lower surfaces , taking the plane equation of the upper surface point cloud as a reference, we get the correction parameters of the plane equation of the lower surface point cloud: ; Calculate the surface spacing of the measured object as : In the formula, , and are coordinates, , , , , , , and is the coefficient of the equation.