Ranging device based on an image sensor with dynamically adjustable pixel area output

By dynamically adjusting the pixel area output and filtering and expanding the pixel column range, the problem of determining the centroid position of the laser spot, which involves a large amount of computation, is solved in the existing technology, thereby improving computational efficiency.

CN116953716BActive Publication Date: 2026-06-02ELCO TIANJIN ELECTRONICS

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ELCO TIANJIN ELECTRONICS
Filing Date
2023-07-10
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Determining the centroid position of a laser spot in existing technologies involves a large amount of computation, especially when linear CMOS image sensors need to output the position and voltage information of all pixels, resulting in excessive computation.

Method used

By acquiring the motion direction of the object under test, the pixel output is dynamically adjusted, the target pixel column number range is selected using preset conditions, and the monitoring pixel column number range is expanded on this basis. Only the voltage values ​​of pixels whose column number belongs to this range are traversed, and the monitoring pixel column number range is updated to determine the position of the laser spot centroid.

Benefits of technology

It reduces the amount of computation required to determine the centroid position of the laser spot and improves computational efficiency. In particular, when the object under test moves along the direction of the laser emitter, the centroid position of the spot can be determined by traversing the voltage values ​​of a portion of the pixels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116953716B_ABST
    Figure CN116953716B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of optical measuring equipment, and provides a ranging device based on an image sensor with a dynamically adjustable pixel area output, which comprises a linear array CMOS image sensor, a processor and a memory, the memory has computer readable instructions stored thereon, and the computer readable instructions realize the following steps when executed by the processor: if the motion direction of a to-be-measured object is along the direction of a laser beam emitted by a laser emitter, voltage data of the CMOS image sensor at a first sampling moment is acquired; [B, D] is acquired; [B-Dl, D+Dl] is acquired; voltage data of the CMOS image sensor at a second sampling moment is acquired; [C, E] is acquired; [B-Dl, D+Dl] is updated as [H, R]; and the position of a light spot centroid of the CMOS image sensor at the second sampling moment is acquired according to the position and voltage of a second target pixel point. The application reduces the calculation amount when the position of the light spot centroid is determined.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of Chinese Patent Application No. CN202310839730.X, filed on July 10, 2023, entitled “Range Measuring Device Based on Image Sensor with Dynamically Adjustable Pixel Area Output”, the entire contents of which are included in the parent application. Technical Field

[0002] This invention relates to the field of optical measurement equipment technology, and in particular to a ranging device based on an image sensor with dynamically adjustable pixel area output. Background Technology

[0003] The ranging principle of a laser triangulation sensor is that a laser beam emitted by a laser emitter hits the object being measured. A portion of the diffusely reflected laser beam passes through a focusing lens and forms a laser spot on a linear CMOS image sensor. The distance from the object to the laser triangulation sensor can be obtained based on the centroid position of the laser spot. In existing technologies, determining the centroid position of the laser spot requires the linear CMOS image sensor to output the position and voltage information of all pixels. For example, if the linear CMOS image sensor is a 4-line array, then the pixels of this 4-line array CMOS image sensor are distributed in 4 rows. If each row has 4096 pixels, then the total number of pixels in the 4-line array CMOS image sensor is 4*4096. Since one pixel corresponds to one pixel point, the total number of pixels in the 4-line array CMOS image sensor is also 4*4096. Determining the centroid position of the laser spot based on the position and voltage of all pixels output by the linear CMOS image sensor would involve a large computational burden. Summary of the Invention

[0004] The purpose of this invention is to provide a ranging device based on an image sensor with dynamically adjustable pixel area output, so as to reduce the amount of computation in the process of determining the centroid position of a laser spot.

[0005] According to the present invention, a ranging device based on an image sensor with dynamically adjustable pixel area output is provided. The ranging device includes: a laser emitter, a linear CMOS image sensor, a processor, and a memory; the memory stores computer-readable instructions, which, when executed by the processor, perform the following steps:

[0006] S100, obtain the direction of motion of the object under test.

[0007] S200, if the direction of motion of the object under test is along the direction of the laser beam emitted by the laser emitter, then proceed to S300.

[0008] S300, obtain the voltage data of the CMOS image sensor at the first sampling moment. The voltage data of the CMOS image sensor at the first sampling moment includes the voltages of all pixel points of the CMOS image sensor at the first sampling moment.

[0009] S400, obtain the first target pixel column number interval [B, D] according to the voltage data of the CMOS image sensor at the first sampling moment. B is the minimum value of the column numbers of all pixel points that meet the first preset condition among all pixel points of the CMOS image sensor at the first sampling moment, and D is the maximum value of the column numbers of all pixel points that meet the first preset condition among all pixel points of the CMOS image sensor at the first sampling moment. The first preset condition is that the corresponding voltage is greater than the preset voltage threshold.

[0010] S500, obtain the monitoring pixel column number interval [B - Δl, D + Δl], where Δl is the preset column number threshold or Δl = (D - B) / n, and n is a positive integer greater than or equal to 2.

