Anti-interference laser stripe center line fast extraction method

By combining max pooling downsampling and region of interest search with pixel grayscale weighting and candidate region non-maximum suppression, the real-time performance and anti-interference issues of the laser stripe centerline extraction algorithm are solved, achieving fast and accurate centerline extraction.

CN115841452BActive Publication Date: 2026-02-17CHONGQING ZHONGKE SAILBOAT INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211239293.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-11
Publication Date
2026-02-17
Estimated Expiration
2042-10-11

AI Technical Summary

Technical Problem

Existing laser stripe centerline extraction algorithms have shortcomings in terms of real-time performance and anti-interference ability. In particular, the gray-scale centroid method is easily affected by noise interference and the search time for invalid regions is too long, which affects the detection speed and accuracy.

Method used

By employing max pooling downsampling and region of interest search techniques, combined with pixel grayscale weighting and candidate region non-maximum suppression, the center line of the laser stripe is extracted, noise interference is suppressed, and the detection speed is improved.

Benefits of technology

It enables rapid and accurate extraction of the center line of laser stripes, improves the real-time performance and anti-interference capability of detection, and significantly enhances the accuracy and speed of center line extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115841452B_ABST
    Figure CN115841452B_ABST
Patent Text Reader

Abstract

The application provides an anti-interference laser stripe center line fast extraction method, comprising the following steps: acquiring an initial laser stripe image, and performing down-sampling on the initial laser stripe image by using a maximum pooling manner; performing a region of interest search on the down-sampled image, intercepting a region of interest in the initial laser stripe image, and acquiring a target image; and performing center line extraction on the target image by using a center line extraction algorithm based on a pixel gray value weighted barycenter method and a candidate region non-maximum suppression method, and acquiring a laser stripe center line. The application can inhibit the adverse effects of speckle noise and glare noise and the like on center line extraction, ensure the extraction effect of the center line, and has better real-time detection capability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of industrial measurement technology, and in particular to an anti-interference laser stripe center line fast extraction method. BACKGROUND

[0002] Line laser-based measurement technology is a non-contact measurement method, which can realize high-speed and high-resolution measurement of three-dimensional object surface features, and is widely used in industrial measurement field. The key of line laser measurement technology is the accurate extraction of laser stripe center line, which directly determines the detection effect. After years of development, there are many extraction algorithms, including edge method, threshold method, thinning method, gray center method, Steger algorithm, etc.

[0003] Although there are various extraction algorithms, they have their own advantages and disadvantages, so in actual scene application, people need to balance between detection speed and detection accuracy to select a more suitable extraction algorithm.

[0004] Steger algorithm uses Hessian matrix to calculate the second-order directional derivative of the image, and determines the center point position of the laser stripe by the maximum absolute value of the second-order directional derivative. However, the operation amount of Hessian matrix for directional derivative of the image is huge, which cannot achieve real-time effect. In contrast, the gray center method is often applied in scenes with high real-time requirements due to its simple mathematical principle, high execution efficiency and fast speed.

[0005] The gray center method has good real-time performance due to its simple mathematical calculation principle, but because its mathematical calculation process is too simple, the center line extraction process of the gray center method is easily disturbed by noise, and the anti-interference ability is poor. When there is some random noise interference, the center line extracted by the gray center method will fluctuate up and down, and when there is glare interference, the center line extracted by the gray center method will be obviously offset. In addition, according to the projection principle of line laser, most of the areas in a laser stripe image are black, which are meaningless for the laser stripe center line extraction process, but these invalid areas will cause a lot of pixel point search time in the gray center method calculation process, which seriously affects the real-time performance of the gray center method.

[0006] Therefore, there is an urgent need for a method that can extract the laser stripe center line in real time, resist interference, and improve the extraction effect of the laser stripe center line. SUMMARY

[0007] Therefore, it is necessary to provide an anti-interference laser stripe center line fast extraction method in view of the above technical problems.

[0008] The application discloses an anti-interference laser stripe center line fast extraction method, which comprises the following steps: acquiring an initial laser stripe image, performing down-sampling on the initial laser stripe image by adopting a maximum pooling mode; performing ROI (Region of Interest) search on the down-sampled image, intercepting a ROI in the initial laser stripe image, and acquiring a target image; and performing center line extraction on the target image by adopting a center line extraction algorithm based on a pixel gray value weighted gravity center method and a candidate region non-maximum suppression method, and acquiring a laser stripe center line.

