A method, apparatus, product, and medium for improving the accuracy of a triangulation radar

CN122815445APending Publication Date: 2026-09-25广东兴颂科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611222732.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

由于光斑形状的这种变化,导致在不同距离处定位得到的光斑位置与真实值存在较大偏差,从而影响了三角测距雷达的测距精度

Benefits of technology

本申请通过差分处理消除背景噪声得到纯净的信号帧,然后通过均值滤波平滑回波波形数据,再基于梯度加权质心法对回波波形数据进行定位处理,根据回波波形数据的梯度值对激光反射光斑覆盖区域内的各像素点赋予不同权重,使得光斑形状较为尖锐陡峭时梯度值较大的像素点获得更高的权重,而光斑形状较为平缓展宽时梯度值较小的像素点获得相对较低的权重,从而使质心位置的计算能够自适应地反映光斑的实际形状特征。由于梯度加权质心法能够根据不同距离处光斑形状的变化动态调整各像素点的权重分配,有效补偿了光学系统离焦效应导致的光斑形状变化对质心定位的影响,减小了在不同距离处定位得到的光斑位置与真实值之间的偏差,最后通过对初始距离值进行补偿校正进一步消除系统误差,从而提高了三角测距雷达在不同距离范围内的测距精度和稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122815445A_ABST
    Figure CN122815445A_ABST
Patent Text Reader

Abstract

The application discloses a method, device, product and medium for improving the precision of a triangulation radar, and relates to the technical field of radar ranging. The method comprises the following steps: collecting a background frame and a signal background superposition frame of a target object by a triangulation radar; performing difference processing on the signal background superposition frame and the background frame to generate a signal frame after base elimination; performing mean filtering processing on the signal frame to obtain smoothed echo waveform data; performing positioning processing on the echo waveform data based on a gradient weighted centroid method to obtain the centroid position of a laser reflection light spot, wherein the gradient weighted centroid method gives different weights to each pixel point in the laser reflection light spot coverage area according to the gradient value of the echo waveform data; calculating an initial distance value of the triangulation radar to the target object according to the centroid position, and performing compensation correction on the initial distance value to obtain a corrected target distance, thereby improving the ranging precision of the triangulation radar in different distance ranges.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of radar ranging technology, specifically to a method, device, product, and medium for improving the accuracy of triangulation ranging radar. Background Technology

[0002] Triangulation ranging radar, as an active optical ranging device, calculates the target distance by emitting lasers and receiving the light spots reflected back from the target object based on the principle of triangulation. It is widely used in industrial inspection, robot navigation, 3D scanning and other fields.

[0003] In practical applications of triangulation radar, a laser beam emitted by a laser emitter illuminates the surface of a target object. The reflected light is then focused onto a linear array sensor by a receiving lens, forming a light spot. By determining the position of this light spot on the linear array sensor, the target distance can be calculated based on trigonometric geometry. However, when the laser is emitted to targets at different distances, the shape of the light spot returning to the linear array sensor changes significantly due to the defocusing effect of the optical system. The echo light spot from close-range targets is sharper and steeper, with a concentrated peak; while the echo light spot from distant targets is relatively flat and wider, with dispersed energy. This change in the light spot shape leads to a significant deviation between the obtained spot position at different distances and the true value, thus affecting the ranging accuracy of the triangulation radar. Summary of the Invention

[0004] In view of this, this application provides a method, device, product, and medium for improving the accuracy of triangulation ranging radar.

[0005] In a first aspect, this application provides a method for improving the accuracy of triangulation ranging radar, the method comprising: The background frame and signal-background superimposed frame of the target object are acquired by the triangulation ranging radar. The signal-background superimposed frame and the background frame are differentially processed to generate the signal frame after basis elimination. The signal frame is subjected to mean filtering to obtain smoothed echo waveform data; The echo waveform data is localized using the gradient-weighted centroid method to obtain the centroid position of the laser reflection spot. The gradient-weighted centroid method assigns different weights to each pixel within the coverage area of ​​the laser reflection spot according to the gradient value of the echo waveform data. The initial distance value of the triangulation radar to the target object is calculated based on the centroid position, and the initial distance value is compensated and corrected to obtain the corrected target distance.

[0006] By employing the above technical solution, background noise is eliminated through differential processing to obtain a clean signal frame. Then, the echo waveform data is smoothed through mean filtering. Next, the echo waveform data is processed for positioning based on the gradient-weighted centroid method. Different weights are assigned to each pixel within the laser reflection spot coverage area according to the gradient value of the echo waveform data. Pixels with larger gradient values ​​receive higher weights when the spot shape is sharp and steep, while pixels with smaller gradient values ​​receive relatively lower weights when the spot shape is flat and wide. This allows the centroid calculation to adaptively reflect the actual shape characteristics of the spot. Since the gradient-weighted centroid method can dynamically adjust the weight allocation of each pixel according to the changes in the spot shape at different distances, it effectively compensates for the impact of spot shape changes caused by the defocusing effect of the optical system on centroid positioning, reducing the deviation between the spot position obtained at different distances and the true value. Finally, system errors are further eliminated by compensating and correcting the initial distance value, thereby improving the ranging accuracy and stability of the triangulation radar within different distance ranges.

[0007] Optionally, the background frame and signal-background superimposed frame of the target object are acquired by a triangulation ranging radar, and the signal-background superimposed frame and the background frame are differentially processed to generate a basis-reduced signal frame, including: The opening and closing state of the laser emitter of the triangular ranging radar is controlled in an alternating timing manner to acquire a first background frame, a signal background superimposed frame, and a second background frame, wherein the acquisition time of the first background frame and the second background frame are respectively located before and after the acquisition time of the signal background superimposed frame. Calculate the ratio of the time interval between the acquisition time of the signal background superimposed frame and the acquisition time of the first background frame and the acquisition time of the second background frame; Based on the time interval ratio, the first background frame and the second background frame are time-weighted interpolated to obtain an equivalent background frame corresponding to the acquisition time of the signal background superimposed frame. The signal background superimposed frame is subtracted pixel by pixel from the equivalent background frame, and pixels with negative differences are set to zero to generate the signal frame after the base is eliminated.

[0008] Optionally, the signal frame is subjected to mean filtering to obtain smoothed echo waveform data, including: Calculate the local variance value of each pixel in the signal frame, and divide the signal frame into a spot candidate region and a background region based on the local variance value; The first filtering window is determined based on the noise level of the signal frame; Calculate the local gradient magnitude of each pixel within the candidate spot region, and determine the width of the second filtering window based on the local gradient magnitude, wherein the larger the local gradient magnitude, the smaller the width of the second filtering window. The background region and the candidate spot region are subjected to mean filtering using the first filtering window and the second filtering window, respectively, to obtain the smoothed echo waveform data.