[0011] S600, obtain the voltage data of the CMOS image sensor at the second sampling moment. The voltage data of the CMOS image sensor at the second sampling moment includes the voltages of the first target pixel points. The first target pixel points are the pixel points among all pixel points of the CMOS image sensor at the second sampling moment whose column numbers belong to the monitoring pixel column number interval [B - Δl, D + Δl].

[0012] S700, obtain the second target pixel column number interval [C, E] according to the voltage data of the CMOS image sensor at the second sampling moment. C is the minimum value of the column numbers of all pixel points that meet the first preset condition among the first target pixel points, and E is the maximum value of the column numbers of all pixel points that meet the first preset condition among the first target pixel points.

[0013] S800, update the monitoring pixel column number interval [B - Δl, D + Δl] to [H, R]. When C > B and E > D, H = B - Δl + S1, R = D + Δl + S1. When C < B and E < D, H = B - Δl - S1, R = D + Δl - S1. S1 is the moving distance of the monitoring pixel column number interval at the second sampling moment compared to the first sampling moment, and S1 = max(|C - B|, |E - D|).

[0014] S900, obtain the position of the centroid of the light spot of the CMOS image sensor at the second sampling moment according to the positions and voltages of the second target pixel points. The position of the centroid of the light spot is used to obtain the distance between the待测物体 (to-be-measured object) and the laser triangulation distance sensor. The second target pixel points are the pixel points among the pixel points of the CMOS image sensor at the second sampling moment whose column numbers belong to the updated monitoring pixel column number interval [H, R].

[0015] The present invention has at least the following beneficial effects:

[0016] This invention provides a ranging device based on an image sensor with dynamically adjustable pixel output. For a test object moving along the direction of a laser beam emitted by a laser emitter, this invention obtains a monitoring pixel column interval [B-Δl, D+Δl] based on the first target pixel column interval [B, D] corresponding to the first sampling time. The first target pixel column interval [B, D] corresponds to the position of the laser spot of the test object at the first sampling time. The monitoring pixel column interval [B-Δl, D+Δl] is obtained by extending the first target pixel column interval [B, D]. The range of the first target pixel column interval [B, D] is wider than that of the first target pixel column interval [B, D]. For the second sampling time, since the test object moves from its position at the first sampling time to its position at the second sampling time, the position of the laser spot at the second sampling time is also obtained by moving the position of the laser spot at the first sampling time. Based on this, this invention obtains... The method for obtaining the second target pixel column number interval [C,E] does not involve iterating through the voltage values ​​of all columns of pixels as in the first sampling time. Instead, it only iterates through the voltage values ​​of pixels belonging to the second target column (i.e., column B-Δl to column D+Δl). Based on the positional relationship between the second target pixel column number interval [C,E] and the first target pixel column number interval [B,D], the moving direction and amplitude of the laser spot are obtained. The monitoring pixel column number interval [B-Δl,D+Δl] is then updated based on this moving direction and amplitude, ensuring that the laser spot in the second sampling interval completely falls within the updated monitoring pixel column number interval [H,R]. Therefore, this invention does not require obtaining the position of the spot centroid at the second sampling time based on all pixels. Instead, it only needs to determine the position of the laser spot centroid based on the position and voltage of pixels belonging to the updated monitoring pixel column number interval [H,R], thus reducing the computational load in determining the position of the laser spot centroid. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating the steps implemented when a computer-readable instruction provided in an embodiment of the present invention is executed by the processor. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Example 1

[0021] According to the present invention, a ranging device based on an image sensor with dynamically adjustable pixel area output is provided. The ranging device includes: a laser emitter, a linear CMOS image sensor, a processor, and a memory; the memory stores computer-readable instructions.

[0022] like Figure 1 As shown, when the computer-readable instructions are executed by the processor, they perform the following steps:

[0023] S100, obtain the direction of motion of the object under test.

[0024] Optionally, the motion direction of the object to be measured can be obtained through the motion direction information of the object to be measured input by the user. It should be understood that the user is aware of the application scenario of the laser triangulation rangefinder in advance, that is, the user has a pre-judgment of the motion direction of the object to be measured by the laser triangulation rangefinder. Therefore, the user can input the motion direction information of the object to be measured before executing S100.

[0025] S200, if the direction of motion of the object under test is along the direction of the laser beam emitted by the laser emitter, then proceed to S300.

[0026] According to the present invention, if the direction of motion of the object under test is perpendicular to the direction of the laser beam emitted by the laser emitter, then S300-S900 will not be executed, and the centroid position of the laser spot still needs to be determined based on all the pixels of the linear CMOS image sensor.

[0027] S300, acquire the voltage data of the CMOS image sensor at the first sampling time, wherein the voltage data of the CMOS image sensor at the first sampling time includes the voltage of all pixels of the CMOS image sensor at the first sampling time.