[0009] In one of the embodiments, the ROI search on the down-sampled image, the ROI interception in the initial laser stripe image, and the target image acquisition specifically comprise the following steps: setting a pixel gray threshold and a pixel point number threshold meeting the pixel gray threshold, and initializing a pixel point counter; searching for an ROI upper boundary row coordinate value and an ROI lower boundary row coordinate value of the down-sampled image, and acquiring an upper boundary and a lower boundary; judging whether the upper boundary and the lower boundary are coincident according to a difference between the ROI upper boundary row coordinate value and the ROI lower boundary row coordinate value; if not, taking an interval from a value obtained by multiplying the ROI upper boundary row coordinate value by the down-sampling multiple and subtracting a region adjustment value to a value obtained by multiplying the ROI lower boundary row coordinate value by the down-sampling multiple and adding the region adjustment value as a ROI, intercepting the ROI in the initial laser stripe image, and acquiring a target image; and if yes, indicating that the ROI search fails, and taking the initial laser stripe image as the target image.

[0010] In one of the embodiments, the ROI upper boundary row coordinate value and the ROI lower boundary row coordinate value of the down-sampled image are searched, and the upper boundary and the lower boundary are acquired, specifically comprising the following steps: performing line-by-line traversal on the down-sampled image from top to bottom, comparing a pixel gray value at a current pixel coordinate with the pixel gray threshold, and counting, by the pixel point counter, pixel points greater than the pixel gray threshold; after one line is traversed, judging whether a number of pixel points meeting the requirement in the current line is greater than the pixel point number threshold, if yes, regarding the current line as the upper boundary, acquiring the ROI upper boundary row coordinate value, and if no, continuing the next line traversal operation; and when the lower boundary is acquired, performing line-by-line traversal on the down-sampled image from bottom to top, the lower boundary recognition method being the same as the upper boundary recognition method, and the lower boundary and the ROI lower boundary row coordinate value are acquired.

[0011] In one of the embodiments, the center line extraction algorithm based on the pixel gray value weighted barycenter method and the candidate region non-maximum suppression method is used to extract the center line of the target image to obtain the laser stripe center line, and specifically includes: identifying the laser stripe center region in the target image based on the candidate region non-maximum suppression method; and extracting the center line of the laser stripe center region by using the center line extraction algorithm based on the pixel gray value weighted barycenter method to obtain the laser stripe center line.

[0012] In one of the embodiments, the candidate region non-maximum suppression method is used to identify the laser stripe center region in the target image, and specifically includes: dividing the target image by column to obtain a plurality of candidate regions; calculating the gray barycenter of the candidate region based on the pixel gray value weighted barycenter method to obtain a plurality of barycenter points, and calculating the gray mean value of the candidate region, with the gray mean value calculation formula being:

[0013]

[0014] Comparing the gray mean values of all the candidate regions to obtain the candidate region with the maximum pixel gray mean value as the laser stripe center region.

[0015] In one of the embodiments, the target image is divided by column to obtain a plurality of candidate regions, and specifically includes: setting a distance threshold and a quantity threshold, scanning the pixel points of the target image by column, and recording the pixel points with the pixel gray value greater than the pixel gray threshold in sequence; calculating the distance between adjacent pixel points in the recorded pixel points, and determining that the adjacent pixel points belong to different regions when the distance is greater than the distance threshold; after the scanning of a single column is completed, a plurality of regions are obtained, the number of pixel points in the plurality of regions is counted, the region with the number of pixel points greater than the quantity threshold is retained as a candidate region, and a plurality of candidate regions are obtained after the division of all the columns of the target image is completed.

[0016] In one of the embodiments, the center line extraction algorithm based on the pixel gray value weighted barycenter method is used to extract the center line of the laser stripe center region to obtain the laser stripe center line, and specifically includes: calculating all the gray barycenters of the laser stripe center region by using the pixel gray value weighted barycenter method, taking the gray barycenters as the laser stripe centers of each column, and obtaining the laser stripe center line according to the laser stripe centers of all the columns after the traversal of all the columns of the laser stripe center region is completed.

[0017] In one of the embodiments, the pixel gray value weighted barycenter method specifically includes: when the target image is V'xU', the center line extraction algorithm based on the pixel gray value weighted barycenter method is:

[0018]

[0019]

[0020] In the formula, G(v, u) represents the pixel gray value of the pixel point in the vth row and the u column, wherein u=0, 1, 2... U'-1, v=0, 1, 2... V'-1, and a is a pixel gray value weight square coefficient.