[0009] Optionally, before performing localization processing on the echo waveform data based on the gradient-weighted centroid method, the method further includes: Obtain the peak pixel position in the echo waveform data, and take the sum of the gray values ​​of all pixels in the echo waveform data as the total gray value of the spot; The grayscale value is accumulated pixel by pixel from the peak pixel position to both sides, and the energy accumulation ratio of the accumulated grayscale value on each side to the total grayscale value of the spot is calculated. The pixel positions corresponding to the first time the energy accumulation ratio on both sides reaches the preset energy ratio threshold are determined as the left and right boundaries of the spot coverage area. Determine whether the pixel span between the left and right boundaries is less than the preset minimum effective span. If so, redetermine the left and right boundaries of the spot coverage area by expanding the preset number of pixels to both sides from the peak pixel position. The area formed by all pixels between the left and right boundaries is defined as the area covered by the laser reflection spot.

[0010] Optionally, the echo waveform data is localized using the gradient-weighted centroid method to obtain the centroid position of the laser reflection spot, including: Calculate the gradient value of each pixel within the area covered by the laser reflection spot in the echo waveform data. The gradient value is obtained by taking the absolute value of the difference between the gray values ​​of the adjacent pixels before and after each pixel and then dividing it equally. A linear combination weight for each pixel is constructed by superimposing a base value on the product of a preset variable factor and the gradient value. The centroid position of the laser reflection spot is obtained by summing the product of the gray value of each pixel, the linear combination weight, and the position index on the linear array sensor of the triangular ranging radar, and dividing by the sum of the product of the gray value of each pixel and the corresponding linear combination weight.

[0011] Optionally, the initial distance value of the triangulation radar to the target object is calculated based on the centroid position, and the initial distance value is compensated and corrected to obtain the corrected target distance, including: Determine the pixel offset between the centroid position and the preset optical axis reference pixel position on the linear array sensor of the triangular ranging radar; Multiply the pixel offset by the physical size of a single pixel of the linear array sensor to obtain the physical offset distance of the centroid position relative to the optical axis. The initial distance value is calculated based on the optical baseline length of the triangulation radar, the focal length of the receiving lens, and the physical offset distance. The peak gray level, spot width, and the ratio of the width of the left and right halves of the spot are obtained as the spot characteristic parameters. The initial distance value is compensated and corrected based on the light spot feature parameters to obtain the corrected target distance.

[0012] Optionally, the initial distance value is compensated and corrected based on the spot feature parameters to obtain the corrected target distance, including: The signal strength level of the current echo is determined based on the ratio of the peak gray level to the spot width; A corresponding calibration dataset is selected based on the signal strength level, wherein the calibration dataset contains the correspondence between the initial distance values ​​and the actual distance values ​​at multiple calibration distances under the signal strength level; The calibration dataset is fitted using the least squares method to obtain the distance correction relationship corresponding to the current signal strength level; The asymmetry of the light spot is calculated based on the ratio of the width of the left and right halves of the peak, and the centroid offset compensation amount is determined based on the deviation between the asymmetry of the light spot and the preset symmetry reference value. The initial distance value is superimposed with the centroid offset compensation amount, and then substituted into the distance correction relationship for calculation to obtain the corrected target distance.

[0013] A second aspect of this application provides an electronic device for improving the accuracy of a triangulation ranging radar. The electronic device includes one or more processors and a memory; the memory is coupled to the one or more processors and is used to store computer program code, the computer program code including computer instructions, which the one or more processors call to cause the electronic device for improving the accuracy of the triangulation ranging radar to perform the methods described in the first aspect and any possible implementation thereof.

[0014] A third aspect of this application provides a computer program product containing instructions that, when run on an electronic device for improving the accuracy of a triangulation ranging radar, cause the electronic device to perform the method described in the first aspect and any possible implementation thereof.

[0015] A fourth aspect of this application provides a computer-readable storage medium including instructions that, when executed on an electronic device for improving the accuracy of a triangulation ranging radar, cause the electronic device to perform the method described in the first aspect and any possible implementation thereof.

[0016] In summary, one or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: This application eliminates background noise through differential processing to obtain a clean signal frame. Then, it smooths the echo waveform data using mean filtering. Next, it performs positioning processing on the echo waveform data based on the gradient-weighted centroid method. Different weights are assigned to each pixel within the laser reflection spot coverage area according to the gradient value of the echo waveform data. Pixels with larger gradient values ​​receive higher weights when the spot shape is sharp and steep, while pixels with smaller gradient values ​​receive relatively lower weights when the spot shape is flat and wide. This allows the centroid calculation to adaptively reflect the actual shape characteristics of the spot. Because the gradient-weighted centroid method can dynamically adjust the weight allocation of each pixel according to the changes in the spot shape at different distances, it effectively compensates for the impact of spot shape changes caused by optical system defocusing on centroid positioning, reducing the deviation between the obtained spot position at different distances and the true value. Finally, compensation and correction of the initial distance value further eliminates system errors, thereby improving the ranging accuracy and stability of the triangulation radar within different distance ranges. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating a method for improving the accuracy of triangulation ranging radar provided in an embodiment of this application; Figure 2 This is a schematic diagram illustrating the background noise removal effect provided in an embodiment of this application; Figure 3 This is a schematic diagram of a signal frame after mean filtering provided in an embodiment of this application; Figure 4 This is a schematic diagram of the light spot position distribution at different distances provided in an embodiment of this application; Figure 5 This is a schematic diagram of an exemplary hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0018] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0019] In the description of the embodiments of this application, the words "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design that is described as "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design options. Rather, the use of the words "for example" or "for instance" is intended to present the relevant concepts in a specific manner.

[0020] In the description of the embodiments of this application, the term "multiple" means two or more. For example, multiple systems means two or more systems, and multiple screen terminals means two or more screen terminals. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0021] Please refer to Figure 1 A flowchart illustrating a method for improving the accuracy of triangulation ranging radar is presented. This method can be implemented using a computer program, a microcontroller, or run on a device designed to improve the accuracy of triangulation ranging radar. The computer program can be integrated into the computer device or run as a standalone application. Specifically, the method includes steps 10 to 40, as follows: Step 10: Acquire background frames and signal-background superimposed frames of the target object using triangulation ranging radar, perform differential processing on the signal-background superimposed frames and background frames to generate a base-removed signal frame.

[0022] In this embodiment of the application, triangulation ranging radar refers to an optical ranging device that uses laser as a detection light source, receives the laser spot reflected by the target object through a linear array sensor, and calculates the target distance based on the principle of triangulation.

[0023] Background frames refer to image data acquired by a linear array sensor that contains only ambient background light information when the laser emitter is turned off.

[0024] The signal-background superimposed frame refers to the image data acquired by the linear array sensor when the laser emitter is turned on, which simultaneously contains the laser reflection spot signal and the ambient background light information.

[0025] A signal frame refers to image data containing only the laser reflection spot signal obtained by differential processing of the signal background superimposed frame and the background frame to eliminate the influence of ambient background light.

[0026] Please see Figure 2This diagram illustrates the background noise removal effect provided in an embodiment of this application. The diagram shows the background noise removal process. The horizontal axis represents the pixel position number of the linear array sensor, ranging from 0 to 1024, representing the 1024 photosensitive pixels arranged sequentially on the linear array sensor. The vertical axis represents the grayscale value collected at each pixel position, ranging from 0 to 4096. The upper left image shows the signal-background superimposed frame collected by the linear array sensor when the laser emitter is on, and the upper right image shows the background frame collected by the linear array sensor when the laser emitter is off. The lower image shows the signal-background superimposed frame and the background frame being differentially processed to generate the signal frame after substrate elimination. This background noise removal method can effectively eliminate ambient light interference and the influence of sensor dark current.