[0028] According to the present invention, the voltage data of the CMOS image sensor at the first sampling time in S300 is U 1 U 1 =((u) 1 1,1 ,u 1 1,2 ,…,u 1 1,m ,…,u1 1,M ),(u 1 2,1 ,u 1 2,2 ,…,u 1 2,m ,…,u 1 2,M ),…,(u 1 n,1 ,u 1 n,2 ,…,u 1 n,m ,…,u 1 n,M ),…,(u 1 N,1 ,u 1 N,2 ,…,u 1 N,m ,…,u 1 N,M )); (u 1 n,1 ,u 1 n,2 ,…,u 1 n,m ,…,u 1 n,M ) represents the voltage of the nth pixel in the CMOS image sensor at the first sampling time, u 1 n,m Let be the voltage of the pixel in the nth row and mth column of the CMOS image sensor at the first sampling time. The value of n ranges from 1 to N, where N is the total number of rows of pixels in the CMOS image sensor, and the value of m ranges from 1 to M, where M is the total number of columns of pixels in the CMOS image sensor.

[0029] For example, if the CMOS image sensor is a 4-line array CMOS image sensor, then the total number of rows of pixels in the CMOS image sensor is N = 4; if each row contains 4096 pixels, then M = 4096.

[0030] S400, obtain the first target pixel column number interval [B,D] based on the voltage data of the CMOS image sensor at the first sampling time. B is the minimum value of the column number of all pixels in the CMOS image sensor that meet the first preset condition at the first sampling time, and D is the maximum value of the column number of all pixels in the CMOS image sensor that meet the first preset condition at the first sampling time. The first preset condition is that the corresponding voltage is greater than a preset voltage threshold.

[0031] According to the present invention, the voltage threshold is used to filter out noise. When the voltage of a pixel is greater than the voltage threshold, it is determined that the position corresponding to the pixel does not receive the laser reflected from the surface of the object under test; otherwise, it is determined that the position corresponding to the pixel can receive the laser reflected from the surface of the object under test. The voltage threshold can be set according to empirical values.

[0032] According to the present invention, the method for obtaining the first target pixel column number interval [B,D] includes:

[0033] S410, traversing U 1 , obtain (u 1 n,1 ,u 1 n,2 ,…,u 1 n,m ,…,u 1 n,M The first pixel column number interval [l] corresponds to n,1 ,l n,2 ], l n,1 The minimum number of columns of all pixels in the nth row of the CMOS image sensor that satisfy the first preset condition at the first sampling time is given by l. n,2 It is the maximum value of the column number of all pixels in the nth row of the CMOS image sensor that satisfy the first preset condition at the first sampling time.

[0034] S420, obtain the first target pixel column number interval [B,D], B=min(l 1,1 ,l 2,1 ,…,l n,1 ,…,l N,1 ), D = max(l 1,2 ,l 2,2 ,…,l n,2 ,…,l N,2 min() retrieves the minimum value, and max() retrieves the maximum value.

[0035] S500, obtain the monitoring pixel column number range [B-Δl, D+Δl], where Δl is the preset column number threshold or Δl=(DB) / n, and n is a positive integer greater than or equal to 2.

[0036] Preferably, when Δl is a preset column number threshold, 5 ≤ Δl ≤ 10. Small-batch experiments have shown that when 5 ≤ Δl ≤ 10, the range of the monitored pixel column number interval can meet the requirement of obtaining the second target pixel column number interval [C, E], and the corresponding computational load is also relatively small.

[0037] Preferably, when Δl = (DB) / n, the method for obtaining n includes:

[0038] S510, set the first variable k = 2.

[0039] S520, obtain B-(DB) / k and D+(DB) / k.

[0040] S530, if [B-(DB) / k]<0 or [D+(DB) / k]>M, then k=k+1, repeat S520 until [B-(DB) / k]≥0 and [D+(DB) / k]≤M.

[0041] S540, obtain n as k.

[0042] The above-mentioned S510-S540 can obtain a relatively large range of monitored pixel column number intervals while ensuring that the monitored pixel column number interval does not exceed the range of pixel column number intervals, so as to meet the requirement of obtaining the second target pixel column number interval [C,E].

[0043] S600, acquire the voltage data of the CMOS image sensor at the second sampling time, the voltage data of the CMOS image sensor at the second sampling time includes the voltage of the first target pixel; the first target pixel is the pixel whose column number belongs to the monitoring pixel column number interval [B-Δl, D+Δl] among all pixels of the CMOS image sensor at the second sampling time.

[0044] Optionally, the time difference between the second sampling time and the first sampling time is one sampling period of the CMOS image sensor. One sampling period is relatively small, and the position of the light spot corresponding to the second sampling time moves a smaller distance than the position of the light spot corresponding to the first sampling time, so that the subsequent C and E can be obtained based on the B-Δl column to the D+Δl column of the CMOS image sensor at the second sampling time.

[0045] According to the present invention, the voltage data of the CMOS image sensor at the second sampling time is U 2 U 2 =((u) 2 1,B-Δl ,u 2 1,B-Δl+1 ,…,u 2 1,b ,…,u 2 1,D+Δl ),(u 2 2,B-Δl ,u 2 2,B-Δl+1 ,…,u 2 2,b ,…,u 2 2,D+Δl ),…,(u 2 n,B-Δl ,u 2 n,B-Δl+1,…,u 2 n,b ,…,u 2 n,D+Δl ),…,(u 2 N,B-Δl ,u 2 N,B-Δl+1 ,…,u 2 N,b ,…,u 2 N,D+Δl )); (u 2 n,B-Δl ,u 2 n,B-Δl+1 ,…,u 2 n,b ,…,u 2 n,D+Δl ) represents the voltage of the pixel in the second target column of the nth row of the CMOS image sensor at the second sampling time, u 2 n,b The voltage of the pixel in the nth row and bth column of the CMOS image sensor at the second sampling time is given, where b ranges from B-Δl to D+Δl; the second target column is from the B-Δl column to the D+Δl column.