[0021] Compared with the prior art, the advantages and beneficial effects of the present application are that: by acquiring an initial laser stripe image, the initial laser stripe image is down-sampled in a max-pooling manner to speed up the subsequent search speed of the region of interest, the region of interest is intercepted from the initial laser stripe image by searching the region of interest in the down-sampled image, a target image is acquired, the speed of extracting the center line is improved, a center line extraction algorithm based on a pixel gray value weighted barycenter method and a candidate region non-maximum suppression method is used to extract the center line of the target image, the laser stripe center line is acquired, the adverse effects of speckle noise and glare noise and the like on the center line extraction can be inhibited, the extraction effect of the center line is ensured, and better real-time detection capability is achieved. BRIEF DESCRIPTION OF DRAWINGS

[0022] Figure 1 It is a flowchart of an anti-interference laser stripe center line fast extraction method in an embodiment;

[0023] Figure 2 It is a comparison chart of the effects of two down-sampling methods after down-sampling by 16 times in an embodiment;

[0024] Figure 3 It is a comparison chart of the search results of the region of interest in an embodiment;

[0025] Figure 4 It is a comparison chart of the time consumption data of the center line extraction using the original image and the ROI image in an embodiment;

[0026] Figure 5 It is a schematic diagram of glare noise in an embodiment;

[0027] Figure 6 It is a schematic diagram of the effect of the noise point distribution on the position of the center point in an embodiment;

[0028] Figure 7 It is a schematic diagram of the result of the single-column region division in the target image in an embodiment;

[0029] Figure 8 It is a comparison chart of the extraction effects of the traditional gray barycenter method and the weighted gray barycenter method in an embodiment;

[0030] Figure 9The effect picture of the traditional gray-weighted barycenter algorithm in one embodiment is extracted;

[0031] Figure 10 The effect picture of the pixel gray-weighted barycenter algorithm in one embodiment is extracted;

[0032] Figure 11 The effect picture of the algorithm combining the pixel gray-weighted barycenter and the candidate region non-maximum suppression in one embodiment is extracted. DETAILED DESCRIPTION

[0033] Before the specific embodiment of the present application is described, the overall concept of the present application is described as follows:

[0034] The present application is mainly developed in the extraction process of the laser stripe center line. The traditional gray-weighted barycenter method scans the image pixel by pixel, and when the pixel gray value of a certain pixel exceeds the set threshold g, the pixel position and the pixel gray value are recorded. In the laser stripe image, the black area that does not meet the threshold g accounts for a very large proportion of the overall image. Although the gray-weighted barycenter method does not record the black area which is invalid, the pixel position is still scanned, which causes a large waste of scanning time. At the same time, the traditional gray-weighted barycenter method often has unsatisfactory extraction effect of the laser stripe center line, and is easily affected by interference factors, and the phenomenon of laser stripe center line deviation often occurs.

[0035] The inventor found that the main reason for the above problems is that there are several interferences in the prior art, such as random noise, glare or ghosting, and the original image contains a large number of invalid regions. Therefore, the anti-interference ability of the algorithm can be improved and the real-time performance of the algorithm can be improved to avoid the above problems. Therefore, the present application proposes an anti-interference laser stripe center line fast extraction method,

[0036] In order to improve the real-time performance of the algorithm, the pixel scanning mechanism of the algorithm needs to be improved. By downsampling the original laser stripe image and delimiting the region of interest, the image to be scanned is reduced while the original image information is retained, thereby improving the center line extraction speed.

[0037] In order to improve the anti-interference ability of the algorithm, the present application also introduces the pixel gray-weighted barycenter method and the candidate region non-maximum suppression method to improve the laser center line extraction algorithm, better suppress the influence of speckle noise and glare noise on the extraction center line, so as to accurately extract the laser stripe center line and obviously improve the anti-interference ability.

[0038] Having introduced the overall concept of the present application, in order to make the purpose, technical scheme and advantages of the present application more clear and explicit, the present application will be further described in detail below through specific embodiments combined with the drawings. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.

[0039] In one embodiment, as shown in Figure 1 An anti-interference laser stripe centerline fast extraction method is provided, comprising the following steps:

[0040] Step S101, an initial laser stripe image is acquired, and the initial laser stripe image is down-sampled in a maximum pooling manner.

[0041] Specifically, for the initial laser stripe image, the area with higher pixel grayscale value is regarded as a more important area, and therefore these important areas are set as the region of interest. By down-sampling the initial laser stripe image, the initial laser stripe image is greatly reduced, and the region of interest can be searched faster in the down-sampled image.

