Ranging methods, devices, sensors and computer-readable storage media

By acquiring calibration points in the target image and calculating the object spacing using the optical parameters of the image acquisition device, combined with infrared verification, the problem of time-consuming and labor-intensive manual measurement of object spacing is solved, realizing automated and efficient object spacing measurement.

CN115683046BActive Publication Date: 2025-10-31SHENZHEN CHEVEN TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211125527.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-14
Publication Date
2025-10-31
Estimated Expiration
2042-09-14

AI Technical Summary

Technical Problem

In existing technologies, manually measuring the distance between objects is time-consuming and labor-intensive, and infrared or ultrasonic sensors increase costs and space requirements.

Method used

By acquiring the calibration points of the first and second targets in the target image, the distance between the objects is calculated using the optical parameters and angle of the image acquisition device, and then verified by an infrared ranging device to automatically measure the distance between the objects.

Benefits of technology

It enables automated measurement of object spacing, improves measurement efficiency, reduces human error and cost, and simplifies the measurement process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115683046B_ABST
    Figure CN115683046B_ABST
Patent Text Reader

Abstract

This application discloses a ranging method, apparatus, ranging sensor, and computer-readable storage medium, specifically relating to the field of ranging technology. The ranging method includes: acquiring a calibration point of a first target and a calibration point of a second target in a target image; calculating a first distance between the calibration point of the first target and an image acquisition device acquiring the target image, and a second distance between the calibration point of the second target and the image acquisition device acquiring the target image; and determining the distance between the calibration points of the first target and the second target based on the first distance, the second distance, and the angle between the image acquisition direction of the image acquisition device acquiring the target image and the target image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of ranging technology, specifically to ranging methods, devices, sensors, and computer-readable storage media. Background Technology

[0002] In daily life, we often encounter situations where we need to measure the distance between objects. For example, security personnel require people to maintain a 1-meter distance while queuing; or, to match the assembly speed on a production line, components are placed at predetermined intervals during equipment assembly. However, in current technology, this distance is mostly measured manually, which is both time-consuming and labor-intensive. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a ranging method, apparatus, ranging sensor, and computer-readable storage medium to solve the problem of time-consuming and laborious manual measurement of object distances.

[0004] According to a first aspect, embodiments of the present invention provide a ranging method, the ranging method comprising:

[0005] Obtain the calibration points of the first target and the second target in the target image;

[0006] Calculate the first distance between the calibration point of the first target and the image acquisition device for acquiring the target image, and the second distance between the calibration point of the second target and the image acquisition device for acquiring the target image;

[0007] Based on the first distance, the second distance, and the angle between the image acquisition direction of the image acquisition device and the target image, the distance between the calibration point of the first target and the calibration point of the second target is determined.

[0008] Optionally, calculating the first distance between the calibration point of the first target and the image acquisition device for acquiring the target image, and the second distance between the calibration point of the second target and the image acquisition device for acquiring the target image, further includes:

[0009] The optical parameters of the image acquisition device, the circle of confusion diameter of the calibration point of the first target, the image distance of the calibration point of the first target, and the image distance of the calibration point of the second target are obtained. The optical parameters include aperture value and focal length value.

[0010] The first distance is obtained based on the optical parameters, the diameter of the circle of confusion of the calibration point of the first target, and the image distance of the calibration point of the first target;

[0011] The second distance is obtained based on the optical parameters and the image distance of the calibration point of the second target.

[0012] Optionally, the optical parameters include the aperture and focal length of the image acquisition device. The formula for calculating the first distance based on the optical parameters, the diameter of the circle of confusion of the calibration point of the first target, and the image distance of the calibration point of the first target is expressed as:

[0013] Wherein, S1 represents the first distance, r represents the diameter of the circle of confusion of the calibration point of the first target, F is the aperture value of the image acquisition device, V1 is the image distance of the calibration point of the first target, and f is the focal length value of the image acquisition device.

[0014] Optionally, the optical parameters include the aperture and focal length of the image acquisition device, and the formula for calculating the second distance based on the optical parameters and the image distance of the calibration point of the second target is expressed as:

[0015] Where S2 represents the second distance, V2 is the image distance of the calibration point of the second target, and f is the focal length of the image acquisition device.

[0016] Optionally, obtaining the diameter of the circle of dispersion at the calibration point of the first target includes:

[0017] Determine the pixels and number of pixels in the image acquisition unit that the calibration point of the first target is mapped to;

[0018] The diameter of the dispersion circle of the calibration point of the first target is determined based on the number of pixels, the number of pixels, and the gap between each pixel.

[0019] Optionally, before the second distance of the image acquisition device acquiring the target image, the method further includes:

[0020] Determine whether the first target and the second target overlap;

[0021] If the first target overlaps with the second target, the calibration points of the first target and the second target in the target image are reacquired after a preset time.

[0022] If the first target and the second target do not overlap, then calculate the first distance and the second distance.

[0023] Optionally, the formula for determining the distance between the calibration point of the first target and the calibration point of the second target can be expressed as:

[0024] Wherein, S2 is the second distance, S1 is the first distance, and α is the horizontal angle between the image acquisition direction of the image acquisition device and the target image.

[0025] According to a second aspect, embodiments of this application provide a ranging device, including:

[0026] The acquisition module is used to acquire the calibration points of the first target and the second target in the target image;

[0027] The calculation module is used to calculate the first distance between the calibration point of the first target and the image acquisition device for acquiring the target image, and the second distance between the calibration point of the second target and the image acquisition device for acquiring the target image, wherein the first target and the second target do not overlap;

[0028] The determination module is used to determine the distance between the calibration point of the first target and the calibration point of the second target based on the first distance, the second distance, and the angle between the image acquisition direction of the image acquisition device acquiring the target image and the target image.

[0029] According to a third aspect, embodiments of the present invention provide a ranging sensor, including: an image acquisition unit, a memory, and a processor, wherein the image acquisition unit is connected to the processor, the processor and the memory are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the ranging method described in the first aspect or any embodiment of the first aspect.

[0030] According to a third aspect, embodiments of the present invention provide a computer-readable storage medium storing computer instructions for causing the computer to perform the ranging method described in the first aspect or any embodiment of the first aspect.

[0031] Compared with the prior art, this application has the following beneficial effects:

[0032] By acquiring the calibration points of the first target and the second target in the target image, and determining the first distance and the second distance based on these calibration points, the distance between the calibration points of the first target and the second target is calculated using the first distance, the second distance, and the angle between the first distance and the second distance in the target image. Therefore, by identifying the distance between the calibration points of the first target and the second target in the target image, the distance between the first target and the second target can be determined. This method can automatically measure the distance between the first target and the second target, thereby improving measurement efficiency. Attached Figure Description

[0033] The features and advantages of the invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the invention in any way. In the drawings:

[0034] Figure 1 A flowchart of the ranging method provided in the embodiments of this application;

[0035] Figure 2 A flowchart of steps S21 to S23 of the ranging method provided in the embodiments of this application;

[0036] Figure 3 A flowchart of steps S221 to S222 of the ranging method provided in the embodiments of this application;

[0037] Figure 4 Flowcharts of steps S41 to S42 of the ranging method provided in the embodiments of this application;

[0038] Figure 5 This is a structural block diagram of the ranging device provided in the embodiments of this application;

[0039] Figure 6 This is a structural block diagram of the sensor provided in an embodiment of this application.

[0040] Figure label:

[0041] 1-Acquisition module; 2-Calculation module; 3-Determination module; 4-Image acquisition unit; 51-Processor; 52-Memory. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.

[0043] To address the problems of existing technologies where manually measuring object spacing is time-consuming and labor-intensive, and the measurement results are limited by manual measurement data; and to address the issues of existing technologies where ultrasonic or infrared sensors can be used to measure object spacing to obtain better measurement results, but setting up ultrasonic or infrared sensors increases costs and occupies space.

[0044] This application provides a ranging method, such as... Figure 1The diagram shows a flowchart of a ranging method provided in an embodiment of this application. Furthermore, the ranging method of this application embodiment can be applied to ranging devices, sensors, and ranging systems. The corresponding hardware for implementing this ranging method may include: an image acquisition device, such as a camera, and a controller, such as a control circuit built from an AMR chip. Specifically, the ranging method includes the following steps:

[0045] S1, Obtain the calibration points of the first target and the second target in the target image.

