Distance measuring method based on focusing light spot imaging and reading device thereof

By establishing a coordinate system, optimizing exposure parameters, and employing image processing techniques, the problem of insufficient spot positioning accuracy in existing ranging technologies has been solved, achieving high-precision ranging results, especially surpassing traditional TOF ranging in close-range scenarios.

CN121297673APending Publication Date: 2026-01-09FUJIAN NEWLAND AUTO ID TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511350948.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-22
Publication Date
2026-01-09

AI Technical Summary

Technical Problem

Existing imaging-based ranging technologies have accuracy bottlenecks in the field of high-precision spot positioning. In particular, under complex optical interaction mechanisms, spot energy diffusion and deformation have a serious impact, resulting in no substantial improvement in ranging accuracy, and even spot loss in extreme cases.

Method used

By establishing a coordinate system and recording the coordinates of the laser point, multidimensional technology is used to fit the coordinate and distance relationship, optimize the exposure parameters, perform multi-frame image processing and filtering, crop the spot image area, and combine binarization and adaptive filtering to optimize the spot imaging conditions and reduce halo interference.

Benefits of technology

It significantly improves ranging accuracy, surpassing traditional time-of-flight ranging technology, especially achieving high-precision ranging in close-range scenarios, reducing data processing volume, and improving positioning efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121297673A_ABST
    Figure CN121297673A_ABST
Patent Text Reader

Abstract

The invention relates to the field of bar code recognition and reading, in particular to a distance measuring method based on focusing light spot imaging and a recognition and reading device thereof. A theoretical formula is obtained by analyzing a theoretical relationship between coordinates in an image and an actual distance, high-precision fitting is directly carried out on the theoretical formula after data are acquired by utilizing high-precision displacement equipment, F1 / 2-P1 = (A1 / D-B1) * F1 / 2, D is a distance, A1 = d1 / tan alpha 1, B1 = + / -tan beta 1 / tan alpha 1, alpha 1 is a horizontal field half angle, and alpha 2 is a horizontal field half angle. Beta1 is the deflection angle of the laser axis and the view field axis in the X direction, and F1 is the horizontal pixel value of the image sensor; p1 is the X coordinate value of the mass center of the laser point. The error between the fitted curve and the actually tested curve is extremely small, a standard is provided for subsequent centroid detection errors, and a basis is also provided for high-precision distance measurement. In addition, the mass center of the light spot is reliably and precisely positioned, and the light-supplementing-free high-brightness small-circle laser light spot low exposure is used for photographing, so that the interference is reduced to the maximum extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision, and more specifically to a ranging method and its reading device based on focusing spot imaging. Background Technology

[0002] In imaging-based barcode readers and smart camera systems, optical parameters are adjusted using ranging technology to cover a variety of application scenarios, including functions such as autofocus, exposure parameter optimization, fixed-focus lens switching, and object size measurement.

[0003] Current mainstream technologies focus on patenting efficiency and stability in spot detection, with key improvements concentrated in: 1) rapid positioning algorithms based on spot motion trajectory prediction, which narrow the search range using a pre-established fixed trajectory model, effectively improving positioning speed and reducing ambient light interference; and 2) differential imaging anti-interference technology, which enhances the feature recognition capability of the target spot by comparing the differences between images with and without laser projection. These optimizations significantly improve detection speed and anti-interference performance, but technical bottlenecks remain in high-precision spot positioning: existing solutions neither involve high-precision spot center fitting algorithms nor overcome the limitations of calibration curve accuracy, resulting in no substantial improvement in overall ranging accuracy, and in extreme cases, even complete spot loss.