[0042] In order to effectively reduce the image size and significantly improve the positioning speed of the region of interest, the down-sampling multiple can be set to a higher multiple, for example, 16 times. However, when the down-sampling multiple is set too large, the traditional linear or nonlinear interpolation down-sampling method will lose more image details, resulting in a problem of obvious loss of laser stripe information when searching for the region of interest. Therefore, the present application adopts a maximum pooling down-sampling manner to retain the image detail information to a greater extent.

[0043] As shown in Figure 2 Fig. 3 is a comparison diagram of the effects of two down-sampling manners after down-sampling by 16 times, from left to right in order: the original laser stripe image (a), the down-sampling result image by using the interpolation manner (b), and the down-sampling result image by using the maximum pooling manner (c). As can be seen from the figure, the result obtained by using the interpolation manner has completely lost the contour information of the original image, and is severely distorted; while the information of the original image is retained after down-sampling by using the maximum pooling manner.

[0044] Step S102, the down-sampled image is searched for the region of interest, the region of interest is intercepted in the initial laser stripe image, and a target image is acquired.

[0045] Specifically, by searching the down-sampled image for the region of interest, the region of interest carrying the initial laser stripe image information and the invalid region are distinguished in the initial laser stripe image, so as to intercept the region of interest and acquire the target image, which facilitates subsequent fast laser centerline extraction according to the target image, improves the extraction speed of the centerline, and ensures real-time performance.

[0046] wherein, the pixel gray threshold and the pixel point number threshold meeting the pixel gray threshold are set, and the pixel point counter is initialized; the ROI upper boundary row coordinate value and the ROI lower boundary row coordinate value of the down-sampled image are searched, the upper boundary and the lower boundary are obtained; whether the upper boundary and the lower boundary coincide is judged according to the difference between the ROI upper boundary row coordinate value and the ROI lower boundary row coordinate value; if not, the region adjustment value is set, the interval from the down-sampling multiple multiplied by the ROI upper boundary row coordinate value minus the region adjustment value to the down-sampling multiple multiplied by the ROI lower boundary row coordinate value plus the region adjustment value is taken as the target image; if yes, it indicates that the search of the region of interest fails, and the initial laser stripe image is taken as the target image.

[0047] Specifically, when searching the region of interest in the initial laser stripe image, first, the pixel gray value threshold g is set, the pixel point number threshold t meeting the pixel gray threshold g is set, and the pixel point counter num=0 is initialized.

[0048] Secondly, the down-sampled image is traversed to search for the ROI upper boundary pixel row coordinate value v' of the image, and the down-sampled image is traversed in the same way to search for the ROI lower boundary pixel coordinate value v" of the image.

[0049] Thirdly, whether the obtained upper and lower boundary is valid is judged according to the searched upper and lower boundary pixel row coordinate values. If the numerical difference between v" and v' is less than 1, it indicates that the upper and lower boundaries coincide, at this time, it belongs to invalid ROI, and the initial laser stripe image can be taken as the region of interest; when the upper and lower boundaries do not coincide, the region adjustment value v is set, and the interval from the down-sampling multiple multiplied by the ROI upper boundary row coordinate value minus the region adjustment value to the down-sampling multiple multiplied by the ROI lower boundary row coordinate value plus the region adjustment value is taken as the ROI. s The interval from v'*16-v s to v" *16+v s of the initial laser stripe image is taken as the ROI, wherein v s is the region adjustment value set to prevent ROI partial omission.

[0050] Finally, after the region of interest is determined, the initial laser stripe image V×U is cropped to the image of V'×U' according to the region of interest, and the image is taken as the target image for subsequent laser stripe center line extraction. When the center line is scanned through the target image, the scanning range is reduced, thereby improving the scanning speed and ensuring the real-time performance of the center line extraction.

[0051] The search process for the upper and lower boundaries is as follows: The downsampled image is traversed row by row from top to bottom. The pixel grayscale value at the current pixel coordinates is compared with the pixel grayscale threshold. A pixel counter counts pixels with a grayscale value greater than the threshold. After traversing one row, it is determined whether the number of pixels meeting the requirements in the current row exceeds the pixel count threshold. If it does, the current row is identified as the upper boundary, and the corresponding ROI upper boundary row coordinates are obtained. If it does not exceed the threshold, the traversal operation continues to the next row. When obtaining the lower boundary, the downsampled image is traversed row by row from bottom to top. The method for determining the lower boundary is the same as that for determining the upper boundary, and the lower boundary and the corresponding ROI lower boundary row coordinates are obtained.