[0027] As an optional embodiment, the step of acquiring background frames and signal-background superimposed frames of the target object using a triangulation ranging radar, and performing differential processing on the signal-background superimposed frames and the background frames to generate a base-removed signal frame may further include the following steps: Step 101: Control the opening and closing state of the laser emitter of the triangular ranging radar in an alternating timing manner to acquire the first background frame, the signal background superimposed frame, and the second background frame, wherein the acquisition time of the first background frame and the second background frame are respectively located before and after the acquisition time of the signal background superimposed frame.

[0028] Specifically, in actual measurement environments, ambient lighting conditions may change over time, such as flickering indoor lighting or slow drifting of outdoor light. If only a single background frame is collected for differential processing, changes in ambient light between the background frame acquisition time and the signal-background superposition frame acquisition time will result in significant residual background light errors in the differential results. To obtain background data that accurately reflects the ambient light state at the time of signal-background superposition frame acquisition, this embodiment uses an alternating timing method to control the on / off state of the laser emitter for multi-frame data acquisition. At the first time t1, the laser emitter of the triangulation ranging radar is controlled to be off, and the linear array sensor only receives ambient background light, acquiring the first background frame. At the second time t2, the laser emitter is controlled to be on, emitting laser light towards the target object. The linear array sensor simultaneously receives the laser reflection spot and ambient background light, acquiring the signal-background superposition frame. At the third time t3, the laser emitter is controlled to be off again, and the linear array sensor again only receives ambient background light, acquiring the second background frame.

[0029] Step 102: Calculate the time interval ratio between the acquisition time of the signal background superimposed frame and the acquisition time of the first background frame and the second background frame.

[0030] Specifically, in order to accurately estimate the ambient background light state at the acquisition time of the signal background superimposed frame based on the first and second background frames, it is necessary to determine the relative positional relationship between the acquisition time of the signal background superimposed frame and the acquisition times of the two preceding and following background frames. This embodiment quantifies this relative positional relationship by calculating the time interval ratio. First, the time interval Δt1 = t2 - t1 between the acquisition time t2 of the signal background superimposed frame and the acquisition time t1 of the first background frame is calculated. This time interval reflects the elapsed time from the acquisition of the first background frame to the acquisition of the signal background superimposed frame. Then, the time interval Δt2 = t3 - t2 between the acquisition time t2 of the signal background superimposed frame and the acquisition time t3 of the second background frame is calculated. This time interval reflects the elapsed time from the acquisition of the signal background superimposed frame to the acquisition of the second background frame. Next, the time interval ratios are calculated, namely, the ratio of Δt1 to the total time interval (Δt1 + Δt2) k1 = Δt1 / (Δt1 + Δt2), and the ratio of Δt2 to the total time interval k2 = Δt2 / (Δt1 + Δt2). These two ratios satisfy k1+k2=1, where k1 reflects the relative distance between the acquisition time of the signal background superimposed frame and the acquisition time of the first background frame, and k2 reflects the relative distance between the acquisition time of the signal background superimposed frame and the acquisition time of the second background frame.

[0031] Step 103: Perform time-weighted interpolation on the first background frame and the second background frame according to the time interval ratio to obtain the equivalent background frame corresponding to the acquisition time of the signal background superimposed frame.

[0032] Specifically, based on the calculated time interval ratio, this embodiment performs time-weighted interpolation on the first background frame and the second background frame to obtain the equivalent background frame corresponding to the acquisition time of the signal background superimposed frame. This interpolation method is based on the reasonable assumption that the ambient light changes linearly over a short period of time, that is, it is assumed that the ambient background light changes linearly over time between the acquisition time t1 of the first background frame and the acquisition time t3 of the second background frame. For each pixel i acquired by the linear array sensor, its grayscale value in the equivalent background frame is calculated according to the following formula: Equivalent background value (i) = pixel value of the first background frame (i) × k2 + pixel value of the second background frame (i) × k1, where k1 and k2 are the time interval ratios calculated in step 102. Since k2 = Δt2 / (Δt1 + Δt2) represents the relative distance between the acquisition time of the signal background superimposed frame and the acquisition time of the second background frame, the first background frame is assigned a weight of k2. Correspondingly, k1 = Δt1 / (Δt1 + Δt2) represents the relative distance between the acquisition time of the signal background superimposed frame and the acquisition time of the first background frame, so the second background frame is assigned a weight of k1. This weight allocation follows the principle of "the closer the distance, the greater the weight," ensuring that the equivalent background frame accurately reflects the ambient light state at the acquisition time of the signal background superimposed frame. By performing the above weighted interpolation calculation on each pixel, the complete equivalent background frame can be obtained.

[0033] Step 104: Subtract the signal background superimposed frame from the equivalent background frame pixel by pixel, and set the pixels with negative difference to zero to generate the signal frame after basis elimination.

[0034] Specifically, after obtaining the equivalent background frame, the ambient background light component in the signal background overlay frame needs to be eliminated to extract the pure laser reflection spot signal. This embodiment performs a pixel-by-pixel difference operation between the signal background overlay frame and the equivalent background frame. For each pixel i, its difference value is calculated: Difference value (i) = Pixel value of signal background overlay frame (i) - Pixel value of equivalent background frame (i). Since the signal background overlay frame contains both the laser reflection spot signal and ambient background light, while the equivalent background frame only contains the ambient background light corresponding to the acquisition time of the signal background overlay frame, the difference operation can effectively eliminate the influence of ambient background light. However, at some pixel locations, due to noise fluctuations or interpolation errors, the pixel grayscale value of the equivalent background frame may be greater than the corresponding pixel grayscale value of the signal background overlay frame; in this case, the difference value is negative. A negative grayscale value does not exist physically, representing that there is actually no laser reflection spot signal at that pixel location. Therefore, in this embodiment, all pixels with negative difference values ​​are processed by setting their grayscale values ​​to zero, i.e., the signal frame pixel value (i) = max(difference value (i), 0). Through this pixel-by-pixel subtraction and setting negative values ​​to zero, a base-removed signal frame is generated. This signal frame effectively eliminates the influence of ambient background light, retaining only the true signal of the laser reflection spot. Furthermore, because time-weighted interpolation is used to obtain the equivalent background frame, even when the ambient light changes slowly, a relatively accurate background light estimate can be obtained, thereby improving the accuracy of background removal.

[0035] Step 20: Perform mean filtering on the signal frame to obtain smoothed echo waveform data.

[0036] In this embodiment of the application, the echo waveform data refers to the smooth light intensity distribution data obtained after the signal frame is subjected to mean filtering. This data is composed of the position of each pixel of the linear array sensor as the abscissa and the gray value of the pixel after filtering and smoothing as the ordinate.

[0037] Ideally, the signal frame after basis elimination is a smooth waveform. In this case, we only need to find the pixel where the peak is located, and then take a certain number of parameters before and after the peak to find the accurate centroid position. However, due to the influence of structure, optics and other external factors, the obtained signal frame may not be smooth. If the centroid position is directly calculated based on the peak, there may be a large difference from the actual centroid position, resulting in a large deviation in the final calculated distance. Therefore, mean filtering is required after obtaining the signal frame.