[0004] The accuracy limitations of ranging systems primarily stem from complex optical interaction mechanisms: when a ranging pattern is projected onto a target object, the photon distribution characteristics of the reflected light path are influenced by multiple coupled factors, including but not limited to the measured distance, surface material reflectivity, color absorption characteristics, and the object's radius of curvature. These variables can trigger unpredictable optical phenomena such as light spot energy diffusion and deformation, directly affecting the accuracy of the light spot center positioning. Particularly in the imaging stage, the supplementary lighting strategy of the auxiliary light source and the exposure parameter settings of the image sensor constitute key limiting factors. When detecting antistatic bags made of reflective material, excessive supplementary lighting can lead to overexposure of the imaging sensor, causing the light spot signal to be completely submerged in the saturated background. Summary of the Invention

[0005] This invention primarily addresses the accuracy bottleneck problem of existing distance measurement technologies based on focus patterns. Through multi-dimensional technological breakthroughs, this solution achieves a fundamental improvement in distance measurement accuracy while maintaining the original advantages in detection speed and anti-interference performance. Especially in close-range measurement scenarios, its accuracy performance surpasses that of traditional time-of-flight (TOF) distance measurement technologies.

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

[0007] Option 1.

[0008] A ranging method based on focused spot imaging includes the following steps:

[0009] S1, the horizontal distance d1 between the center position of the laser lamp of the reading device and the center position of the lens assembly;

[0010] S2, acquire the light spot image;

[0011] S3, establish a coordinate system for the light spot image with the upper left corner as the origin, search for the laser point, and record the coordinates of the laser point;

[0012] S4, obtain the distance D from the center of the lens assembly to the object plane, calculated using the following formula:

[0013] F1 / 2-P1=(A1·D-B1)·F1 / 2,

[0014] Where A1=d1 / tanα1, B1=±tanβ1 / tanα1, α1 is the horizontal field of view half angle, β1 is the deflection angle between the laser axis and the field of view axis in the X direction, F1 is the horizontal pixel value of the image sensor, and P1 is the X coordinate value of the centroid of the laser point.

[0015] Furthermore, the reading device pre-fits a curve of coordinates and distance, and stores it; then it performs the following steps:

[0016] Q1, the reading device sets the minimum exposure parameters of gain and exposure time, and projects the laser light onto the object surface to form a light spot;

[0017] Q2, the light spot image is captured by the reading device mounted on the distance mobile device, and one set of coordinates is collected for each step;

[0018] Q3. Repeat steps Q1 to Q2 multiple times, and combine them with calculation formula 1 to fit the relationship between the collected X coordinates and distances to obtain the A1 and B1 values ​​with the smallest error.

[0019] Furthermore, by using the vertical distance d2 from the center of the laser light to the center of the field of view, and verifying the distance obtained from Formula 1 using the Y-axis coordinate, Formula 2 is calculated as follows:

[0020] F² / 2 - P² = (A²·D - B²)·F² / 2,

[0021] Where A2=d2 / tanα2, B2=±tanβ2 / tanα2, α2 is the half angle in the vertical direction of the field of view, β2 is the deflection angle of the laser axis in the vertical direction, F2 is the vertical pixel value of the image sensor, and P2 is the Y coordinate value of the centroid of the laser point.

[0022] Furthermore, in step S2, the reading device acquires the image, including adjusting the brightness of the light spot and exposure control, so that the grayscale distinction between the background and the light spot is increased; the interference of light spot halo is reduced, thereby facilitating high-precision positioning.

[0023] The brightness of the light spot is increased by increasing the brightness of the laser lamp and reducing the beam angle.

[0024] Further, in step S2, continuous shooting is performed to acquire the light spot images, with the exposure threshold gradually increasing from the reference value. The exposure parameter = gain × exposure time. Subsequently, light spot positioning will start from the image with the reference exposure. If it cannot be located, the image with the next exposure parameter will be used for light spot positioning until it is located.

[0025] Furthermore, in order to reduce the amount of data processing and improve the positioning speed, the position of the light spot in the light spot image is cropped, and the horizontal and vertical coordinates of the cropped area are not less than the coordinate area of ​​the light spot.

[0026] Furthermore, in order to better locate and reconstruct the light spot, the light spot image in step S2 and the multiple sets of light spot images in step Q2 are subjected to reference binarization processing and multiple image filtering.