[0052] Specifically, when searching for the upper boundary pixel row coordinate value v′, the downsampled image is traversed row by row from top to bottom. The pixel gray value G(v, u) at the current pixel coordinate is compared with the pixel gray value threshold g. Pixels with a gray value greater than the pixel gray value threshold g are counted as num. After a row is traversed, it is determined whether the number of pixels num that meet the requirements in the current row exceeds the pixel count threshold t. If it exceeds the pixel count threshold t, the pixel coordinate v′ of the current row is set as the upper boundary of the ROI. Otherwise, the traversal operation continues to the next row.

[0053] When searching for the lower boundary pixel row coordinate value v″, the downsampled image is traversed row by row from bottom to top. The pixel gray value G(v, u) at the current pixel coordinate is compared with the pixel gray value threshold g. Pixels with a gray value greater than the pixel gray value threshold g are counted as num. After a row is traversed, it is determined whether the number of pixels num that meet the requirements in the current row exceeds the pixel count threshold t. If it exceeds the pixel count threshold t, the pixel coordinate v″ of the current row is set as the lower boundary of the ROI. Otherwise, the traversal operation of the previous row is continued.

[0054] like Figure 3 The image shows a comparison of the results after performing a region of interest (ROI) search on the initial laser stripe image. The left side shows the initial laser stripe image (a), and the right side shows the ROI image (b). The comparison shows that the ROI image is significantly reduced in size along the row direction, noticeably shrinking the scanning area of ​​the algorithm and thus improving scanning speed.

[0055] In one embodiment, to verify the efficiency of the improved algorithm, a runtime test was conducted. Ten images were randomly selected, and the time taken by the algorithm to extract the center line of the laser stripes was recorded for both the initial laser stripe image and the region of interest image. Specific experimental data are shown below. Figure 4 As shown in the figure, the data shows that using the region of interest image for laser stripe centerline extraction reduces the average processing time of the algorithm by about 6ms, which means the centerline extraction speed of the algorithm is improved by 30%.

[0056] Step S103: The centerline extraction algorithm based on pixel gray value weighting and candidate region non-maximum value suppression is used to extract the centerline of the target image and obtain the centerline of the laser stripe.

[0057] Specifically, after acquiring the target image, the laser stripe pixels within the target image can be scanned. The traditional grayscale centroid method scans along each column of the image, recording the pixel coordinates (v, u) and their corresponding grayscale values ​​G(v, u) that satisfy the threshold g. After scanning a column of pixels, mathematical calculations are performed, using the following formula:

[0058]

[0059] In the V′×U′ image, G(v, u) represents the pixel grayscale value of the pixel in the v-th row and u-th column, where u = 0, 1, 2...U′-1; v = 0, 1, 2...V′-1. Using this mathematical formula, the centroid coordinates (v, u) of the laser stripe in the current column can be calculated. u While this calculation method is simple and efficient, its calculation rules are too simplistic and easily affected by noise. In real-world environments, the projection effect of laser stripes is often influenced by factors such as the reflectivity and absorbance of the object's surface, as well as the intensity of the light source, resulting in noise such as glare and regional ghosting. Traditional calculation methods often exhibit significant deviations in this case, leading to unsatisfactory extraction of the laser stripe centerline. Therefore, this invention employs a centerline extraction algorithm based on pixel grayscale weighting and candidate region non-maximum suppression to extract the centerline of the target image and obtain the laser stripe centerline. This algorithm can suppress the influence of noise such as glare and regional ghosting, thus improving the quality of centerline extraction.

[0060] Among them, the candidate region non-maximum suppression method is used to identify the central region of the laser stripe in the target image; the center line extraction algorithm based on pixel gray value weighting is used to extract the center line of the laser stripe central region and obtain the center line of the laser stripe.

[0061] Specifically, glare noise from laser stripes is usually caused by specular reflection from the surface of metallic objects. It typically appears above or below the center line of the laser stripe, spaced at certain intervals and distributed linearly. The pixel grayscale value is slightly lower than that of the pixel grayscale value in the area along the center line of the laser stripe. Figure 5As shown in the figure, the white dotted circle is the glare noise. Since the gray value of the glare noise is only slightly lower than that of the center area of the laser stripe, the weight coefficients of the two are not significantly different, so the pixel gray value based on the weighted gravity center method cannot well shield the interference of glare. Moreover, the glare often appears randomly above or below the center of the laser stripe, which will cause the center point position to shift significantly up and down, resulting in deviation of the center line extraction, affecting the subsequent three-dimensional reconstruction accuracy.