[0038] Please see Figure 3The diagrams above illustrate the signal frame provided in this embodiment after mean filtering. The left image shows the signal spot after background noise removal. Due to structural, optical, and other external factors, the spot surface exhibits obvious burrs and high-frequency noise fluctuations, resulting in an overall uneven contour. The right image shows the spot after mean filtering, which effectively smooths the spot curve, eliminates burr noise, and makes the spot shape closer to an ideal smooth waveform. This filtering process reduces noise interference in centroid position calculation, improves the accuracy and stability of centroid positioning, and thus reduces distance measurement deviation.

[0039] As an optional embodiment, the step of performing mean filtering on the signal frame to obtain smoothed echo waveform data may further include the following steps: Step 201: Calculate the local variance value of each pixel in the signal frame, and divide the signal frame into spot candidate region and background region based on the local variance value.

[0040] Specifically, since the signal frame contains laser reflection spot signals and residual noise, in order to adopt a more refined filtering strategy in subsequent mean filtering processing, it is necessary to first identify which regions belong to the spot coverage area and which regions belong to the background area. The grayscale values ​​of pixels in the spot coverage area change drastically, while the grayscale values ​​of pixels in the background area are relatively stable. Therefore, local variance can be used to distinguish between these two types of regions. For each pixel i in the signal frame, its local variance value is calculated. A local window centered on pixel i (e.g., with a width of 5 or 7 pixels) is selected, and the variance of the grayscale values ​​of all pixels within this window is calculated. Pixels with local variance values ​​greater than this threshold are classified as spot candidate regions, and pixels with local variance values ​​less than or equal to this threshold are classified as background regions. This provides accurate region identification for subsequent application of different filtering parameters to different regions.

[0041] Step 202: Determine the first filtering window based on the noise level of the signal frame.

[0042] Specifically, for the background region, since this region mainly consists of residual noise, the purpose of filtering is to suppress the noise as much as possible. Therefore, it is necessary to determine an appropriate filtering window width based on the noise level of the signal frame. First, calculate the standard deviation σ_noise of the gray values ​​of all pixels in the background region. This standard deviation reflects the strength of the background noise. Then, establish a mapping relationship between the noise standard deviation and the first filtering window width W1, for example, using a piecewise linear function: when σ_noise is less than the threshold σ1, W1 takes the minimum window width W. min (For example, 3 pixels); when σ_noise is greater than the threshold σ2, W1 takes the maximum window width W. max(For example, 9 pixels); when σ_noise is between σ1 and σ2, W1 is calculated by linear interpolation. The first filtering window determined in this way can be adaptively adjusted according to the actual noise level, using a wider window to enhance noise suppression when the noise is high, and using a narrower window to avoid over-smoothing when the noise is low.

[0043] Step 203: Calculate the local gradient magnitude of each pixel within the candidate spot region, and determine the width of the second filtering window based on the local gradient magnitude, where the larger the local gradient magnitude, the smaller the width of the second filtering window.

[0044] Specifically, for candidate spot regions, the filtering process needs to preserve the shape feature information of the spot while suppressing noise. Near the edge or peak of the spot, where grayscale changes are drastic and local gradient amplitudes are large, a narrower filtering window is needed to avoid losing feature information. In areas with smoother spot textures, grayscale changes are flat and local gradient amplitudes are small, allowing for a wider filtering window to achieve better noise suppression. For each pixel i within the candidate spot region, its local gradient amplitude is calculated, for example using the center difference method: gradient amplitude(i) = |pixel value(i+1) - pixel value(i-1)| / 2. Then, an inverse proportional mapping relationship is established between the gradient amplitude and the width W2 of the second filtering window, for example using an inverse proportional function: W2(i) = k / [gradient amplitude(i) + ε] + b, where k and b are preset proportionality coefficients and bias constants, ε is a small positive number to avoid division by zero, and upper and lower limits W2_min and W2_max (e.g., 3 and 7 pixels) are set for limiting the window width. This adaptive window width determination method based on local gradient magnitude uses a narrower filter window to preserve shape features in locations where the light spot gradient changes drastically, and a wider filter window to enhance noise suppression in locations where the light spot gradient changes gently.

[0045] Step 204: Apply mean filtering to the background region and the candidate spot region using the first and second filtering windows respectively to obtain smoothed echo waveform data.

[0046] Specifically, for each pixel *i* in the background region, a first filtering window of width *W1* is constructed centered on that pixel, and the arithmetic mean of the grayscale values ​​of all pixels within this window is calculated as the filtered pixel value. For each pixel *i* in the candidate spot region, a second filtering window of width *W2(i)* is constructed centered on that pixel, and the arithmetic mean of the grayscale values ​​of all pixels within this window is calculated as the filtered pixel value. Combining the filtered pixel values ​​from the background region and the candidate spot region yields the smoothed echo waveform data. Through this region-specific, adaptive window width mean filtering process, sufficient noise suppression is achieved in the background region, while a good balance between noise suppression and shape feature preservation is achieved in the candidate spot region.

[0047] As an optional embodiment, before the step of locating the echo waveform data based on the gradient-weighted centroid method, a process for determining the coverage area of ​​the laser reflection spot is included, specifically comprising the following steps: Step 301: Obtain the peak pixel position in the echo waveform data, and use the sum of the gray values ​​of all pixels in the echo waveform data as the total gray value of the spot.

[0048] Specifically, since the energy of the light spot is mainly concentrated near the peak position, it is necessary to find the peak pixel position in the echo waveform data as the starting point for determining the light spot coverage area. By iterating through the grayscale values ​​of all pixels in the echo waveform data, the pixel with the largest grayscale value is found, and its position is recorded as the peak pixel position i_peak. Simultaneously, to determine the cumulative energy ratio of the light spot, the total energy of the light spot needs to be calculated. This is done by summing the grayscale values ​​of all pixels in the echo waveform data, resulting in the total grayscale value S_total = Σ pixel value(i). The peak pixel position identifies the center position of the light spot energy, while the total grayscale value provides a normalized benchmark for subsequent calculations of the energy accumulation ratio.

[0049] Step 302: Accumulate gray values ​​pixel by pixel from the peak pixel position to both sides, and calculate the energy accumulation ratio of the accumulated gray values ​​on each side to the total gray values ​​of the light spot.

[0050] Specifically, starting from the peak pixel position, the energy of the light spot gradually decreases towards both sides. To determine the effective coverage range of the light spot energy, grayscale values ​​need to be accumulated from the peak pixel position to both sides, and the proportion of accumulated energy to the total energy of the light spot needs to be calculated. Accumulation begins from the peak pixel position to the left, initializing the accumulated grayscale value on the left to the grayscale value of the peak pixel. Then, accumulation proceeds pixel by pixel to the left, adding the grayscale values ​​of adjacent pixels on the left to the accumulated grayscale value. Simultaneously, at each step, the proportion of energy accumulation on the left is calculated, i.e., the accumulated grayscale value on the left divided by the total grayscale value of the light spot. Similarly, accumulation begins from the peak pixel position to the right, initializing the accumulated grayscale value on the right to the grayscale value of the peak pixel. Then, accumulation proceeds pixel by pixel to the right, adding the grayscale values ​​of adjacent pixels on the right to the accumulated grayscale value. Simultaneously, at each step, the proportion of energy accumulation on the right is calculated, i.e., the accumulated grayscale value on the right divided by the total grayscale value of the light spot.