[0046] In this embodiment, an image acquisition device can be used to acquire a target image of the target scene, such as a scene of pedestrians queuing or objects arranged in a line. The target image includes a first target and a second target, both of which can be people or objects. After determining the first and second targets, calibration points can be determined using calibration software or by running a calibration algorithm. Optionally, the calibration points can be the center point or the boundary point of the first target. In this embodiment, determining the calibration points determines the distance between the first and second targets. Therefore, to obtain an accurate distance between the first and second targets, the calibration points of both targets are located at the same position. For example, when measuring the distance between objects, if the center point of the first target is used as the calibration point, the center point of the second target should also be used as the calibration point.

[0047] Specifically, the calibration points of the first target and the second target in the target image can be obtained through marking software, or a rectangular coordinate system can be established based on the target image, and the coordinates of the calibration points of the first target and the second target in the rectangular coordinate system can be output.

[0048] S2, calculate the first distance between the calibration point of the first target and the image acquisition device for acquiring the target image, and the second distance between the calibration point of the second target and the image acquisition device for acquiring the target image.

[0049] In this embodiment, the first distance and the second distance can be determined using the image acquisition device's own hardware parameters (such as lens aperture value) and the sharpness corresponding to the first and second calibration points. For example, based on the focal length of the image acquisition device and using the first calibration point as the focusing reference (highest sharpness), the sharpness of the second calibration point is relatively weaker than that of the first calibration point. In this case, the first distance can be calculated based on the focal length of the image acquisition device and the first calibration point, and then the second distance can be determined based on the sharpness. Another example: when the distance to the first calibration point is 2 meters, the percentage of sharpness of the second calibration point relative to the first calibration point is obtained, such as 90%. Then, based on the percentage of sharpness, the distance to the second calibration point is calculated to be 1.8 meters.

[0050] S3, based on the first distance, the second distance, and the angle between the image acquisition direction of the image acquisition device and the target image, determine the distance between the calibration point of the first target and the calibration point of the second target.

[0051] The ranging method provided in this application obtains the calibration points of a first target and a second target in a target image, determines a first distance and a second distance based on the calibration points of the first target and the second target, and calculates the distance between the calibration points of the first target and the second target using the first distance, the second distance, and the angle between the first distance and the second distance in the target image. It can be seen that by identifying the distance between the calibration points of the first target and the second target in the target image, the distance between the first target and the second target can be determined. This method can automatically measure the distance between the first target and the second target, thereby improving the measurement efficiency.

[0052] To facilitate understanding, we will use pedestrian queues as an example. When it is necessary to detect the spacing between pedestrians in a queue, cameras positioned above or to the sides of the queue will capture target images of the queue. Next, the first and second target pedestrians are extracted from the target images, and the center points of the first and second target pedestrian images are calibrated to obtain calibration points for the first and second targets. Then, the camera's hardware parameters are acquired. Based on these parameters, and using the calibration points of the first and second targets, the first and second distances are calculated. The distance between the calibration points of the first and second targets is determined using the angle between the image acquisition direction of the image acquisition device and the target image; this distance is the distance between the pedestrians. Finally, the distance value can be used to determine whether the arrangement of the pedestrians meets the requirements. In this example, the distance between pedestrians can be obtained simply by acquiring the target images, thus avoiding data errors caused by manual measurement, reducing measurement costs, and improving measurement efficiency.

[0053] In this embodiment, to ensure the accuracy of the first and second distances, an infrared ranging device can be installed on the image acquisition unit. After calculating the first and second distances, to ensure the accuracy of the measurement data, the data measured by the infrared ranging device can be compared. The distance between the calibration point of the first target and the calibration point of the second target is calculated only when the infrared measurement data is the same as the calculated first and second distance values ​​and is within a preset error range. The preset error range is ±1%.

[0054] like Figure 2As shown, the ranging method provided in this application embodiment, in addition to steps S1 to S4 proposed in the above embodiments, also includes the following in step S2:

[0055] S21, acquire the optical parameters of the image acquisition device, the diameter of the circle of confusion of the calibration point of the first target, the image distance of the calibration point of the first target, and the image distance of the calibration point of the second target.

[0056] In this embodiment, the optical parameters include the aperture and focal length of the image acquisition device. Based on the optical parameters, the diameter of the circle of confusion of the calibration point of the first target, and the image distance of the calibration point of the first target, the formula for calculating the first distance is expressed as follows:

[0057] ;

[0058] Where S1 represents the first distance, r represents the diameter of the circle of confusion of the calibration point of the first target, F is the aperture value of the image acquisition device, V1 is the image distance of the calibration point of the first target, and f is the focal length value of the image acquisition device.