[0062] In order to suppress the interference of glare noise, the application adopts a candidate region non-maximum suppression algorithm to solve the interference of glare, and changes the previous single-column single-region calculation of the laser stripe center point to a single-column multi-candidate region calculation of the center point. The essence of this method is to divide all pixel points that meet the conditions in the column direction, so as to calculate multiple center point positions, and then analyze according to the corresponding judgment conditions to finally find the appropriate center point position, that is, to well suppress the interference of glare.

[0063] In addition, in the calculation formula of the traditional gray gravity center method, the calculation weight of all pixel gray values is the same, which is 1.0. Because the calculation weight of noise points and non-noise points is consistent, the noise points have obvious interference on the calculation result. Generally, the center line width of the laser stripe is very narrow, usually about 5-10 pixel points. When the noise points are randomly distributed on both sides of the center line, the interference is small, but if the noise points only appear on one side of the center line, the center point position will shift significantly towards the noise point direction, as shown in the figure. Figure 6 In order to reduce the interference of noise points on the gray gravity extraction, the pixel gray value based on the weighted gravity center method is used to suppress the influence of laser speckle noise.

[0064] In the application, the correct laser stripe center area is found out by the candidate region non-maximum suppression algorithm, and the gravity center of the center area is calculated by the pixel gray value based on the weighted gravity center method, so as to extract the laser stripe center line.

[0065] The candidate region non-maximum suppression method is: region division of the target image column by column, obtaining multiple candidate regions; calculating the gray gravity center of the candidate region based on the pixel gray value weighted gravity center method, obtaining several gravity center points, and calculating the gray mean value of the candidate region, the gray mean value calculation formula is:

[0066]

[0067] Compare the gray mean values of all candidate regions to obtain the candidate region with the maximum pixel gray mean value as the laser stripe center region.

[0068] Specifically, the target image is scanned column by column, and the pixels meeting the requirements in the column are regionally divided. The pixels meeting the requirements are the pixels with pixel gray scale values greater than a pixel gray scale threshold. Meanwhile, the number of pixels in the regionally divided region is counted. The region with the number of pixels greater than or equal to a preset threshold is identified as a candidate region, and the region with the number of pixels less than the preset threshold is identified as a noise point. The barycenter of the remaining candidate region is calculated by a pixel gray scale value weighted barycenter method to obtain the barycenter of the region. Finally, m barycenters are obtained, and the pixel gray scale mean g' of each candidate region is also calculated.

[0069] It can be found from the principle of the generation of glare noise that the pixel gray scale value of the glare region is close to the pixel gray scale value of the center region of the laser stripe, but is always slightly lower than that of the center region of the laser stripe. Therefore, by comparing the size of the pixel gray scale mean in all candidate regions, the candidate region m corresponding to the maximum pixel gray scale mean is found max(g′) , and the remaining candidate regions are removed, that is, the center region of the laser stripe is obtained.

[0070] The process of determining the candidate region is specifically as follows: distance and quantity thresholds are set, the target image is scanned column by column, and the pixels with pixel gray scale values greater than a pixel gray scale threshold are recorded in sequence; the distance between adjacent pixels in the recorded pixels is calculated, and it is determined that the adjacent pixels belong to different regions when the distance is greater than the distance threshold; after the single column scanning is completed, a plurality of regions are obtained, the number of pixels in the plurality of regions is counted, and the region with the number of pixels greater than the quantity threshold is retained as a candidate region; after the region division of all columns of the target image is completed, a plurality of candidate regions are obtained.

[0071] Specifically, the target image is scanned column by column, and the pixels meeting the requirements in the column are regionally divided. The pixels meeting the requirements are the pixels with pixel gray scale values greater than a pixel gray scale threshold. Meanwhile, the number of pixels in the regionally divided region is counted. The region with the number of pixels greater than or equal to a preset threshold is identified as a candidate region, and the region with the number of pixels less than the preset threshold is identified as a noise point. The barycenter of the remaining candidate region is calculated by a pixel gray scale value weighted barycenter method to obtain the barycenter of the region. Finally, m barycenters are obtained, and the pixel gray scale mean g' of each candidate region is also calculated. Figure 7 The distance between the two pixels is calculated. When it is found that the calculated distance exceeds the distance threshold d, it is considered that the current pixel has a position jump and belongs to the next region. After the single column scanning is completed, n regions will be recorded, as shown in