[0051] Step 303: Determine the pixel positions corresponding to the first time the energy accumulation ratio on both sides reaches the preset energy ratio threshold as the left and right boundaries of the light spot coverage area.

[0052] Specifically, to determine the boundary location of the light spot coverage area, an energy percentage threshold needs to be set. This threshold represents the proportion of the total energy of the light spot that the coverage area should contain, typically set to a value between 90% and 99%, such as 95%. During the pixel-by-pixel accumulation process in step 302, when the energy accumulation ratio on the left side first reaches or exceeds the preset energy percentage threshold, the corresponding pixel position is recorded as the left boundary of the light spot coverage area. Similarly, when the energy accumulation ratio on the right side first reaches or exceeds the preset energy percentage threshold, the corresponding pixel position is recorded as the right boundary of the light spot coverage area. This boundary determination method based on energy accumulation ratio can adaptively determine the coverage area according to the actual energy distribution of the light spot, including the main energy portion of the light spot while avoiding including edge noise areas within the coverage area.

[0053] Step 304: Determine whether the pixel span between the left and right boundaries is less than the preset minimum effective span. If so, redetermine the left and right boundaries of the spot coverage area by expanding the preset number of pixels to both sides with the peak pixel position as the center.

[0054] Specifically, in certain special cases, such as when the spot energy is excessively concentrated or the echo signal is weak, the pixel span between the left and right boundaries determined in step 303 may be too small, resulting in the spot coverage area containing only a very small number of pixels. This excessively small coverage area may not provide enough information for subsequent spot localization processing, and may even lead to unstable localization results. Therefore, it is necessary to determine whether the pixel span between the left and right boundaries meets the minimum requirement. Specifically, the pixel span is calculated as the right boundary minus the left boundary plus one, and this span is compared with the preset minimum effective span. The minimum effective span can be set according to actual application requirements, such as five or seven pixels. If the pixel span is less than the minimum effective span, it indicates that the spot coverage area determined by the energy accumulation ratio is too small and needs to be expanded. At this time, with the peak pixel position as the center, a preset number of pixels is expanded to the left and right, such as three or four pixels. The left boundary is redefined as the peak pixel position minus the preset number of pixels, and the right boundary is the peak pixel position plus the preset number of pixels. Through this minimum span check and forced expansion mechanism, it is ensured that the spot coverage area always contains a sufficient number of pixels.

[0055] Step 305: Determine the area formed by all pixels between the left and right boundaries as the laser reflection spot coverage area.

[0056] Specifically, after determining the boundary of the laser spot coverage area, the region formed by all pixels between the left and right boundaries is defined as the laser reflection spot coverage area. This region contains the main energy distribution of the laser spot, thus clarifying the calculation range for subsequent spot localization processing based on the gradient-weighted centroid method.

[0057] Step 30: The echo waveform data is localized using the gradient-weighted centroid method to obtain the centroid position of the laser reflection spot. The gradient-weighted centroid method assigns different weights to each pixel within the coverage area of ​​the laser reflection spot according to the gradient value of the echo waveform data.

[0058] Please see Figure 4This diagram illustrates the distribution of laser spot positions at different distances, as provided in this application embodiment. The diagram shows the variation in the imaging position of the laser reflection spot on the linear array sensor when the triangulation ranging radar measures target objects at different distances. When the target object is close, the reflected spot appears on the left side of the linear array sensor (labeled "near distance"); when the target object is at a moderate distance, the spot appears in the middle of the linear array sensor; and when the target object is far away, the spot appears on the right side of the linear array sensor (labeled "far distance"). Due to the optical characteristics of triangulation ranging, the reflectivity of the target surface, and other external factors, the shape of the spot at different positions may have slight differences. Traditional simple gray-scale weighted centroid algorithms may calculate centroid positions that deviate from the true centroid values ​​when processing spots with different positions and shapes. Therefore, this application proposes a gradient-weighted centroid algorithm to obtain more accurate centroid localization results at different positions and with different spot characteristics on the linear array sensor.

[0059] In this embodiment, the gradient-weighted centroid method refers to a method of calculating the center position of a light spot by assigning different weight coefficients to different pixels based on the gradient value of each pixel in the echo waveform data, so that pixels with drastic grayscale changes receive higher weights and pixels with gradual grayscale changes receive lower weights.

[0060] The centroid position refers to the coordinates of the energy distribution center of the laser reflection spot on the linear array sensor, and is a key parameter for distance measurement.

[0061] As an optional embodiment, the step of locating the centroid of the laser reflection spot by performing positioning processing on the echo waveform data based on the gradient-weighted centroid method may further include the following steps: Step 401: Calculate the gradient value of each pixel within the area covered by the laser reflection spot in the echo waveform data. The gradient value is obtained by taking the absolute value of the difference between the gray values ​​of the adjacent pixels before and after each pixel and then dividing it equally.

[0062] Specifically, for each pixel within the area covered by the laser reflection spot, its gradient value is calculated using the central difference method. This involves subtracting the grayscale value of the preceding neighboring pixel from the grayscale value of the next neighboring pixel, taking the absolute value of the difference, and finally dividing the absolute value by two to obtain the gradient value of that pixel. Mathematically, this is expressed as: g i =|I i+1 -I i-1 | / 2, where g i Let I be the gradient value of the i-th pixel. i+1 Let I be the grayscale value of the (i+1)th pixel. i-1Let be the grayscale value of the (i-1)th pixel. This central difference method comprehensively considers the grayscale changes on both sides of a pixel, providing a smoother and more accurate gradient estimate compared to the one-sided difference method. For pixels at the boundary of the light spot coverage area, if there are no adjacent pixels on their front or back sides, the forward difference method or backward difference method can be used for calculation, that is, the absolute value of the difference between the grayscale value of this pixel and its existing adjacent pixels can be directly used as the gradient value. The gradient value calculated in this way can accurately reflect the degree of grayscale change of the echo waveform data at each pixel.

[0063] Step 402: Construct a linear combination weight for each pixel by superimposing the product of the preset variable factor and the gradient value onto the baseline value.

[0064] Specifically, to effectively control the centroid calculation using gradient information, this embodiment employs a linear combination approach to construct the weight function. For each pixel within the laser reflection spot coverage area, a linear combination weight is constructed by multiplying a preset variable factor by the pixel's gradient value and then adding a baseline value. Mathematically, this is expressed as: W i =1+β∙g i W i β is the linear combination weight of the i-th pixel. The baseline value ensures that all pixels have a certain basic weight, avoiding pixels in low-gradient regions from having too small or even zero weight. The baseline value is usually 1 or other positive numbers. β is a preset variable factor used to adjust the influence of the gradient value on the weight. The value of this factor can be optimized according to the characteristics of the spot waveform and the noise level in the actual application. It is usually between 0.1 and 10. A larger variable factor will significantly increase the weight in high-gradient regions, while a smaller variable factor will weaken the influence of the gradient. The weight function constructed by this linear combination method can adaptively adjust the weight of each pixel according to the magnitude of the gradient value, so that the position with drastic grayscale changes receives higher weight, and can also ensure that all pixels contribute to the centroid calculation through the baseline value, thus making full use of gradient information while maintaining the stability of the centroid calculation.