[0046] S700, based on the voltage data of the CMOS image sensor at the second sampling time, obtain the second target pixel column number interval [C,E], where C is the minimum value of the column number of all pixels in the first target pixel that satisfy the first preset condition, and E is the maximum value of the column number of all pixels in the first target pixel that satisfy the first preset condition.

[0047] According to the present invention, the method for obtaining the second target pixel column number interval [C, E] includes:

[0048] S710, traversing U 2 , obtain (u 2 n,B-Δl ,u 2 n,B-Δl+1 ,…,u 2 n,b ,…,u 2 n,D+Δl The second pixel column range [f] corresponds to n,1 ,f n,2 ], f n,1 f is the minimum number of columns of all pixels in the second target column of the nth row of the CMOS image sensor that satisfy the first preset condition at the second sampling time. n,2 The maximum number of columns of all pixels in the second target column of the nth row of the CMOS image sensor that satisfy the first preset condition at the second sampling time.

[0049] S720, obtain the second target pixel column number interval [C, E], where C = min(f 1,1 , f 2,1 , …, f n,1 , …, f N,1 ),

[0050] E = max(f 1,2 , f 2,2 , …, f n,2 , …, f N,2 ).

[0051] S800, update the monitoring pixel column number interval [B - Δl, D + Δl] to [H, R]; when C > B and E > D, H = B - Δl + S1, R = D + Δl + S1; when C < B and E < D, H = B - Δl - S1, R = D + Δl - S1; S1 is the moving distance of the monitoring pixel column number interval at the second sampling moment compared to the first sampling moment, and S1 = max(|C - B|, |E - D|).

[0052] S900, obtain the position of the light spot centroid of the CMOS image sensor at the second sampling moment according to the position and voltage of the second target pixel points, and the position of the light spot centroid is used to obtain the distance between the待测物体 (to-be-measured object) and the laser triangulation ranging sensor; the second target pixel points are the pixel points in the updated monitoring pixel column number interval [H, R] among the pixel points of the CMOS image sensor at the second sampling moment.

[0053] Those skilled in the art know that using an A / D converter can convert the voltage information of pixel points into corresponding gray-scale information. The process of obtaining the light spot centroid position based on the position and gray-scale information of pixel points is prior art and will not be elaborated here; after determining the pixel points for determining the light spot centroid, any method in the prior art for obtaining the distance between the待测物体 (to-be-measured object) and the laser triangulation ranging sensor based on the position of the pixel points to obtain the light spot centroid falls within the protection scope of this invention.

[0054] It should be noted that "待测物体" is a placeholder in Chinese which might need to be replaced with the actual English term according to the specific context. Here it is tentatively translated as "to-be-measured object".This invention provides a ranging device based on an image sensor with dynamically adjustable pixel output. For a test object moving along the direction of a laser beam emitted by a laser emitter, this invention obtains a monitoring pixel column interval [B-Δl, D+Δl] based on the first target pixel column interval [B, D] corresponding to the first sampling time. The first target pixel column interval [B, D] corresponds to the position of the laser spot of the test object at the first sampling time. The monitoring pixel column interval [B-Δl, D+Δl] is obtained by extending the first target pixel column interval [B, D]. The range of the first target pixel column interval [B, D] is wider than that of the first target pixel column interval [B, D]. For the second sampling time, since the test object moves from its position at the first sampling time to its position at the second sampling time, the position of the laser spot at the second sampling time is also obtained by moving the position of the laser spot at the first sampling time. Based on this, this invention obtains... The method for obtaining the second target pixel column number interval [C,E] does not involve iterating through the voltage values ​​of all columns of pixels as in the first sampling time. Instead, it only iterates through the voltage values ​​of pixels belonging to the second target column (i.e., column B-Δl to column D+Δl). Based on the positional relationship between the second target pixel column number interval [C,E] and the first target pixel column number interval [B,D], the moving direction and amplitude of the laser spot are obtained. The monitoring pixel column number interval [B-Δl,D+Δl] is then updated based on this moving direction and amplitude, ensuring that the laser spot in the second sampling interval completely falls within the updated monitoring pixel column number interval [H,R]. Therefore, this invention does not require obtaining the position of the spot centroid at the second sampling time based on all pixels. Instead, it only needs to determine the position of the laser spot centroid based on the position and voltage of pixels belonging to the updated monitoring pixel column number interval [H,R], thus reducing the computational load in determining the position of the laser spot centroid.