[0027] Furthermore, the binarized image is subjected to image filtering. The light spot image region of the first binarization is seeded and diffused through a set diffusion threshold. Subsequent image processing uses the diffused region for processing.

[0028] Option 2.

[0029] A reading device, performing the steps described in Scheme 1, includes: a housing, a motherboard assembly, an imaging assembly, and a laser light;

[0030] The imaging component is disposed inside the housing, and in front of the image sensor are a lens assembly and a liquid focusing assembly;

[0031] The motherboard assembly includes a laser light, an image sensor, a processor, and a memory.

[0032] Furthermore, the fill light is mounted on the motherboard assembly, and the fill light is turned off when acquiring a light spot image.

[0033] During operation, the motherboard component controls the laser lamp to emit laser light, controls the imaging component to perform single-frame or continuous multi-frame shooting, and controls the imaging parameters. During exposure, the motherboard component controls the fill light to provide supplementary lighting.

[0034] The present invention has the following beneficial effects:

[0035] 1. The distance measurement method and its reading device based on focusing spot imaging described in this invention obtains Formula 1 through the relationship between coordinates and distance. After collecting data using a shifting device, the theoretical formula is directly fitted with high precision. The fitted curve has a very small error with the curve obtained from actual testing. Under the same conditions, it significantly improves the existing distance measurement accuracy. It not only establishes a judgment standard for subsequent centroid detection error, but also lays a theoretical foundation for realizing high-precision distance measurement.

[0036] 2. The ranging method and its recognition device based on focused spot imaging described in this invention achieves a gradual increase in the exposure threshold from a baseline value (gain × exposure time) through continuous frame sequence shooting. While ensuring the effectiveness of the spot positioning algorithm, the exposure parameters are controlled at the lowest feasible threshold. Since excessively high exposure parameters can lead to grayscale saturation in the halo area, increasing the interference area and reducing the centroid positioning accuracy, it is necessary to prioritize maintaining a lower exposure level. This keeps the background in a low grayscale state while reducing the spot imaging range, thereby improving the accuracy and positioning efficiency of spot recognition.

[0037] 3. The ranging method and its reading device based on focused light spot imaging described in this invention address the issue that the size and position of the light spot follow a regular pattern: the light spot is larger at close range and smaller at long range, and it only appears in a fixed area of ​​the image. By cropping the light spot position in the image, the horizontal and vertical coordinates of the cropped area are not smaller than the coordinate area of ​​the light spot. This reduces the amount of data processing and increases speed.

[0038] 4. The ranging method and its reading device based on focused spot imaging described in this invention effectively solve the problem of laser halo interference caused by highly reflective materials by binarizing the spot images in steps S2 and Q2 and setting pixel thresholds. The halo morphology is uncertain due to the influence of multiple factors such as the reflective properties of the material, surface color, texture, and flatness. By reducing the exposure parameters to minimize the halo effect, the accuracy of laser positioning is significantly improved.

[0039] 5. The ranging method and its reading device based on focused spot imaging described in this invention reconstructs the laser spot through multiple binarization processing and adaptive filtering. After selecting the optimal coordinates, it combines high-precision fitting curves to achieve ranging. At the same time, in response to the uneven illumination and edge burrs at the microscopic level of the spot, morphological opening and closing operations are used for image filtering to simultaneously eliminate edge burrs and optimize the internal uniformity of the spot, significantly improving the coordinate positioning accuracy and ranging reliability.

[0040] 6. The ranging method and its reading device based on focused light spot imaging described in this invention have low background brightness. Preferably, a dedicated frame is used for unlit shooting during ranging. Under normal circumstances, the illuminance of the supplementary light will be greater than the ambient light, which can easily interfere with light spot positioning in highly reflective scenes. Therefore, unlit shooting of the focused light spot for ranging is preferred. Attached Figure Description

[0041] Figure 1 The diagram shows how the coordinates of the light spot change in the vertical direction as the distance increases due to installation and manufacturing deviations.