[0065] Step 403: Sum the products of the gray value of each pixel, the linear combination weight, and the position number on the linear array sensor of the triangular ranging radar, and divide by the sum of the products of the gray value of each pixel and the corresponding linear combination weight to obtain the centroid position of the laser reflection spot.

[0066] Specifically, for each pixel within the laser reflection spot coverage area, firstly, the pixel's position index on the linear array sensor of the triangulation ranging radar is obtained. This position index represents the pixel's index position within the sensor array. Then, the weighted contribution of this pixel to the centroid position is calculated by multiplying the pixel's grayscale value, the linear combination weight, and the position index. The weighted contribution values ​​of all pixels within the spot coverage area are summed to obtain the weighted position sum. Simultaneously, a weight normalization factor is calculated by summing the products of the grayscale values ​​of each pixel within the spot coverage area and their corresponding linear combination weights to obtain the weighted grayscale sum. Finally, the weighted position sum is divided by the weighted grayscale sum to obtain the centroid position of the laser reflection spot. This calculation method achieves adaptive weighting based on gradient information. Pixels with larger gradient values ​​have higher linear combination weights, and their position information carries a greater weight in the centroid calculation, thus making the calculated centroid position more accurately reflect the true center position of the spot. This can be expressed mathematically as: Where C is the position of the centroid, and I... i Let W be the grayscale value of the i-th pixel. i X is the linear combination weight of the i-th pixel. i Let be the position number of the i-th pixel.

[0067] For example, assume the light spot coverage area contains 5 pixels, numbered 1 to 5, with corresponding gray values ​​of 50, 80, 100, 70, and 40, respectively, and the variable factor β is set to 2. First, calculate the gradient value of each pixel; for example, the gradient value of pixel 2 is the absolute value of 100 minus 50 divided by 2, which equals 25. Then, calculate the linear combination weight; the weight of pixel 2 is 1 plus 2 multiplied by 25, which equals 51. Next, calculate the numerator, which is the sum of all pixel gray values ​​multiplied by their weights and position numbers, resulting in 36290. The denominator is the sum of all pixel gray values ​​multiplied by their weights, resulting in 12240. The final centroid position is 36290 divided by 12240, approximately equal to 2.97. The centroid position is a continuous position coordinate value. A centroid position of 2.97 indicates that the energy center of the light spot is located between the 2nd and 3rd pixels of the linear array sensor, closer to the 3rd pixel, exhibiting sub-pixel accuracy. In real-world scenarios, a linear array sensor consists of a row of continuously arranged photosensitive pixels, each with a fixed physical size, such as a pixel width of 14 micrometers. When the centroid position is calculated to be 2.97, it means that the physical distance from the center of the light spot to the starting end of the sensor is approximately 2.97 multiplied by 14 micrometers, which equals 41.58 micrometers.

[0068] Step 40: Calculate the initial distance value of the triangulation radar to the target object based on the centroid position, and compensate and correct the initial distance value to obtain the corrected target distance.

[0069] In this embodiment, the initial distance value is a preliminary distance measurement between the target object and the radar, calculated based on the centroid position of the laser reflection spot, combined with the optical geometric parameters of the triangulation ranging radar and the triangulation ranging principle. This initial distance value may contain systematic errors or measurement deviations and requires further correction.

[0070] Target distance refers to the actual and accurate distance between the target object and the triangulation ranging radar after processing such as nonlinear correction. This distance value eliminates the influence of systematic errors and can truly reflect the spatial position information of the target object. It is the final measurement result output by the triangulation ranging radar.

[0071] As an optional embodiment, the step of calculating the initial distance value of the triangulation radar to the target object based on the centroid position, and compensating and correcting the initial distance value to obtain the corrected target distance, may further include the following steps: Step 501: Determine the pixel offset between the centroid position and the preset optical axis reference pixel position on the linear array sensor of the triangular ranging radar.

[0072] Specifically, the pixel offset between the centroid position and the preset optical axis reference pixel position on the linear array sensor is first determined. The optical axis reference pixel position refers to the pixel position corresponding to the intersection of the optical axis of the triangulation ranging radar receiving optical system and the linear array sensor. This position is determined through optical calibration and fixed in the system parameters at the factory. When the target object is at a specific distance, the centroid position of the reflected light spot will fall on the optical axis reference pixel position. However, when the target distance changes, the centroid position will shift relative to the optical axis reference pixel position. The pixel offset is obtained by subtracting the value of the optical axis reference pixel position from the value of the centroid position. This pixel offset can be positive or negative. A positive value indicates that the centroid position is to the right of the optical axis reference pixel position, and a negative value indicates that it is to the left. The absolute value of the offset reflects the degree of deviation.

[0073] Step 502: Multiply the pixel offset by the physical size of a single pixel of the linear array sensor to obtain the physical offset distance of the centroid position relative to the optical axis.

[0074] Specifically, after obtaining the pixel offset, it needs to be converted into the actual offset distance in physical space. A linear array sensor consists of a series of arranged photosensitive pixels, each with a fixed physical size, called the single-pixel physical size, usually measured in micrometers. For example, common linear array sensors have single-pixel physical sizes of 7 micrometers, 10 micrometers, or 14 micrometers. Multiplying the pixel offset by the single-pixel physical size of the linear array sensor yields the physical offset distance of the centroid relative to the optical axis. For example, if the pixel offset is 10.5 pixels and the single-pixel physical size is 14 micrometers, then the physical offset distance is 10.5 multiplied by 14 equals 147 micrometers. This physical offset distance reflects the actual spatial position offset of the laser reflection spot on the sensor plane relative to the optical axis and is a key input parameter for triangulation geometry calculations.

[0075] Step 503: Calculate the initial distance value based on the optical baseline length of the triangulation radar, the focal length of the receiving lens, and the physical offset distance.

[0076] Specifically, the core parameters of a triangulation ranging radar include the optical baseline length and the focal length of the receiving lens. The optical baseline length refers to the vertical distance between the laser emitter and the optical axis of the receiving lens; this parameter determines the measurement range and sensitivity of the ranging system. The focal length of the receiving lens determines the imaging characteristics and angular resolution of the optical system. The initial distance value is equal to the optical baseline length multiplied by the focal length of the receiving lens, then divided by the physical offset distance. For example, if the optical baseline length is 30 mm, the focal length of the receiving lens is 20 mm, and the physical offset distance is 0.147 mm, then the initial distance value is approximately 30 multiplied by 20 divided by 0.147, which is approximately 4082 mm. This initial distance value reflects the measurement result calculated based on an ideal optical model. However, in actual systems, factors such as optical aberrations and target surface characteristics exist, therefore further compensation and correction are needed to improve measurement accuracy.

[0077] Step 504: Obtain the peak gray level, spot width, and the ratio of the width of the left and right halves of the laser reflection spot as spot characteristic parameters.