[0055] Based on the above S100-S900, the position of the spot centroid of the CMOS image sensor at the second sampling time is obtained, reducing the computational load in determining the position of the spot centroid at the second sampling time. In order to reduce the computational load in determining the position of the spot centroid at other subsequent sampling times, the present invention uses the same method as S600-S900 to obtain the position of the spot centroid of the CMOS image sensor at the third sampling time and subsequent sampling times (i.e., sampling times greater than the third sampling time, such as the fourth and fifth sampling times). The method for obtaining the position of the spot centroid of the CMOS image sensor at the third sampling time will be described below as an example.

[0056] In order to obtain the position of the centroid of the CMOS image sensor spot at the third sampling time, the computer-readable instructions of the present invention, when executed by the processor, further implement the following steps:

[0057] S1000, acquire the voltage U of the CMOS image sensor at the third sampling time. 3 =((u) 3 1,H ,u 3 1,H+1 ,…,u 3 1,r ,…,u 3 1,R ),(u 3 2,H ,u 3 2,H+1 ,…,u 3 2,r ,…,u 3 2,R ),…,(u 3 n,H ,u 3 n,H+1 ,…,u 3 n,r ,…,u 3 n,R ),…,(u 3 N,H ,u 3 N,H+1 ,…,u 3 N,r ,…,u 3 N,R )); (u 3 n,H ,u 3 n,H+1 ,…,u 3 n,r ,…,u 3 n,R Let u be the voltage of the pixel in the third target column of the nth row of the CMOS image sensor at the third sampling time. 3 n,r The voltage of the pixel in the nth row and rth column of the CMOS image sensor at the third sampling time is given, where r ranges from H to R; the third target column is from the Hth column to the Rth column.

[0058] Optionally, the time difference between the third sampling time and the second sampling time is one sampling period of the CMOS image sensor. One sampling period is relatively small, and the position of the light spot corresponding to the third sampling time moves a smaller distance than the position of the light spot corresponding to the second sampling time, so that the subsequent G and Q can be obtained based on the H to R columns of the CMOS image sensor at the third sampling time.

[0059] S1100, traversing U 3 , obtain (u 3 n,H ,u3 n,H+1 ,…,u 3 n,r ,…,u 3 n,R ) corresponding third pixel column number interval [p n,1 ,p n,2 , p n,1 is the minimum value of the column numbers of all pixel points that meet the first preset condition among the pixel points of the third target column in the nth row of the CMOS image sensor at the third sampling moment, p n,2 is the maximum value of the column numbers of all pixel points that meet the first preset condition among the pixel points of the third target column in the nth row of the CMOS image sensor at the third sampling moment.

[0060] S1200, obtain the third target pixel column number interval [G, Q], G = min(p 1,1 ,p 2,1 ,…,p n,1 ,…,p N,1 ), Q = max(p 1,2 ,p 2,2 ,…,p n,2 ,…,p N,2 ).

[0061] S1300, update the updated monitoring pixel column number interval [H, R] to [V, W]; when G > C and Q > E, V = H + S2, W = R + S2; when G < C and Q < E, V = H - S2, W = R - S2; S2 is the moving distance of the monitoring pixel column number interval at the third sampling moment compared to the second sampling moment, S2 = max(|G - C|, |Q - E|).

[0062] S1400, obtain the position of the centroid of the light spot of the CMOS image sensor at the third sampling moment according to the position and voltage of the third target pixel points; the third target pixel points are the pixel points whose column numbers belong to the updated monitoring pixel column number interval [V, W] among the pixel points of the CMOS image sensor at the third sampling moment.

[0063] For the third sampling time, since the object under test moves from its position at the second sampling time to its position at the third sampling time, the position of the laser spot at the third sampling time is also obtained by moving the position of the laser spot at the second sampling time. Based on this, the method of obtaining the third target pixel column number interval [G,Q] in this invention does not traverse the voltage values ​​of all columns of pixels as in the first sampling time, but only traverses the voltage values ​​of pixels whose column number belongs to the third target column. Based on the positional relationship between the third target pixel column number interval [G,Q] and the second target pixel column number interval [C,E], the moving direction and moving amplitude of the laser spot are obtained, and the monitoring pixel column number interval [H,R] is updated based on the moving direction and moving amplitude, so that the laser spot in the third sampling interval completely falls into the updated monitoring pixel column number interval [V,W]. Therefore, this invention does not need to obtain the position of the spot centroid at the third sampling time based on all pixels, but only needs to determine the position of the laser spot centroid based on the position and voltage of pixels whose column number belongs to the updated monitoring pixel column number interval [V,W], thus reducing the amount of calculation in determining the position of the laser spot centroid.

[0064] Example 2

[0065] The difference between this embodiment and Embodiment 1 is that the following steps are included before S100:

[0066] S010, determine whether the distance between the object to be measured and the laser triangulation sensor belongs to the preset distance range [h] min ,h max ].

[0067] It should be understood that the user is aware of the application scenario of the laser triangulation sensor in advance, that is, the user has a pre-defined range of distances between the object to be measured and the laser triangulation sensor. Therefore, the user can input the range of distances between the object to be measured and the laser triangulation sensor before executing S010, and then compare this range with the preset distance interval [h]. min ,h max The method of comparison determines whether the distance between the object to be measured and the laser triangulation sensor falls within a preset distance range. min ,h max According to the present invention, the distance range is only considered to be within a preset distance interval [h] in accordance with the present invention. min ,h max The result is "belongs" only if the interval is a subinterval of ]; otherwise, the result is "does not belong".