[0059] Optionally, the optical parameters include the aperture and focal length of the image acquisition device. Based on the optical parameters and the image distance of the calibration point of the second target, the formula for calculating the second distance is expressed as follows:

[0060] ;

[0061] Where S2 represents the second distance, V2 is the image distance of the calibration point of the second target, and f is the focal length of the image acquisition device.

[0062] S22, based on the optical parameters, the diameter of the circle of confusion of the calibration point of the first target, and the image distance of the calibration point of the first target, the first distance is obtained.

[0063] S23, based on the optical parameters and the image distance of the calibration point of the second target, obtain the second distance.

[0064] In this embodiment, the formula for determining the distance between the calibration points of the first target and the second target can be expressed as:

[0065] ;

[0066] Where S2 is the second distance, S1 is the first distance, and α is the horizontal angle between the image acquisition direction of the image acquisition device and the target image.

[0067] like Figure 3 As shown, the ranging method provided in this application embodiment further includes step S22 as follows:

[0068] S221, determine the pixels and number of pixels in the image acquisition unit that the calibration point of the first target is mapped to.

[0069] In this embodiment, the pixels in the image acquisition device can be understood as squares on the image sensor of the image acquisition device. The number of pixels is used to represent the calibration point of the first target. Optionally, the calibration point can be composed of one or more pixels.

[0070] S222, determine the diameter of the dispersion circle of the calibration point of the first target based on the number of pixels, the number of pixels, and the gap between each pixel.

[0071] like Figure 4 As shown, the ranging method provided in this application embodiment further includes the following steps before performing step S3:

[0072] S41, Determine whether the first target and the second target overlap;

[0073] S42, If the first target and the second target overlap, wait for a preset time and then reacquire the calibration points of the first target and the second target in the target image.

[0074] In this embodiment, the preset duration can be determined by the user. The purpose of setting the preset duration is to make a secondary judgment to further confirm whether the first target and the second target overlap.

[0075] Optionally, if the calibration points of the first target and the second target still overlap in the target image after waiting for a preset time, the distance between the first target and the second target can be output as 0.

[0076] S43, If the first target and the second target do not overlap, then calculate the first distance and the second distance.

[0077] The ranging method provided in this embodiment, in order to detect the distance between the first target and the second target and improve ranging efficiency, does not require performing other actions when the first target and the second target overlap.

[0078] Furthermore, it should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0079] Accordingly, embodiments of this application also provide a ranging device, such as... Figure 5 As shown, the ranging device includes:

[0080] Acquisition module 1 is used to acquire the calibration points of the first target and the second target in the target image. For details, please refer to step S1.

[0081] The calculation module 2 is used to calculate the first distance between the calibration point of the first target and the camera that acquires the target image, and the second distance between the calibration point of the second target and the camera that acquires the target image. The first target and the second target do not overlap. For details, please refer to step S2.

[0082] The determining module 3 is used to determine the distance between the calibration point of the first target and the calibration point of the second target based on the first distance, the second distance, and the angle between the image acquisition direction of the camera acquiring the target image and the target image. For details, please refer to step S3.

[0083] The ranging device provided in this application embodiment acquires the calibration points of a first target and a second target in a target image through an acquisition module 1. A calculation module 2 determines a first distance and a second distance based on the calibration points of the first and second targets. A determination module 3 obtains the first distance, the second distance, and the angle between the first and second distances in the target image, and calculates the distance between the calibration points of the first and second targets. Therefore, the acquisition module 1 and calculation module 2 identify the distance between the calibration points of the first and second targets in the target image, and the determination module 3 determines the distance between the first and second targets. This device can automatically measure the distance between the first and second targets, thereby improving measurement efficiency.

[0084] This invention also provides a ranging sensor, such as... Figure 6 As shown, the ranging sensor may include a processor 51, a memory 52, and an image acquisition unit 53, wherein the image acquisition unit 53 is connected to the processor 51, and the processor 51 and the memory 52 can be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.

[0085] The image acquisition device 53 can be a camera or other image recording device.

[0086] Processor 51 can be a central processing unit (CPU). Processor 51 can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.