[0078] Specifically, to effectively compensate and correct the initial distance value, it is necessary to obtain characteristic parameters that reflect the measurement conditions and system state. In this embodiment, the peak grayscale, spot width, and the ratio of the widths of the left and right halves of the laser reflection spot are selected as the spot characteristic parameters. The peak grayscale refers to the grayscale value of the pixel with the largest grayscale value in the area covered by the spot, reflecting the intensity of reflected light and the reflectivity characteristics of the target surface. Too high or too low a peak grayscale value may affect the centroid positioning accuracy. The spot width refers to the number of pixels or the corresponding physical size in the area covered by the spot, reflecting the degree of spot diffusion. The spot width is affected by the target distance, surface roughness, and optical system characteristics. The ratio of the widths of the left and right halves of the peak is the ratio of the full width of the left half of the spot's height to the full width of the right half of the spot's height, reflecting the symmetry of the spot shape. When the target surface is tilted or the edge is obstructed, the spot shape will be asymmetrical. The greater the deviation of this ratio from 1, the stronger the asymmetry.

[0079] Step 505: Compensate and correct the initial distance value based on the spot feature parameters to obtain the corrected target distance.

[0080] Specifically, the purpose of compensation and correction is to eliminate the impact of systematic errors and changes in measurement conditions on distance measurement accuracy. A mapping relationship between spot characteristic parameters and distance measurement errors is established through extensive calibration experimental data, forming a lookup table or polynomial correction model. For example, a low peak grayscale indicates a weak reflected light signal and significant noise influence, requiring correction of the initial distance value; an abnormally large spot width may be due to target surface roughness causing centroid positioning deviation, requiring compensation based on the spot width; a significant deviation of the left and right half-peak width ratio from 1 indicates spot shape asymmetry, requiring correction based on the degree of asymmetry. By comprehensively considering these spot characteristic parameters and using a pre-established correction model to correct the initial distance value, the influence of various error sources can be effectively compensated, resulting in accurate and reliable target distances and significantly improving the accuracy and stability of the ranging system.

[0081] As an optional embodiment, the step of compensating and correcting the initial distance value based on the spot feature parameters to obtain the corrected target distance may further include the following steps: Step 601: Determine the signal strength level of the current echo based on the ratio of peak gray level to spot width.

[0082] Specifically, signal strength level is a crucial factor affecting ranging accuracy, and the system error characteristics differ significantly under strong and weak signal conditions. This embodiment uses the ratio of peak grayscale to spot width as an evaluation index for signal strength. Peak grayscale reflects the maximum intensity of the echo signal, while spot width reflects the degree of energy diffusion; their ratio comprehensively characterizes the concentrated intensity of the signal. The ratio of the maximum grayscale value to the spot width within the spot coverage area is calculated, and then this ratio is divided into different signal strength levels according to a preset threshold. For example, it can be divided into three levels: strong signal, medium signal, and weak signal, or five levels for more refined classification.

[0083] Step 602: Select the corresponding calibration dataset according to the signal strength level, wherein the calibration dataset contains the correspondence between the initial distance value and the actual distance value at multiple calibration distances under the signal strength level.

[0084] Specifically, after determining the signal strength level, a calibration dataset corresponding to that level needs to be selected. The calibration dataset is obtained by measuring a standard target board at a known distance using a triangulation ranging radar before the system leaves the factory or during periodic calibration. For different signal strength levels, measurements are taken at multiple calibration distances, and the initial distance value calculated by the system and the actual distance value of the standard board are recorded at each calibration distance, forming a data pair corresponding to the initial and actual distance values. For example, under strong signal levels, data may be collected at multiple calibration distances such as 50 mm, 100 mm, 200 mm, 500 mm, and 1000 mm. The initial distance value at each calibration distance may deviate from the actual distance value; these deviations reflect the nonlinear error characteristics of the system.

[0085] Step 603: Fit the calibration dataset using the least squares method to obtain the distance correction relationship corresponding to the current signal strength level.

[0086] Specifically, after obtaining the calibration dataset, the least squares method is used to fit the data and establish a distance correction relationship model. The least squares method is a curve fitting method that finds the optimal fitting parameters that minimize the sum of squared errors between the fitted curve and the actual data points. Using the initial distance values ​​in the calibration dataset as independent variables and the actual distance values ​​as dependent variables, an appropriate fitting function is selected based on the characteristics of the system error. Commonly used forms include linear functions, quadratic polynomial functions, or cubic polynomial functions. The coefficients of the fitted function are calculated using the least squares method, thus establishing a mapping relationship between the initial distance values ​​and the actual distance values, i.e., the distance correction relationship. This correction relationship can effectively compensate for the nonlinear errors of the system and improve ranging accuracy.

[0087] Step 604: Calculate the spot asymmetry based on the ratio of the width of the left and right halves of the peak, and determine the centroid offset compensation amount based on the deviation between the spot asymmetry and the preset symmetry reference value.

[0088] Specifically, besides signal strength-related system errors, the asymmetry of the light spot shape can also lead to centroid positioning deviation. The asymmetry of the light spot is quantified by analyzing the ratio of the widths of the left and right halves of the peak. First, the peak position of the light spot and its corresponding peak grayscale are located. Then, the half-peak value, which is half the peak grayscale, is calculated. To the left of the peak position, a position with a grayscale value equal to the half-peak value is found, and the distance between this position and the peak position is calculated as the width of the left half-peak. Similarly, to the right of the peak position, the half-peak position is found, and the width of the right half-peak is calculated. The light spot asymmetry is equal to the ratio of the widths of the left and right halves of the peak minus a preset symmetry reference value, which is typically 1, representing an ideal symmetry. When the light spot asymmetry is close to zero, it indicates that the light spot shape is basically symmetrical; when the asymmetry is positive, it indicates that the left side of the light spot is wider; when the asymmetry is negative, it indicates that the right side of the light spot is wider. Based on the magnitude and direction of the light spot asymmetry, a centroid offset compensation amount is calculated using a preset compensation coefficient. This compensation amount is used to correct the centroid positioning deviation caused by the light spot asymmetry.

[0089] Step 605: After adding the centroid offset compensation amount to the initial distance value, substitute it into the distance correction relationship to calculate and obtain the corrected target distance.

[0090] Specifically, after calculating all compensation parameters, the final range correction calculation is performed. First, the initial range value is superimposed with the centroid offset compensation to obtain the intermediate range value after spot asymmetry correction. The centroid offset compensation can be positive or negative; a positive value indicates an increase in the range value, and a negative value indicates a decrease. Then, this intermediate range value is substituted into the range correction relationship established in step 603 for calculation, that is, the intermediate range value is used as the independent variable in the fitting function to calculate the corresponding corrected target range. This target range comprehensively considers the system nonlinear error related to signal strength and the centroid offset error caused by spot asymmetry, accurately reflecting the actual distance between the target object and the triangulation ranging radar, significantly improving the accuracy and reliability of the ranging system under various measurement conditions.

[0091] This application also provides a computer storage medium that can store multiple instructions. The instructions are adapted to be loaded and executed by a processor as described in the above embodiments to improve the accuracy of a triangulation ranging radar. For the specific execution process, please refer to the detailed description of the above embodiments, which will not be repeated here.