[0068] For example, the preset distance interval [h] min ,h maxThe distance is [5, 10], in cm; if the user inputs the distance range between the object to be measured and the laser triangulation sensor as [6-8], in cm, before executing S010, then the result is that the distance between the object to be measured and the laser triangulation sensor belongs to the preset distance range [h]. min ,h max If the user inputs a distance range of [3-5] cm between the object to be measured and the laser triangulation sensor before executing S010, then the determination result is that the distance between the object to be measured and the laser triangulation sensor does not belong to the preset distance range [h]. min ,h max ].

[0069] S020, if the judgment result is yes, then proceed to S030.

[0070] In this embodiment, if the judgment result in S020 is "not belonging", S030 is not executed. Instead, S100 is entered, and the steps S100-S900 in Embodiment 1 are executed.

[0071] S030, obtain the centroid position of the light spot of the CMOS image sensor according to the preset target pixel; the preset target pixel is a pixel in the CMOS image sensor whose column number belongs to the preset column number interval [1, J]; the method for obtaining I and J includes:

[0072] S031, Obtain the distance h between the sample object and the laser triangulation sensor. min The corresponding range of sample pixel column numbers [i] min,1 i min,2 ], i min,1 Let h be the distance between the sample object and the laser triangulation sensor. min The minimum number of columns of all pixels in a CMOS image sensor that satisfy the first preset condition, i min,2 Let h be the distance between the sample object and the laser triangulation sensor. min The maximum number of columns of all pixels in a CMOS image sensor that satisfy the first preset condition.

[0073] S032, Obtain the distance h between the sample object and the laser triangulation sensor. max The corresponding range of sample pixel column numbers [j] max,1 ,j max,2 ], j max,1 Let h be the distance between the sample object and the laser triangulation sensor. max j is the minimum number of columns of all pixels in a CMOS image sensor that satisfy the first preset condition. max,2Let h be the distance between the sample object and the laser triangulation sensor. max The maximum number of columns of all pixels in a CMOS image sensor that satisfy the first preset condition.

[0074] S033, obtain the preset column range [I,J], I = min(i min,1 ,j max,1 ), J = max(i min,2 ,j max,2 ).

[0075] In this embodiment, the distance between the object to be measured and the laser triangulation sensor falls within a preset distance range [h]. min ,h max In the case of […], the present invention directly obtains the centroid position of the CMOS image sensor spot based on the pixels whose column number belongs to the preset column number interval [I,J]. On the one hand, compared with all the pixels of the CMOS image sensor, the number of pixels whose column number belongs to the preset column number interval [I,J] is relatively small, so the present invention can reduce the computational load of the processor. On the other hand, compared with Embodiment 1, the method of directly obtaining the centroid position of the CMOS image sensor spot based on the pixels whose column number belongs to the preset column number interval [I,J] is simpler and more effective, and is more suitable for situations where the distance range between the object to be measured and the triangular laser sensor is known and falls within the preset distance interval [h…]. min ,h max The scene within ] .

[0076] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of the invention. It should also be understood that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.

Claims