[0072] The pixel gray scale value weighted barycenter method is used to calculate the gray barycenter of the center region of the laser stripe, and the gray barycenter is taken as the laser stripe center of each column. After the traversal of all columns of the center region of the laser stripe is completed, the laser stripe center line is obtained according to the laser stripe centers of all columns.

[0073] Specifically, after obtaining the central region of the laser stripe, the pixel gray value weighted centroid method is used to calculate all gray-level centroids in the central region of the laser stripe. Each gray-level centroid is taken as the center of the laser stripe in its column. After traversing all columns of the central region of the laser stripe, all laser stripe centers in the central region of the laser stripe are obtained. All laser stripe centers form the center line of the laser stripe, realizing the extraction of the center line of the target image, and the center line obtained has high accuracy.

[0074] Specifically, the pixel grayscale value weighting method is as follows: When the target image is V′×U′, the centerline extraction algorithm based on the pixel grayscale value weighting method is:

[0075]

[0076]

[0077] In the formula, G(v, u) represents the pixel gray value of the v-th row and u-th column, where u = 0, 1, 2...U′-1, v = 0, 1, 2...V′-1, and α is the squared weight coefficient of the pixel gray value.

[0078] Specifically, to reduce the interference of noise on grayscale centroid extraction, a pixel grayscale value weight squared coefficient α is introduced into the calculation formula. The weight squared coefficient α significantly reduces the interference of noise on the grayscale centroid calculation result. For example, for a noise pixel with a grayscale value of 127, its weight coefficient in the actual calculation process is α = 0.25, which is 4 times lower than the original weight coefficient, thus significantly suppressing noise.

[0079] like Figure 8 The image shows a comparison of the extraction results using the traditional grayscale centroid method and the weighted grayscale centroid method. The left side shows the extraction result of the traditional method (a), and the right side shows the extraction result of the weighted method (b). As can be seen from the image, the central stripe obtained by the traditional grayscale centroid method is easily affected by laser speckle noise, resulting in discontinuities and shifts. In contrast, the central line extracted by the pixel grayscale weighted centroid method of this invention is smoother and more continuous, accurately reflecting the trend of the laser stripe and better suppressing the influence of laser speckle noise.

[0080] like Figures 9 to 11 As shown, it can be seen that the center line of the laser stripe is severely shifted after being interfered with by glare noise in the traditional extraction method; after introducing pixel gray value weighting center line, the originally shifted center line has a significant rebound, but it is still in a shifted state; when the candidate region non-maximum value suppression method is adopted, the interference of glare noise can be completely avoided, and a high-precision center line extraction effect can be achieved.

[0081] In the embodiment, by acquiring an initial laser stripe image, the initial laser stripe image is down-sampled in a maximum pooling manner to accelerate the search speed of a subsequent region of interest, the region of interest is intercepted from the initial laser stripe image by searching the region of interest in the down-sampled image, a target image is acquired, the extraction speed of the center line is improved, a center line extraction algorithm based on a pixel gray value weighted barycenter method and a candidate region non-maximum suppression method is used to extract the center line of the target image, the laser stripe center line is acquired, the adverse effects of speckle noise and glare noise on the center line extraction can be inhibited, the extraction effect of the center line is ensured, and better real-time detection capability is achieved.

[0082] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, the processes of the above-mentioned embodiments of each method can be included. The storage medium can be a magnetic disc, an optical disc, a read-only memory (ROM) or a random access memory (RAM), etc.

[0083] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present application can be realized by a general computing device, which can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Alternatively, they can be realized by program codes executable by a computing device, so that they can be stored in a computer storage medium (ROM / RAM, magnetic disc, optical disc) and executed by a computing device. In some cases, the steps shown or described can be executed in different orders, or they can be manufactured into individual integrated circuit modules or a single integrated circuit module. Therefore, the present application is not limited to any specific hardware and software combination.

[0084] The above is a further detailed description of the present application in combination with specific embodiments, and the specific implementation of the present application should not be limited to these descriptions. For ordinary skilled persons in the technical field to which the present application belongs, some simple deductions or replacements can be made without departing from the concept of the present application, and all of them should be regarded as falling within the protection scope of the present application.

Claims