[0042] Figure 2 It is a model with no positional difference between the laser optical axis and the center of the field of view in the vertical direction, but with theoretical coordinates and distance of the deflection angle β1;

[0043] Figure 3 This is a diagram showing the effect of the distance and X-axis fitting curve of the present invention compared with the actual curve.

[0044] Figure 4 The image shows the effect of a laser spot being applied to an anti-static bag, with or without a supplementary light.

[0045] Figure 5 These are images taken at the same distance of 200cm, with a gain of 10, showing the effects of longer exposure times from left to right.

[0046] Figure 6 These are images showing the halo effect of laser spots under different exposure conditions;

[0047] Figure 7 This invention provides multiple lists of distance measurement results obtained through distance and X-axis coordinate calculations.

[0048] Figure 8 This invention is a model with a 7.2mm positional difference between the laser optical axis and the center of the field of view in the horizontal direction, and with theoretical coordinates and distances of the deflection angle β2.

[0049] Figure 9 This is a diagram showing the binarization effect of an image taken in a low-exposure environment.

[0050] Figure 10 This is a schematic diagram of the reading device of the present invention.

[0051] The attached figures are labeled as follows: 100-Housing; 110-Main board assembly; 120-Imaging assembly; 130-Laser lamp; 121-Lens assembly; 122-Liquid focusing assembly; 140-Fill light; 200-Object surface. Detailed Implementation

[0052] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.

[0053] Example 1.

[0054] like Figure 1-8 As shown, a ranging method based on focusing spot imaging includes the following steps:

[0055] S1, the horizontal distance d1 between the center position of the laser lamp of the recording device and the center position of the lens assembly (e.g., ... Figure 8 (As shown).

[0056] S2, acquire the light spot image.

[0057] S3. Establish a coordinate system for the light spot image with the upper left corner as the origin, search for the laser point, and record the coordinates of the laser point.

[0058] S4, obtain the distance D from the center of the lens assembly to the object plane (200). Figure 8 Using geometric properties, the calculation formula 1 is as follows:

[0059] F1 / 2-P1=(A1·D-B1)·F1 / 2,

[0060] Where A1=d1 / tanα1, B1=±tanβ1 / tanα1, α1 is the horizontal field of view half angle, β1 is the deflection angle between the laser axis and the field of view axis in the X direction, F1 is the horizontal pixel value of the image sensor, and P1 is the X coordinate value of the centroid of the laser point.

[0061] Due to mechanical characteristics, the center positions of the laser lamp and the lens assembly cannot coincide; they must be offset by a certain distance. This positional difference causes the coordinates of the focused spot on the image to change at different distances. This change forms a one-to-one function of distance and coordinates. Using this function, the object distance can be obtained from the coordinates of the laser point. The laser point referred to in this article is the laser spot.

[0062] The reading device pre-fits a curve of coordinates and distance, and stores it; then it performs the following steps:

[0063] Q1, the reading device sets the minimum exposure parameters of gain and exposure time, and projects the laser light onto the object surface 200 to form a light spot.

[0064] Q2, the light spot image is captured by taking pictures using the recognition device mounted on the distance mobile device, and one set of coordinates is collected for each step.

[0065] Q3. Repeat steps Q1 to Q2 multiple times, and combine them with calculation formula 1 to fit the relationship between the collected X coordinates and distances to obtain the A1 and B1 values ​​with the smallest error.

[0066] The theoretically defined coordinate trajectory of the focusing spot center is affected by factors such as manufacturing process tolerances: the focusing axis will always deflect slightly, and the focusing pattern trajectory will vary slightly from one device to another. For example... Figure 1 As shown: Figure 1 a is at coordinates 488, 459 when the distance is 80mm; Figure 1At a distance of 680mm, coordinate 'b' is 625,449, and the Y-coordinate is also changing. For this reason, during production, it is necessary to record a table showing the correspondence between the center point coordinates of the focusing pattern and the distance, and to accurately fit a curve between the X-coordinate and the distance.

[0067] To better illustrate the invention, a specific example is described below. However, the invention is not limited to this example; depending on the reading device, there can be N examples. For instance, if the reading device has a resolution of 1280*960 pixels, a horizontal field of view of 38 degrees, and no misalignment with the field of view axis in the vertical direction, then the horizontal distance between the center of the laser light and the center of the lens assembly is 7.2 mm.

[0068] Analysis of the Y-coordinate of the light spot in the vertical direction, as follows: Figure 2 As shown, there is no misalignment between the vertical direction and the field of view axis, but there is a deflection of angle β1. The pixel difference between the Y coordinate of the light spot and the Y coordinate of the field of view center is a fixed value and is independent of distance. If the light spot is not deflected, i.e., β1 = 0, then theoretically the Y coordinate is not suitable for distance measurement.

[0069] Because the center of the field of view is 7.2mm apart in the X direction and 0mm apart in the Y direction, the X coordinate changes more significantly with distance than the Y coordinate. Therefore, Formula 1 is used to fit the relationship between the X coordinate and distance:

[0070] 1280 / 2-P1=(A1 / D-B1)·1280 / 2,

[0071] Where A1 = 7.2 / tanα1, B1 = ±tanβ1 / tanα1, α1 is the horizontal field of view half angle, β1 is the deflection angle between the laser axis and the field of view axis in the X direction, F1 is the horizontal pixel value of the image sensor, and P1 is the X coordinate value of the centroid of the laser point.

[0072] Data acquisition: Using a high-precision distance device, the minimum exposure parameter gain is 10, the exposure time is 60 microseconds, from 50mm to 500mm, in 5mm increments, and one set of coordinate data is acquired for each increment (one set of data consists of 10 data points and is averaged).

[0073] Based on Formula 1 and the collected data, we performed multiple fine-tuning tests to find the A1 and B1 values ​​that minimized the error. The fitting results are as follows: Figure 3 As shown, it is clear that the fitted distance-X coordinate curve (orange) and the distance-X coordinate curve (blue) highly overlap, indicating that the fit is very accurate.

[0074] The fitted relationship is as follows, representing the pixel deviation:

[0075] 640-P1=(20.9962800443269 / D-0.0146842702801816)·640,

[0076] D=20.9962800443269 / ((640-P1) / 640+0.0146842702801816),

[0077] A1=20.9962800443269=7.2 / tanα; B1=0.0146842702801816=tanβ / tanα;

[0078] The result is tanα = 0.34291788758768282232326594535598.

[0079] The actual horizontal field of view of the equipment is about 38 degrees, and tan19 = 0.3473705910241 is not much different from the fitted value, which further verifies the accuracy of the fitted curve.

[0080] To improve the accuracy and efficiency of spot localization, the grayscale difference between the focused pattern and the background needs to be increased. This involves the reading device acquiring the image, including adjusting background brightness, spot brightness, and controlling exposure. To reduce background brightness, and especially in low-light conditions, it is preferable to turn off the supplementary lighting during ranging. Figure 4 The image shows the effect of a laser spot being photographed on an antistatic bag, with or without a supplementary light. Figure 4 a) To image the light spot with the fill light off. Figure 4 b is to turn on the fill light to image the light spot. It's quite obvious. Figure 4 a has almost no interference. Figure 4 The light spot of b was interfered with and could not be located.

[0081] The illuminance of the laser spot can be increased by raising the laser light brightness and / or reducing the beam angle, thereby increasing the distance between the laser spot and the ambient light. Furthermore, the smaller the laser spot, the less it is affected by different factors on the projected surface. For example... Figure 1 The image shown is an image taken from a white A4 sheet of paper at a distance of approximately 80cm under normal conditions, with the fill light off, the focus light on, an exposure time of 60 microseconds, and a gain of 10. It's clear that even with such low exposure parameters, the light spot still reaches saturation. In this situation, increasing the exposure time or gain, such as changing the exposure time to 600 microseconds, would increase the grayscale of the background, while the grayscale of the focus spot would remain at 255, thus reducing the grayscale difference between the background and the light spot.