1. A ranging device based on an image sensor with dynamically adjustable pixel area output, characterized in that, The ranging device includes: a laser emitter, a linear CMOS image sensor, a processor, and a memory; the memory stores computer-readable instructions, which, when executed by the processor, perform the following steps: S010, determine whether the distance between the object to be measured and the laser triangulation sensor belongs to the preset distance range [h] min ,h max ]; S020, if the judgment result is yes, then proceed to S030; S030, obtain the centroid position of the light spot of the linear CMOS image sensor according to the preset target pixel; the preset target pixel is a pixel in the linear CMOS image sensor whose column number belongs to the preset column number interval [1, J]; the method for obtaining I and J includes: S031, Obtain the distance h between the sample object and the laser triangulation sensor. min The corresponding range of sample pixel column numbers [i] min,1 i min,2 ], i min,1 Let h be the distance between the sample object and the laser triangulation sensor. min The minimum number of columns of all pixels in a linear CMOS image sensor that satisfy the first preset condition, i min,2 Let h be the distance between the sample object and the laser triangulation sensor. min The maximum number of columns of all pixels in a linear CMOS image sensor that satisfy the first preset condition; S032, Obtain the distance h between the sample object and the laser triangulation sensor. max The corresponding range of sample pixel column numbers [j] max,1 ,j max,2 ], j max,1 Let h be the distance between the sample object and the laser triangulation sensor. max The minimum number of columns of all pixels in a linear CMOS image sensor that satisfy the first preset condition, j max,2 Let h be the distance between the sample object and the laser triangulation sensor. max The maximum number of columns of all pixels in a linear CMOS image sensor that satisfy the first preset condition; S033, obtain the preset column range [I,J], I=min(i min,1 , j max,1 ), J=max(i min,2 , j max,2 ); S020 also includes: if the judgment result is that it does not belong, then proceed to S100; S100, obtain the direction of motion of the object under test; S200, if the direction of motion of the object under test is along the direction of the laser beam emitted by the laser emitter, then proceed to S300; S300, acquire the voltage data of the linear CMOS image sensor at the first sampling time, wherein the voltage data of the linear CMOS image sensor at the first sampling time includes the voltage of all pixels of the linear CMOS image sensor at the first sampling time. S400, based on the voltage data of the linear CMOS image sensor at the first sampling time, obtain the first target pixel column number interval [B,D], where B is the minimum value of the number of columns of all pixels in the linear CMOS image sensor at the first sampling time that meet the first preset condition, and D is the maximum value of the number of columns of all pixels in the linear CMOS image sensor at the first sampling time that meet the first preset condition. The first preset condition is that the corresponding voltage is greater than a preset voltage threshold. S500, obtain the monitoring pixel column number range [B-Δ] l ,D+Δ l ], Δ l For the preset column number threshold or Δ l =(DB) / n, where n is a positive integer greater than or equal to 2; S600, acquire voltage data of the linear CMOS image sensor at the second sampling time, the voltage data of the linear CMOS image sensor at the second sampling time includes the voltage of the first target pixel; the first target pixel is the pixel whose column number belongs to the monitoring pixel column number range [B-Δ] among all pixels of the linear CMOS image sensor at the second sampling time. l ,D+Δ l ] pixels; S700, based on the voltage data of the linear CMOS image sensor at the second sampling time, obtain the second target pixel column number interval [C, E], where C is the minimum value of the column number of all pixels in the first target pixel that satisfy the first preset condition, and E is the maximum value of the column number of all pixels in the first target pixel that satisfy the first preset condition; S800, update the monitoring pixel column number interval [B - Δ l , D + Δ l to [H, R]; when C > B and E > D, H = B - Δ l + S1, R = D + Δ l + S1; when C < B and E < D, H = B - Δ l - S1, R = D + Δ l - S1; S1 is the moving distance of the monitoring pixel column number interval at the second sampling moment compared to the first sampling moment, S1 = max(|C - B|, |E - D|); S900, the position of the spot centroid of the linear array CMOS image sensor at the second sampling time is obtained based on the position and voltage of the second target pixel. The position of the spot centroid is used to obtain the distance between the object under test and the laser triangulation range sensor. The second target pixel is the pixel in the linear array CMOS image sensor at the second sampling time whose column number belongs to the updated monitoring pixel column number interval [H,R].

2. The ranging device based on an image sensor with dynamically adjustable pixel area output according to claim 1, characterized in that, The voltage data of the linear CMOS image sensor at the first sampling time in S300 is U 1 U 1 =((u 1 1,1 ,u 1 1,2 ,…,u 1 1,m ,…,u 1 1,M ),(u 1 2,1 ,u 1 2,2 ,…,u 1 2,m ,…,u 1 2,M ),…,(u 1 n,1 ,u 1 n,2 ,…,u 1 n,m ,…,u 1 n,M ),…,(u 1 N,1 ,u 1 N,2 ,…,u 1 N,m ,…,u 1 N,M )); (u 1 n,1 ,u 1 n,2 ,…,u 1 n,m ,…,u 1 n,M ) represents the voltage of the nth pixel in the linear CMOS image sensor at the first sampling time, u 1 n,m S400 represents the voltage of the pixel in the nth row and mth column of the linear CMOS image sensor at the first sampling time. The value of n ranges from 1 to N, where N is the total number of rows of pixels in the linear CMOS image sensor, and the value of m ranges from 1 to M, where M is the total number of columns of pixels in the linear CMOS image sensor. S410, traversing U 1 , obtain (u 1 n,1 ,u 1 n,2 ,…,u 1 n,m ,…,u 1 n,M The corresponding first pixel column number range [ l n,1 , l n,2 ], l n,1 The minimum number of columns of all pixels in the nth row of the linear CMOS image sensor that satisfy the first preset condition at the first sampling time. l n,2 The maximum number of columns of all pixels in the nth row of the linear CMOS image sensor that satisfy the first preset condition at the first sampling time; S420, obtain the first target pixel column range [B,D], B=min( l 1,1 , l 2,1 ,…, l n,1 ,…, l N,1 ), D=max( l 1,2 , l 2,2 ,…, l n,2 ,…, l N,2 min() takes the minimum value, and max() takes the maximum value.

3. The ranging device based on an image sensor with dynamically adjustable pixel area output according to claim 1, characterized in that, The voltage data of the linear CMOS image sensor at the second sampling time in the S600 is U 2 U 2 =((u 2 1,B-Δl ,u 2 1,B-Δl+1 ,…,u 2 1,b ,…,u 2 1,D+Δl ),(u 2 2,B-Δl ,u 2 2,B-Δl+1 ,…,u 2 2,b ,…,u 2 2,D+Δl ),…,(u 2 n,B-Δl ,u 2 n,B-Δl+1 ,…,u 2 n,b ,…,u 2 n,D+Δl ),…,(u 2 N,B-Δl ,u 2 N,B-Δl+1 ,…,u 2 N,b ,…,u 2 N,D+Δl )); (u 2 n,B-Δl ,u 2 n,B-Δl+1 ,…,u 2 n,b ,…,u 2 n,D+Δl ) represents the voltage of the pixel in the second target column of the nth row of the linear CMOS image sensor at the second sampling time, u 2 n,b Let be the voltage of the pixel in the nth row and bth column of the linear CMOS image sensor at the second sampling time, where b ranges from B to Δ. l To D+Δ l The second target column is the B-Δth column. l Up to the D+Δth column l The S700 includes: S710, traversing U 2 , obtain (u 2 n,B-Δl ,u 2 n,B-Δl+1 ,…,u 2 n,b ,…,u 2 n,D+Δl The second pixel column range [f] corresponds to n,1 ,f n,2 ], f n,1 f is the minimum number of columns of all pixels in the second target column of the nth row of the linear CMOS image sensor that satisfy the first preset condition at the second sampling time. n,2 The maximum number of columns of all pixels in the second target column of the nth row of the linear CMOS image sensor that satisfy the first preset condition at the second sampling time. S720, obtain the second target pixel column number interval [C,E], C=min(f 1,1 ,f 2,1 ,…,f n,1 ,…,f N,1 ), E=max(f 1,2 ,f 2,2 ,…,f n,2 ,…,f N,2 ).

4. The ranging device based on an image sensor with dynamically adjustable pixel area output according to claim 1, characterized in that, In S500, when Δ l When =(DB) / n, the methods for obtaining n include: S510, set the first variable k=2; S520, obtain B-(DB) / k and D+(DB) / k; S530, if [B-(DB) / k]<0 or [D+(DB) / k]>M, then k=k+1, repeat S520 until [B-(DB) / k]≥0 and [D+(DB) / k]≤M; S540, obtain n as k.

5. The ranging device based on an image sensor with dynamically adjustable pixel area output according to claim 1, characterized in that, In S500, when Δ l When the preset column number threshold is met, 5 ≤ Δ l ≤10.

6. The ranging device based on an image sensor with dynamically adjustable pixel area output according to claim 1, characterized in that, The time difference between the second sampling moment and the first sampling moment is one sampling cycle of the linear CMOS image sensor.

7. The ranging device based on an image sensor with dynamically adjustable pixel area output according to claim 1, characterized in that, When the computer-readable instructions are executed by the processor, the following steps are also performed: S1000, acquire the voltage U of the linear CMOS image sensor at the third sampling time. 3 =((u 3 1,H ,u 3 1,H+1 ,…,u 3 1,r ,…,u 3 1,R ),(u 3 2,H ,u 3 2,H+1 ,…,u 3 2,r ,…,u 3 2,R ),…,(u 3 n,H ,u 3 n,H+1 ,…,u 3 n,r ,…,u 3 n,R ),…,(u 3 N,H ,u 3 N,H+1 ,…,u 3 N,r ,…,u 3 N,R )); (u 3 n,H ,u 3 n,H+1 ,…,u 3 n,r ,…,u 3 n,R Let u be the voltage of the pixel in the third target column of the nth row of the linear CMOS image sensor at the third sampling time. 3 n,r The voltage of the pixel in the nth row and rth column of the linear CMOS image sensor at the third sampling time is given, where r ranges from H to R; the third target column is from the Hth column to the Rth column. S1100, traversing U 3 , obtain (u 3 n,H ,u 3 n,H+1 ,…,u 3 n,r ,…,u 3 n,R The corresponding third pixel column range [p] n,1 ,p n,2 ], p n,1 p is the minimum number of columns of all pixels in the third target column of the nth row of the linear CMOS image sensor that satisfy the first preset condition at the third sampling time. n,2 The maximum number of columns of all pixels in the third target column of the nth row of the linear CMOS image sensor that satisfy the first preset condition at the third sampling time. S1200, obtain the third target pixel column number interval [G,Q], G=min(p 1,1 ,p 2,1 ,…,p n,1 ,…,p N,1 ), Q=max(p 1,2 ,p 2,2 ,…,p n,2 ,…,p N,2 ); S1300, update the updated monitored pixel column number range [H, R] to [V, W]; when G > C and Q > E, V = H + S2, W = R + S2; when G < C and Q < E, V = H - S2, W = R - S2; S2 is the moving distance of the monitored pixel column number range at the third sampling moment compared to the second sampling moment, S2 = max(|G - C|, |Q - E|). S1400, obtain the position of the light spot centroid of the linear array CMOS image sensor at the third sampling moment according to the position and voltage of the third target pixel; the third target pixel is the pixel whose column number belongs to the updated monitored pixel column number range [V, W] among the pixels of the linear array CMOS image sensor at the third sampling moment.

8. The ranging device based on an image sensor with dynamically adjustable pixel area output according to claim 7, characterized in that, The time difference between the third sampling moment and the second sampling moment is one sampling period of the linear array CMOS image sensor.

9. The ranging device based on an image sensor with dynamically adjustable pixel area output according to claim 1, characterized in that, In S100, obtain the motion direction of the object to be measured through the motion direction information of the object to be measured input by the user.