1. An anti-interference laser stripe centerline fast extraction method, characterized in that, The method comprises the following steps: acquiring an initial laser stripe image, and performing down-sampling on the initial laser stripe image by using a max-pooling manner; searching a region of interest in the down-sampled image, and cutting a region of interest in the initial laser stripe image to acquire a target image; performing center line extraction on the target image by using a center line extraction algorithm based on a pixel gray value weighted barycenter method and a candidate region non-maximum suppression method to acquire a laser stripe center line, comprising: identifying a laser stripe center region in the target image based on the candidate region non-maximum suppression method; performing center line extraction on the laser stripe center region by using the center line extraction algorithm based on the pixel gray value weighted barycenter method to acquire the laser stripe center line, comprising: calculating all gray barycenters of the laser stripe center region by using the pixel gray value weighted barycenter method, and taking the gray barycenters as laser stripe centers of each column; and after completing the traversal of all columns of the laser stripe center region, acquiring the laser stripe center line according to the laser stripe centers of all columns.

2. The method according to claim 1, wherein, The searching of the region of interest in the down-sampled image, the cutting of the region of interest in the initial laser stripe image, and the acquisition of the target image specifically comprise: setting a pixel gray threshold and a pixel point number threshold meeting the pixel gray threshold, and initializing a pixel point counter; searching an ROI upper boundary row coordinate value and an ROI lower boundary row coordinate value of the down-sampled image to acquire an upper boundary and a lower boundary; judging whether the upper boundary and the lower boundary coincide according to a difference between the ROI upper boundary row coordinate value and the ROI lower boundary row coordinate value; if the upper boundary and the lower boundary do not coincide, setting a region adjustment value, taking an interval from a product of a down-sampling multiple and the ROI upper boundary row coordinate minus the region adjustment value to a product of the down-sampling multiple and the ROI lower boundary row coordinate plus the region adjustment value as the region of interest, cutting the region of interest in the initial laser stripe image to acquire the target image; if the upper boundary and the lower boundary coincide, indicating that the searching of the region of interest fails, and taking the initial laser stripe image as the target image.

3. The method according to claim 2, wherein, The searching of the ROI upper boundary row coordinate value and the ROI lower boundary row coordinate value of the down-sampled image to acquire the upper boundary and the lower boundary specifically comprises: performing row-by-row traversal on the down-sampled image from top to bottom, comparing a pixel gray value at a current pixel coordinate with the pixel gray threshold, and counting, by the pixel point counter, pixel points greater than the pixel gray threshold; after one row is traversed, judging whether a number of pixel points meeting a requirement in the current row exceeds the pixel point number threshold, if yes, taking the current row as the upper boundary to acquire the ROI upper boundary row coordinate value, and if no, continuing the next row traversal operation; when acquiring the lower boundary, performing row-by-row traversal on the down-sampled image from bottom to top, the lower boundary identification method being the same as that of the upper boundary, and the lower boundary and the corresponding ROI lower boundary row coordinate value being acquired.

4. The method according to claim 2, wherein, The identification of the laser stripe center region in the target image based on the candidate region non-maximum suppression method specifically comprises: The target image is regionally divided column by column to obtain a plurality of candidate regions; The gray-weighted center method based on pixel gray value is used to calculate the gray-weighted center of the candidate region to obtain a plurality of weighted center points, and the gray mean value of the candidate region is calculated, and the gray mean value calculation formula is: The gray mean values in all candidate regions are compared to obtain a candidate region with the maximum pixel gray mean value, which is taken as the laser stripe center region.

5. The method according to claim 4, wherein, The target image is regionally divided column by column to obtain a plurality of candidate regions, and specifically includes: A distance threshold and a quantity threshold are set, and the pixel points of the target image are scanned column by column, and the pixel points with a pixel gray value greater than the pixel gray threshold are recorded in sequence; The distance between adjacent pixel points in the recorded pixel points is calculated, and when the distance is greater than the distance threshold, the adjacent pixel points are determined to belong to different regions; After a single column is scanned, a plurality of regions are obtained, the number of pixel points in the plurality of regions is counted, and the region with a pixel point number greater than the quantity threshold is retained and determined as a candidate region; After the regional division of all columns of the target image is completed, a plurality of candidate regions are obtained.

6. The method of claim 1, wherein, The gray-weighted center method based on pixel gray value specifically includes: When the target image is V ′ ×U ′ , the center line extraction algorithm based on the pixel gray value weighted barycenter method is: In the formula, G(v, u) represents the pixel gray value of the pixel point in the vth row and the ut column, wherein u = 0, 1, 2,..., U ′ -1, v = 0, 1, 2,..., V ′ -1, and a is a pixel gray value weight square coefficient.

Citation Information

Patent Citations

  • Positioning method for sub-pixel at center of line laser in three-dimensional laser scanning system

    CN107203973A

  • Light spot center detecting method for transmission type target image and bridge deflection image type detecting device

    CN109631787A