[0082] like Figure 5 As shown, under normal conditions, with the fill light off and the focus light on, at a gain of 10, and exposure times increasing from short to long (from left to right), images were taken of a thin metal film at a distance of approximately 200mm. It can be seen that, from left to right, the longer the exposure time, the more difficult it is to distinguish the laser spot from the background when the laser hits the metal surface. Figure 5 The grayscale value of light spot 'a' is 255 and very small, while the background value is 0. Figure 5 In image c, the metal film background is clearly visible, and there are multiple instances of interference with a grayscale value of 255 in the metal film area. Figure 5 (c top left corner). Simultaneously, due to the different materials, colors, and curvatures around the laser spot, a certain halo effect occurs. In most cases, the grayscale of these halos is lower than the illumination of the laser spot itself. The shape, color, material, and curvature of the halo are related to factors and have uncertainties. If the exposure parameters are too long, the grayscale values ​​of these halos will also approach 255, increasing the proportion of halo interference in the overall laser spot. This amplifies these uncertainties and interferences, thus affecting the accuracy of the laser spot's centroid positioning. Therefore, it is necessary to control the exposure parameters to avoid overexposure of the halo interfering with centroid positioning.

[0083] like Figure 6 As shown, Figure 6 'a' indicates that under low exposure, the light spot has no halo interference and the coordinates are accurately located: 623, 476. However... Figure 6 When the exposure time increases, the shape of the light spot becomes distorted, the centroid positioning deviation is 624,467, the Y coordinate changes significantly, and the accuracy is very low. Therefore, to improve the spot positioning rate and accuracy, the exposure parameters should be as small as possible while still allowing the spot positioning algorithm to locate the spot. This will increase the grayscale difference between the spot and the background, and reduce halo interference around the spot, making it easier to improve accuracy and positioning rate.

[0084] In step S2, continuous shooting is performed when acquiring bokeh images. During the shooting process, the exposure threshold is gradually increased, starting from the lowest exposure parameter and ending at the end. The exposure parameter = gain × exposure time. Subsequent processing will begin with the image with the lowest exposure value for bokeh localization. If the bokeh cannot be located, the image with the next exposure parameter will be used for bokeh localization until it is located.

[0085] like Figure 7 As shown, by using the fitted formula, multiple lists of distance measurement results are calculated using the X-axis coordinate, resulting in high distance accuracy.

[0086] At approximately 100mm, the maximum error is 2.2mm; at approximately 150mm, the maximum error is 4.35mm; at approximately 200mm, the maximum error is 5mm; at approximately 300mm, the maximum error is 7.37mm; and at approximately 400mm, the maximum error is 11.8mm. Under the same conditions, compared with ST's TOF chip VL53L1X, the TOF ranging accuracy is ±20mm regardless of whether the distance is near or far. Therefore, the short-range accuracy of this solution is higher than that of TOF ranging.

[0087] Example 2.

[0088] Based on Example 1, the distance obtained by Formula 1 is verified using the Y-axis coordinate, and the light spot is optimized. A ranging method based on focused light spot imaging is proposed, where the vertical distance d2 from the laser light to the center of the field of view is calculated using Formula 2 as follows:

[0089] F² / 2 - P² = (A² / D - B²)·F² / 2,

[0090] Where A2=d2 / tanα2, B2=±tanβ2 / tanα2, α2 is the half angle in the vertical direction of the field of view, β2 is the deflection angle of the laser axis in the vertical direction, F2 is the vertical pixel value of the image sensor, and P2 is the Y coordinate value of the centroid of the laser point.

[0091] Due to actual machining and assembly precision issues in the vertical direction, there is a distance of approximately 0.1mm between the laser tube and the center of the field of view, as well as a deflection of approximately ±2 degrees. Figure 8 As shown, there is a one-to-one relationship between the Y coordinate and the distance D, except that it changes from 7.2 mm in d1 to about 0.1 mm in d2. A curve is fitted to the relationship between the distance D and the Y coordinate.