[0087] Memory 52, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the ranging method in this embodiment of the invention (e.g., Figure 5 The acquisition module 1, calculation module 2, and determination module 3 are shown. The processor 51 executes various functional applications and data processing by running non-transitory software programs, instructions, and modules stored in the memory 52, thereby implementing the ranging method in the above method embodiment.

[0088] The memory 52 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor 51, etc. Furthermore, the memory 52 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 52 may optionally include memory remotely located relative to the processor 51, and these remote memories may be connected to the processor 51 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0089] The one or more modules are stored in the memory 52, and when executed by the processor 51, they perform the following: Figure 1-4 The ranging method in the illustrated embodiment.

[0090] For specific details regarding the aforementioned ranging sensors, please refer to the relevant documentation. Figures 1 to 4 The relevant descriptions and effects in the illustrated embodiments are for understanding purposes only and will not be repeated here.

[0091] 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. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.

[0092] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A distance measurement method, characterized in that, The ranging method includes: Obtain the calibration points of the first target and the second target in the target image; Calculating the first distance between the calibration point of the first target and the image acquisition device acquiring the target image, and the second distance between the calibration point of the second target and the image acquisition device acquiring the target image, includes: acquiring the optical parameters of the image acquisition device, the circle of confusion diameter of the calibration point of the first target, the image distance of the calibration point of the first target, and the image distance of the calibration point of the second target. The optical parameters include aperture value and focal length value. Based on the optical parameters, the circle of confusion diameter of the calibration point of the first target, and the image distance of the calibration point of the first target, the first distance is obtained. Based on the optical parameters and the image distance of the calibration point of the second target, the second distance is obtained. Acquiring the circle of confusion diameter of the calibration point of the first target includes: determining the number of pixels and the number of pixels that the calibration point of the first target maps to in the image acquisition device; and determining the circle of confusion diameter of the calibration point of the first target based on the number of pixels, the number of pixels, and the gap between the pixels. Based on the first distance, the second distance, and the angle between the image acquisition direction of the image acquisition device and the target image, the distance between the calibration point of the first target and the calibration point of the second target is determined.

2. The ranging method according to claim 1, characterized in that, The optical parameters include the aperture and focal length of the image acquisition device. The formula for calculating the first distance based on the optical parameters, the diameter of the circle of confusion of the calibration point of the first target, and the image distance of the calibration point of the first target is expressed as follows: Wherein, S1 represents the first distance, d represents the diameter of the circle of confusion of the calibration point of the first target, F is the aperture value of the image acquisition device, V1 is the image distance of the calibration point of the first target, and f is the focal length value of the image acquisition device.

3. The ranging method according to claim 1, characterized in that, The optical parameters include the aperture and focal length of the image acquisition device. The formula for calculating the second distance based on the optical parameters and the image distance of the calibration point of the second target is expressed as follows: Where S2 represents the second distance, V2 is the image distance of the calibration point of the second target, and f is the focal length of the image acquisition device.

4. The ranging method according to claim 1, characterized in that, Before the second distance of the image acquisition device for acquiring the target image, the following is also included: Determine whether the first target and the second target overlap; If the first target overlaps with the second target, the calibration points of the first target and the second target in the target image are reacquired after a preset time. If the first target and the second target do not overlap, then calculate the first distance and the second distance.

5. The ranging method according to claim 1, characterized in that, The formula for determining the distance between the calibration point of the first target and the calibration point of the second target can be expressed as: Wherein, S2 is the second distance, S1 is the first distance, and α is the horizontal angle between the image acquisition direction of the image acquisition device and the target image.

6. A ranging device, characterized in that, include: The acquisition module is used to acquire the calibration points of the first target and the second target in the target image; The calculation module is used to calculate the first distance between the calibration point of the first target and the image acquisition device for acquiring the target image, and the second distance between the calibration point of the second target and the image acquisition device for acquiring the target image, wherein the first target and the second target do not overlap; The determination module is used to determine the distance between the calibration point of the first target and the calibration point of the second target based on the first distance, the second distance, and the angle between the image acquisition direction of the image acquisition device acquiring the target image and the target image.

7. A ranging sensor, characterized in that, include: An image acquisition device, a memory, and a processor are provided, wherein the image acquisition device is connected to the processor, the processor and the memory are communicatively connected to each other, the memory stores computer instructions, and the processor executes the ranging method according to any one of claims 1-5 by executing the computer instructions.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the ranging method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Ranging method and device

    CN109443305A