[0092] The following describes an electronic device for improving the accuracy of triangulation ranging radar, provided by an embodiment of this application. Figure 5This is a schematic diagram of an exemplary hardware structure of an electronic device provided in an embodiment of this application.

[0093] In some embodiments, the electronic device for improving the accuracy of triangulation ranging radar is a computer device or includes a computer device. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device stores data. The network interface of the computer device is used to communicate with other external terminals or servers via a network connection. In some embodiments, the network interface can be a wired network interface; in some embodiments, the network interface can also be a wireless network interface. When the computer program is executed by the processor, it implements the methods in the embodiments of this application.

[0094] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0095] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

[0096] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.

[0097] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for improving the accuracy of triangulation ranging radar, characterized in that, include: The background frame and signal-background superimposed frame of the target object are acquired by the triangulation ranging radar. The signal-background superimposed frame and the background frame are differentially processed to generate the signal frame after basis elimination. The signal frame is subjected to mean filtering to obtain smoothed echo waveform data; The echo waveform data is localized using the gradient-weighted centroid method to obtain the centroid position of the laser reflection spot. The gradient-weighted centroid method assigns different weights to each pixel within the coverage area of ​​the laser reflection spot according to the gradient value of the echo waveform data. The initial distance value of the triangulation radar to the target object is calculated based on the centroid position, and the initial distance value is compensated and corrected to obtain the corrected target distance.

2. The method for improving the accuracy of triangulation ranging radar according to claim 1, characterized in that, Background frames and signal-background superimposed frames of a target object are acquired using a triangulation ranging radar. The signal-background superimposed frame and the background frame are then differentially processed to generate a base-reduced signal frame, including: The opening and closing state of the laser emitter of the triangular ranging radar is controlled in an alternating timing manner to acquire a first background frame, a signal background superimposed frame, and a second background frame, wherein the acquisition time of the first background frame and the second background frame are respectively located before and after the acquisition time of the signal background superimposed frame. Calculate the ratio of the time interval between the acquisition time of the signal background superimposed frame and the acquisition time of the first background frame and the acquisition time of the second background frame; Based on the time interval ratio, the first background frame and the second background frame are time-weighted interpolated to obtain an equivalent background frame corresponding to the acquisition time of the signal background superimposed frame. The signal background superimposed frame is subtracted pixel by pixel from the equivalent background frame, and pixels with negative differences are set to zero to generate the signal frame after the base is eliminated.

3. The method for improving the accuracy of triangulation ranging radar according to claim 1, characterized in that, The signal frame is subjected to mean filtering to obtain smoothed echo waveform data, including: Calculate the local variance value of each pixel in the signal frame, and divide the signal frame into a spot candidate region and a background region based on the local variance value; The first filtering window is determined based on the noise level of the signal frame; Calculate the local gradient magnitude of each pixel within the candidate spot region, and determine the width of the second filtering window based on the local gradient magnitude, wherein the larger the local gradient magnitude, the smaller the width of the second filtering window. The background region and the candidate spot region are subjected to mean filtering using the first filtering window and the second filtering window, respectively, to obtain the smoothed echo waveform data.

4. The method for improving the accuracy of triangulation ranging radar according to claim 1, characterized in that, Before performing localization processing on the echo waveform data based on the gradient-weighted centroid method, the following steps are also included: Obtain the peak pixel position in the echo waveform data, and take the sum of the gray values ​​of all pixels in the echo waveform data as the total gray value of the spot; The grayscale value is accumulated pixel by pixel from the peak pixel position to both sides, and the energy accumulation ratio of the accumulated grayscale value on each side to the total grayscale value of the spot is calculated. The pixel positions corresponding to the first time the energy accumulation ratio on both sides reaches the preset energy ratio threshold are determined as the left and right boundaries of the light spot coverage area. Determine whether the pixel span between the left and right boundaries is less than the preset minimum effective span. If so, redetermine the left and right boundaries of the spot coverage area by expanding the preset number of pixels to both sides from the peak pixel position. The area formed by all pixels between the left and right boundaries is defined as the area covered by the laser reflection spot.

5. The method for improving the accuracy of triangulation ranging radar according to claim 1, characterized in that, The echo waveform data is localized using the gradient-weighted centroid method to obtain the centroid position of the laser reflection spot, including: Calculate the gradient value of each pixel within the area covered by the laser reflection spot in the echo waveform data. The gradient value is obtained by taking the absolute value of the difference between the gray values ​​of the adjacent pixels before and after each pixel and then dividing it equally. A linear combination weight for each pixel is constructed by superimposing a base value on the product of a preset variable factor and the gradient value. The centroid position of the laser reflection spot is obtained by summing the product of the gray value of each pixel, the linear combination weight, and the position index on the linear array sensor of the triangular ranging radar, and dividing by the sum of the product of the gray value of each pixel and the corresponding linear combination weight.

6. The method for improving the accuracy of triangulation ranging radar according to claim 1, characterized in that, The initial distance value of the triangulation radar to the target object is calculated based on the centroid position, and the initial distance value is compensated and corrected to obtain the corrected target distance, including: Determine the pixel offset between the centroid position and the preset optical axis reference pixel position on the linear array sensor of the triangular ranging radar; Multiply the pixel offset by the physical size of a single pixel of the linear array sensor to obtain the physical offset distance of the centroid position relative to the optical axis. The initial distance value is calculated based on the optical baseline length of the triangulation radar, the focal length of the receiving lens, and the physical offset distance. The peak gray level, spot width, and the ratio of the width of the left and right halves of the spot are obtained as the spot characteristic parameters. The initial distance value is compensated and corrected based on the light spot feature parameters to obtain the corrected target distance.

7. The method for improving the accuracy of triangulation ranging radar according to claim 6, characterized in that, The initial distance value is compensated and corrected based on the light spot feature parameters to obtain the corrected target distance, including: The signal strength level of the current echo is determined based on the ratio of the peak gray level to the spot width; A corresponding calibration dataset is selected based on the signal strength level, wherein the calibration dataset contains the correspondence between the initial distance values ​​and the actual distance values ​​at multiple calibration distances under the signal strength level; The calibration dataset is fitted using the least squares method to obtain the distance correction relationship corresponding to the current signal strength level; The asymmetry of the light spot is calculated based on the ratio of the width of the left and right halves of the peak, and the centroid offset compensation amount is determined based on the deviation between the asymmetry of the light spot and the preset symmetry reference value. The initial distance value is superimposed with the centroid offset compensation amount, and then substituted into the distance correction relationship for calculation to obtain the corrected target distance.

8. An electronic device for improving the accuracy of triangulation ranging radar, characterized in that, The electronic device includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the method as described in any one of claims 1-7.

9. A computer program product containing instructions, characterized in that, When the computer program product is run on an electronic device for improving the accuracy of triangulation radar, the electronic device performs the method as described in any one of claims 1-7.

10. A computer-readable storage medium comprising instructions, characterized in that, When the instruction is executed on an electronic device that improves the accuracy of a triangulation radar, the electronic device performs the method as described in any one of claims 1-7.