[0092] According to Formula 2, we get: 480-P2=(A2 / D-B2)*480. By combining the collected data and performing multiple fine-tuning, we can find the values ​​of A2 and B2 with the smallest error.

[0093] The parameters of the fitted curve are as follows:

[0094] 480-Y=(-2.87489167696064 / D+0.008981)*480,

[0095] The size and position of the light spots follow a pattern: they are larger at close range and smaller at long range, and they only appear in fixed areas of the image. Based on this pattern, the positions of the light spots in the image are cropped, with the horizontal and vertical coordinates of the cropped area not less than the coordinates of the light spot. This reduces the amount of data processing and increases speed.

[0096] In the case of highly reflective materials, photons from a laser spot will diffuse around the spot, creating a halo effect, such as... Figure 5 As shown, the shape of the halo is related to the reflective material, color, texture, and smoothness, and thus has uncertainties. To improve positioning accuracy, the exposure parameters need to be reduced to minimize the halo. The spot image from step S2 and multiple sets of spot images from step Q2 are subjected to baseline binarization to ensure that the spot pixels are within a set threshold. Figure 9 As shown, this image was taken at close range with low exposure. Figure 9 The maximum grayscale value inside spot a is 103, and the minimum is 24. Figure 9 b is 50 for binarization. Figure 9c is set to 10 for binarization. It can be seen that binarization with a threshold of 10 and 50 produces different images. A smaller binarization threshold is better; in practice, a binarization threshold of 10 is chosen to determine the shape of the grayscale light spot. Lower binarization will maximize the completion of the light spot.

[0097] The grayscale values ​​of the pixels inside the binarized spot are not completely continuous and have some jagged edges. We need to perform image filtering through opening and closing operations to eliminate edge jagged edges and homogenize the inside of the spot. Depending on the actual spot, multiple combinations need to be tried to reconstruct the spot. The centroid coordinates closest to the original spot will be closest to the fitted coordinates. To further reduce the amount of data processed, the first binarized spot image can be seeded by applying a set diffusion threshold. For example, the first low-threshold binarized spot image can be seeded by diffusing it by 50% in each direction (top, bottom, left, and right) to further reduce the amount of data processed.

[0098] Centroid detection is performed on multiple spot images after filtering and binarization to obtain corresponding coordinates.

[0099] Inputting coordinate X into Formula 1 yields distance D, and inputting distance D into Formula 2 yields the theoretical Y coordinate. The difference between the theoretical and actual Y coordinates is calculated. Since it's a high-precision fitted curve, and the pixel deviation in the Y coordinate is small, if the difference between the spot's Y coordinate and the theoretical Y coordinate is within ±1, then the coordinate closest to the theoretical value is selected as the positioning spot. After obtaining the coordinates, the distance is calculated using Formula 2, which represents the curve of coordinate X and distance D.

[0100] Example 3.

[0101] like Figure 10 As shown, a reading device performs the steps of Embodiment 1 or 2, including: a housing 100, a motherboard assembly 110, an imaging assembly 120, and a laser lamp 130.

[0102] The imaging component 120 is disposed inside the housing 100, and in front of the image sensor, it includes a lens assembly 121 and a liquid focusing assembly 122.

[0103] The motherboard assembly 110 is equipped with a laser lamp 130, a fill light 140, an image sensor, a processor, and a memory. The motherboard assembly 110 controls the laser lamp 130 to emit laser light, controls the fill light 140 to provide fill light, controls the imaging assembly 120 to perform single-frame or continuous multi-frame shooting, and controls imaging parameters such as gain and exposure time.

[0104] When acquiring the laser spot image, the supplementary light 140 is turned off. Because the exposure time is very short, the laser spot illuminates for a very short time within a single frame, resulting in a lower perceived effective laser brightness for the user. To address this issue, the laser illumination time can be longer than the supplementary light time, the purpose being to allow the user to perceive a brighter spot location during ranging.

[0105] The above description is merely an embodiment of the present invention. The selection of the embodiment scheme is only for better understanding of the invention and is not intended to limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A ranging method based on focused spot imaging, characterized in that, Includes the following steps: S1, the distance d1 between the center position of the laser lamp of the reading device and the horizontal position of the center of the lens assembly; S2, acquire the light spot image; S3, establish a coordinate system for the light spot image with the upper left corner as the origin, search for the laser point, and record the coordinates of the laser point; S4, obtain the distance D from the center of the lens assembly to the object plane (200), calculated using the following formula: F1 / 2-P1=(A1 / D-B1)·F1 / 2, Where A1=d1 / tanα1, B1=±tanβ1 / tanα1, α1 is the horizontal field of view half angle, β1 is the deflection angle between the laser axis and the field of view axis in the X direction, F1 is the horizontal pixel value of the image sensor, and P1 is the X coordinate value of the centroid of the laser point.

2. The ranging method based on focused spot imaging according to claim 1, characterized in that, The reading device pre-fits a curve of coordinates and distance, and stores it; Perform the following steps: Q1, the reading device sets the minimum exposure parameters of gain and exposure time, and projects the laser light onto the object surface (200) to form a light spot; Q2, the light spot image is captured by the reading device mounted on the distance mobile device, and one set of coordinates is collected for each step; Q3. Repeat steps Q1 to Q2 multiple times, and combine them with calculation formula 1 to fit the relationship between the collected X coordinates and distances to obtain the A1 and B1 values ​​with the smallest error.

3. The ranging method based on focused spot imaging according to claim 1, characterized in that, Using the vertical distance d2 from the center of the laser light to the center of the field of view, the distance obtained by Formula 1 is verified using the Y-axis coordinate. Formula 2 is calculated as follows: F² / 2 - P² = (A² / D - B²)·F² / 2, Where A2=d2 / tanα2, B2=±tanβ2 / tanα2, α2 is the half angle in the vertical direction of the field of view, β2 is the deflection angle of the laser axis in the vertical direction, F2 is the vertical pixel value of the image sensor, and P2 is the Y coordinate value of the centroid of the laser point.

4. The ranging method based on focused spot imaging according to claim 1, characterized in that, In step S2, the reading device acquires the image, including adjusting the brightness of the light spot and exposure control, so that the grayscale distinction between the background and the light spot is increased; The brightness of the light spot is increased by increasing the brightness of the laser lamp and reducing the beam angle.

5. The ranging method based on focused spot imaging according to claim 1, characterized in that, In step S2, continuous shooting is performed to acquire the light spot image, and the exposure threshold is gradually increased from the reference value. The exposure parameter = gain × exposure time.

6. A ranging method based on focused spot imaging according to claim 1 or 5, characterized in that, The position of the light spot in the light spot image is cropped, and the horizontal and vertical coordinates of the cropped area are not less than the coordinate area of ​​the light spot.

7. A ranging method based on focused spot imaging according to claim 1 or 2, characterized in that, The spot image from step S2 and the multiple spot images from step Q2 are binarized and then subjected to multiple image filtering.

8. The ranging method based on focused spot imaging according to claim 7, characterized in that, The binarized image is then filtered. The first binarized spot image region is seeded and diffused using a set diffusion threshold. Subsequent image processing uses the diffused region for processing.

9. A reading device, characterized in that, Performing the steps of claim 1 includes: a housing (100), a motherboard assembly (110), an imaging assembly (120), and a laser lamp (130); The imaging component (120) is disposed inside the housing (100), and in front of the image sensor, there are a lens assembly (121) and a liquid focusing assembly (122); The motherboard assembly (110) is equipped with a laser lamp (130), an image sensor, a processor, and a memory.

10. A reading device according to claim 9, characterized in that, The fill light (140) is mounted on the motherboard assembly (110). When acquiring a light spot image, the fill light (140) is turned off.