Image generation method, apparatus, device, and computer-readable storage medium

By constructing a model to calculate the corrected optical length of pixels in DTOF ranging technology, the image curvature problem in DTOF ranging technology is solved, and the detection accuracy is improved.

CN115546081BActive Publication Date: 2026-02-27SHENZHEN ANSIJIANG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211023654.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-24
Publication Date
2026-02-27
Estimated Expiration
2042-08-24

AI Technical Summary

Technical Problem

In DTOF ranging technology, the measurement results are prone to a curved phenomenon with a bulge in the middle, which leads to inaccurate detection results.

Method used

By constructing a first model, determining the calculation parameters of each pixel, and using formulas such as the arctangent function and the Pythagorean theorem to calculate the corrected optical length, a corrected image is generated.

Benefits of technology

This solves the problem of the convex curvature in the middle of the initial image, improving the accuracy of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115546081B_ABST
    Figure CN115546081B_ABST
Patent Text Reader

Abstract

The application discloses an image generation method, device and equipment and a computer readable storage medium, and belongs to the technical field of optical imaging. The method comprises the following steps: acquiring the positions of all pixel points, the flight times of all pixel points, the position of an optical center and a focal length; in a first model, determining the calculation parameters corresponding to all pixel points according to the positions of all pixel points, the position of the optical center and the focal length; determining the measured optical lengths corresponding to all pixel points according to the flight times of all pixel points; in a second model, determining the corrected optical lengths corresponding to all pixel points according to the calculation parameters corresponding to all pixel points and the measured optical lengths corresponding to all pixel points; and generating a corrected image according to the corrected optical lengths corresponding to all pixel points. The application corrects the measured optical lengths to obtain corresponding corrected optical lengths, and generates a corrected image according to the corrected optical lengths, aiming to improve the accuracy of detection results.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of optical imaging, in particular to an image generation method, device, equipment and computer readable storage medium. BACKGROUND

[0002] TOF, full name Time of Flight, English for time of flight, TOF technology can be used to measure the distance of objects in the scene, which is divided into DTOF (Direct TOF) and ITOF (Indirect TOF) two categories. DTOF, English for direct measurement of time of flight, as the name implies, directly measures the time of flight of light pulses in space. ITOF, English for indirect measurement of time of flight, indirect refers to the phase shift between reflected light and emitted light, and the time of flight of the two is indirectly obtained.

[0003] DTOF ranging technology mainly uses a light source to emit a signal with certain characteristics, which propagates in space, is reflected by the target and returns to the receiving device. The propagation time of the signal can be directly measured by a time measurement unit, and the distance of the target can be measured according to the speed of light and the propagation time.

[0004] Since the measured time is in the order of picoseconds, small changes in time will cause large distance errors, and the reflection of light will cause the receiving time of the center position of the image sensor to be the shortest and the receiving time of the edge position to be longer, resulting in a curved phenomenon of the measurement result.

[0005] The above content is only used to assist in understanding the technical solutions of the present application, and does not represent the acknowledgement of the above content as prior art. SUMMARY

[0006] The main purpose of the present application is to provide an image generation method, device, equipment and computer readable storage medium, which aims to solve the technical problem of the curved phenomenon of the measurement result.

[0007] To achieve the above purpose, the present application provides an image generation method, which comprises the following steps:

[0008] Obtaining the position of each pixel point, the time of flight of each pixel point, the position of the optical center and the focal length, the optical center and the focal length are located on the imaging plane, the focal length is the distance between the lens center and the optical center, and the position of each pixel point, the position of the optical center and the focal length construct a first model;

[0009] According to the position of each pixel point, the position of the optical center and the focal length in the first model, the calculation parameters corresponding to each pixel point are determined;

[0010] According to the time of flight of each pixel point, a measured light length corresponding to each pixel point is determined;

[0011] According to the calculation parameter corresponding to each pixel point and the measured light length corresponding to each pixel point, a corrected light length corresponding to each pixel point is determined, and the calculation parameter corresponding to each pixel point, the measured light length corresponding to each pixel point and the corrected light length corresponding to each pixel point constitute a second model corresponding to the first model;

[0012] According to the corrected light length corresponding to each pixel point, a corrected image is generated.

[0013] Optionally, the step of determining the calculation parameter corresponding to each pixel point according to the position of each pixel point, the position of the optical center and the focal length in the first model comprises:

[0014] According to the position of each pixel point in the first model, a coordinate of each pixel point is determined;

[0015] According to the position of the optical center in the first model, a coordinate of the optical center is determined;

[0016] According to the coordinate of each pixel point and the coordinate of the optical center, a distance between each pixel point and the optical center is determined;

[0017] According to the distance between each pixel point and the optical center and the focal length, the calculation parameter corresponding to each pixel point is determined.

[0018] Optionally, the calculation parameter corresponding to each pixel point comprises an angle value corresponding to each pixel point, and the step of determining the calculation parameter corresponding to each pixel point according to the distance between each pixel point and the optical center and the focal length comprises:

[0019] According to the distance between each pixel point and the optical center and the focal length, an angle value corresponding to each pixel point is obtained by using an inverse tangent function formula: α = costan -1 (m / f), wherein α is the angle value corresponding to each pixel point, m is the distance between each pixel point and the optical center, and f is the focal length.

[0020] Optionally, the calculation parameter corresponding to each pixel point comprises an angle value corresponding to each pixel point, and the step of determining the corrected light length corresponding to each pixel point according to the calculation parameter corresponding to each pixel point and the measured light length corresponding to each pixel point comprises:

[0021] According to the angle value corresponding to each pixel point and the measured light length corresponding to each pixel point, a corrected light length corresponding to each pixel point is obtained by using a sine function formula: h = d × sin α, wherein h is the corrected light length corresponding to each pixel point, d is the measured light length corresponding to each pixel point, and α is the angle value corresponding to each pixel point.

[0022] Optionally, the calculation parameter corresponding to each pixel point comprises an angle value corresponding to each pixel point, and the step of determining the calculation parameter corresponding to each pixel point according to the distance between each pixel point and the optical center and the focal length comprises:

[0023] According to the distance between each pixel point and the optical center and the focal length, the angle value corresponding to each pixel point is obtained by using an inverse tangent function formula: β = costan -1 (f / m), wherein β is the angle value corresponding to each pixel point, m is the distance between each pixel point and the optical center, and f is the focal length.

[0024] Optionally, the calculation parameter corresponding to each pixel point comprises an angle value corresponding to each pixel point, and the step of determining the correction optical length corresponding to each pixel point according to the calculation parameter corresponding to each pixel point and the measured optical length corresponding to each pixel point comprises:

[0025] According to the angle value corresponding to each pixel point and the measured optical length corresponding to each pixel point, the correction optical length corresponding to each pixel point is obtained by using a cosine function formula: h = d x cosβ, wherein h is the correction optical length corresponding to each pixel point, d is the measured optical length corresponding to each pixel point, and β is the angle value corresponding to each pixel point.

[0026] Optionally, the calculation parameter corresponding to each pixel point comprises the distance between each pixel point and the center of the lens, and the step of determining the calculation parameter corresponding to each pixel point according to the distance between each pixel point and the optical center and the focal length comprises:

[0027] According to the distance between each pixel point and the optical center and the focal length, the distance between each pixel point and the center of the lens is obtained by using a Pythagorean theorem formula: wherein n is the distance between each pixel point and the center of the lens, m is the distance between each pixel point and the optical center, and f is the focal length.

[0028] The step of determining the correction optical length corresponding to each pixel point according to the calculation parameter corresponding to each pixel point and the measured optical length corresponding to each pixel point comprises:

[0029] According to the distance between each pixel point and the center of the lens and the measured optical length corresponding to each pixel point, the correction optical length corresponding to each pixel point is obtained by using a side length ratio formula: h = f x d / n, wherein h is the correction optical length corresponding to each pixel point, f is the focal length, d is the measured optical length corresponding to each pixel point, and n is the distance between each pixel point and the center of the lens.

[0030] In addition, to achieve the above object, the present application also provides an image generation device, which comprises:

[0031] An acquisition module is configured to acquire the positions of the pixel points, the time of flight of the pixel points, the position of the optical center and the focal length, wherein the pixel points and the optical center are located on an imaging plane, and the focal length is the distance between the lens center and the optical center;

[0032] A calculation module is configured to determine the calculation parameters corresponding to the pixel points according to the positions of the pixel points, the position of the optical center and the focal length in the first model;

[0033] The calculation module is further configured to determine the measured optical lengths corresponding to the pixel points according to the time of flight of the pixel points;

[0034] The calculation module is further configured to determine the corrected optical lengths corresponding to the pixel points according to the calculation parameters corresponding to the pixel points and the measured optical lengths corresponding to the pixel points, wherein the calculation parameters corresponding to the pixel points, the measured optical lengths corresponding to the pixel points and the corrected optical lengths corresponding to the pixel points constitute a second model corresponding to the first model;

[0035] An image generation module is configured to generate a corrected image according to the corrected optical lengths corresponding to the pixel points.

[0036] In addition, to achieve the above object, the present application also provides an image generation device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the image generation method.

[0037] In addition, to achieve the above object, the present application also provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program is executable on a processor to implement the steps of the image generation method.

[0038] In a technical solution provided by the present application, after the positions of the pixels in the storage, the time of flight of each pixel, the position of the optical center and the focal length are obtained, first, in the first model, the calculation parameters corresponding to each pixel are determined based on the positions of the pixels, the position of the optical center and the focal length; secondly, the measured optical lengths corresponding to the time of flight of each pixel are calculated; thirdly, in the second model, the corrected optical lengths corresponding to each pixel are determined according to the calculation parameters corresponding to each pixel and the measured optical lengths corresponding to each pixel; and finally, the corrected image is generated according to the corrected optical lengths corresponding to each pixel. Compared with directly generating the initial image based on the measured optical lengths, the technical solution provided by the present application can solve the problem of the convexity in the middle of the initial image by constructing two models, obtaining the calculation parameters of each pixel in the first model, and determining the corrected optical lengths in the second model. Thus, the calculation can convert the measured optical lengths with large edges into the corrected optical lengths corresponding to the optical center, so that the curvature of the convexity in the middle of the initial image is solved, and accordingly, the fluctuation of adjacent pixels is obviously reduced, so that the accuracy of the detection result can be improved. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1 is a structural schematic diagram of an image generation device of a hardware running environment related to an embodiment scheme of the present application;

[0040] Figure 2 is a flowchart of a first embodiment of the image generation method of the present application;

[0041] Figure 3 is an application scenario diagram of the first embodiment of the image generation method of the present application;

[0042] Figure 4 is an application scenario diagram of the first embodiment of the image generation method of the present application;

[0043] Figure 5 is an initial image of the first embodiment of the image generation method of the present application;

[0044] Figure 6 is an image after correction of the initial image of the first embodiment of the image generation method of the present application;

[0045] Figure 7 is a flowchart of a second embodiment of the image generation method of the present application;

[0046] Figure 8 is a functional module schematic diagram of an embodiment of the image generation device of the present application.

[0047] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are merely illustrative of the present application and do not limit the present application.

[0049] Referring to Figure 1 , Figure 1 The image generation device structure schematic diagram of the hardware running environment involved in the embodiment of the present application is shown in the figure.

[0050] As Figure 1 shown, the image generation device can include a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 can include a display screen, an input unit such as a keyboard, and an optional user interface 1003 can also include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 can be a high-speed random access memory (RAM) memory, or a stable non-volatile memory (NVM), such as a magnetic disk memory. The memory 1005 can also be an independent storage device from the aforementioned processor 1001.

[0051] Those skilled in the art can understand that Figure 1 the structure shown in the figure does not constitute a limitation on the image generation device, and can include more or fewer components than the figure, or combine certain components, or different component arrangements.

[0052] As Figure 1 shown, the memory 1005 as a storage medium can include an operating system, a data storage module, a network communication module, a user interface module, and a computer program.

[0053] In Figure 1 the image generation device shown in the figure, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the image generation device of the present application can be arranged in the image generation device, and the image generation device calls the computer program stored in the memory 1005 through the processor 1001, and executes the image generation method provided by the embodiment of the present application.

[0054] The embodiment of the present application provides an image generation method, referring to Figure 2 ,Figure 2 A flowchart of a first embodiment of an image generation method of the present application.

[0055] In this embodiment, the image generation method comprises:

[0056] Step S11: Obtain the position of each pixel point, the time of flight of each pixel point, the position of the optical center, and the focal length, wherein the each pixel point and the optical center are located on the imaging plane, the focal length is the distance between the lens center and the optical center, and the position of each pixel point, the position of the optical center, and the focal length construct a first model.

[0057] Based on the DTOF ranging principle, the ranging system is composed of a light source emitter and an image sensor. The light source emitter emits a signal with certain characteristics, such as a light signal modulated by a pulse, and then the signal propagates in space. After being reflected by the target, the signal returns to the image sensor. The time of signal propagation can be directly measured by a time measurement unit, and combined with the speed of light, the distance of the target can be calculated.

[0058] The image sensor is a device that converts an optical image into an electronic signal, which is widely used in digital cameras and other electronic optical devices. In this embodiment, the image sensor can use a CMOS image sensor or a CCD image sensor, which is not limited here. Taking the CMOS image sensor as an example, it mainly consists of a pixel plane array, a timing control, an analog signal processing, and an analog-to-digital conversion module. It should be noted that the two-dimensional plane where the above-mentioned pixel plane array is located is the imaging plane. On the one hand, since the pixel plane array is composed of individual pixel points, there are several pixel points distributed on the imaging plane. On the other hand, since the internal parameter optical center can be calibrated on the pixel plane array, the position of the optical center can be embodied on the imaging plane. The focal length is a measure of the convergence or divergence of light rays in an optical system. In this embodiment, the signal emitted by the light source emitter is reflected after encountering the target, and the reflected signal is refracted by the lens to the image sensor. The distance between the center of the lens and the optical center on the imaging plane is the focal length.

[0059] Further, a first model is constructed according to the position of each pixel point, the position of the optical center, and the focal length. As known from the imaging principle, the straight line where the focal length is located is the optical axis of the lens, so the focal length is perpendicular to the imaging plane, and each pixel point and the optical center are located on the imaging plane. Therefore, as shown in FIG. 1, the first model composed of the pixel point A, the lens center B, and the optical center C is a right triangle, wherein BC is the focal length. Figure 3

[0060] ​It is understandable that the pixels and optical centers on the imaging plane are not randomly distributed, but rather systematically distributed based on factors such as lens material and thickness. Therefore, the position of each pixel, the position of the optical center, and the focal length are all definite and known. Specifically, when the image sensor starts working, the processor retrieves the position of each pixel, the position of the optical center, and the focal length from the memory via instructions.

[0061] Specifically, image sensors can use timers, such as time-to-digital converters (TDCs), to accurately calculate time-of-flight. Taking a single pixel as an example, when the light source emits a signal with certain characteristics, the TDC records the current time as the first moment. When the pixel receives a reflected signal, the TDC records the current time as the second moment. By comparing the difference between the first and second moments, the time of flight of the pixel can be determined, and then this time of flight is written into memory. When the processor needs to use the time of flight to calculate the target distance, it retrieves the time of flight of each pixel from memory via instructions.

[0062] Step S12: Determine the calculation parameters corresponding to each pixel based on the position of each pixel in the first model, the position of the optical center, and the focal length;

[0063] Specifically, in the first model, the calculation parameters corresponding to each pixel can be determined based on the position of each pixel, the position of the optical center, and the focal length. These calculation parameters are used to calculate the corrected optical length corresponding to each pixel in the second model. It should be noted that the calculation parameters include, but are not limited to, the angle value corresponding to each pixel and the distance between each pixel and the center of the lens.

[0064] Furthermore, such as Figure 3 As shown, in the first model, in right-angled triangle ABC, given the positions of each pixel (A) and the optical center (C), the value of the right-angled side AC can be calculated. Specifically, the distance between pixel A and the optical center C can be determined through a mapping relationship, or by constructing a coordinate system and calculating the coordinates of the two points. The value of the other right-angled side BC represents the focal length. On one hand, the values ​​of the other two acute angles can be calculated using inverse trigonometric functions to determine the angle values ​​corresponding to each pixel; on the other hand, the value of the hypotenuse can be determined based on the Pythagorean theorem, thus determining the distance between each pixel and the center of the lens.

[0065] It should be noted that the inverse trigonometric function referred to in this embodiment can be one of the arctangent function, arcsine function, and arccosine function. The angle value corresponding to each pixel point referred to in this embodiment can be any one of the two acute angles, and no specific limitation is made here.

[0066] Step S13: Determine the measurement light length corresponding to each pixel based on the flight time of each pixel;

[0067] Specifically, the processor acquires the time-of-flight recorded by the TDC, which indicates the propagation time of the signal, and according to the distance formula, the measured optical length corresponding to each pixel point can be obtained, and the specific formula is as follows, wherein d is the measured optical length, c is the speed of light, and t is the time-of-flight.

[0068]

[0069] Step S14: determining the corrected optical length corresponding to each pixel point according to the calculation parameter corresponding to each pixel point and the measured optical length corresponding to each pixel point, wherein the calculation parameter corresponding to each pixel point, the measured optical length corresponding to each pixel point and the corrected optical length corresponding to each pixel point constitute a second model corresponding to the first model;

[0070] Specifically, the second model corresponding to the first model is constructed according to the calculation parameter corresponding to each pixel point, the measured optical length corresponding to each pixel point and the corrected optical length corresponding to each pixel point. As shown in FIG. 2, point D is the position of the target, a straight line parallel to the focal length BC is drawn through point D, and the straight line intersects with the imaging plane xOy at point E, and triangle ADE is the second model. Since DE is parallel to BC, the first model ABC and the second model ADE are similar triangles. Figure 4

[0071] Further, the calculation parameter corresponding to each pixel point has been obtained in step S12, and the calculation parameter includes but is not limited to the angle value corresponding to each pixel point and the distance between each pixel point and the center of the lens. The measured optical length corresponding to each pixel point has been obtained in step S13. Through the trigonometric function formula or the solution of similar triangles, the size of the right-angled side DE can be directly obtained, and DE is the corrected optical length corresponding to each pixel point.

[0072] Step S15: generating a corrected image according to the corrected optical length corresponding to each pixel point.

[0073] It can be understood that the light source emitter emits a light signal to the target, and the light signal is reflected after encountering the target. In the process of receiving the reflected light by the image sensor, as shown in the initial image of FIG. 3, the bending phenomenon of the middle convexity is easy to occur. Figure 5 The reason is that the time-of-flight measured by the middle position pixel point is shorter, and the time-of-flight measured by the edge position pixel point is longer. In addition, the measured time is in the order of picoseconds, so the small time difference between the middle position and the edge position will cause obvious difference, and further cause the bending problem of the initial image.

[0074] ​From the above analysis, only the edge of the time of flight distance value is converted into the corresponding equal time of flight distance value of the optical center, the image bending problem can be solved. Specifically, according to the calculation parameters corresponding to each pixel point and the measured optical length corresponding to each pixel point, the corrected optical length corresponding to each pixel point is determined, the above measured optical length is the time of flight distance value of the edge, and the above corrected optical length is the corresponding equal time of flight distance value of the optical center, so that the corrected optical length corresponding to each pixel point is taken as a standard, and the initial image is generated after the image correction through the camera internal and external parameter conversion, as shown in Figure 6

[0075] In one of the technical solutions provided in the embodiment, after obtaining the positions of the pixels in the memory, the flight times of the pixels, the position of the optical center, and the focal length, first, in the first model, the calculation parameters corresponding to each pixel point are determined based on the positions of the pixels, the position of the optical center, and the focal length; secondly, the measured optical length corresponding to the flight time of each pixel is calculated; thirdly, in the second model, the corrected optical length corresponding to each pixel point is determined according to the calculation parameters corresponding to each pixel point and the measured optical length corresponding to each pixel point; and finally, the corrected image is generated according to the corrected optical length corresponding to each pixel point. Compared with directly taking the measured optical length as the basis to generate the initial image, one of the technical solutions provided in the embodiment constructs two models, obtains the calculation parameters of each pixel point in the first model, and determines the corrected optical length in the second model. Such calculation can convert the measured optical length of the edge into the corrected optical length corresponding to the optical center, thereby solving the bending problem of the initial image in the middle convex, and accordingly, the fluctuation of adjacent pixels will be significantly reduced, and therefore the accuracy of the detection result can be improved.

[0076] Further, referring to Figure 7 , a second embodiment of the image generation method of the present application is proposed. Based on the above Figure 2 , the step of determining the calculation parameters corresponding to each pixel point according to the positions of the pixels, the position of the optical center, and the focal length of the first model includes:

[0077] Step S21: determining the coordinates of each pixel point according to the positions of the pixels;

[0078] ​Understandably, in an image sensor, a pixel array is composed of multiple pixels arranged according to a certain pattern; that is, the position of each pixel is definite and known. Specifically, the two-dimensional plane containing the aforementioned pixel array is the imaging plane. A coordinate system xOy is established with the center of this imaging plane as the origin, the horizontal direction of the pixels as the x-axis, and the vertical direction of the pixels as the y-axis. Further, by observing the arrangement of pixels on the imaging plane and referring to the circuit design of the time-to-digital converter (TDC), the physical position of each pixel on the imaging plane can be determined. Based on the distribution of this position in the xOy coordinate system, the coordinates of each pixel are determined as (x, y).

[0079] Step S22: Determine the coordinates of the optical center based on its position;

[0080] Specifically, the optical center of the image sensor is calibrated using Zhang's calibration algorithm. Then, its physical position is calculated by referring to the size of the imaging plane and the image resolution. Based on the distribution of this position in the xOy coordinate system, the coordinates of the optical center are determined to be (cx, cy).

[0081] Step S23: Determine the distance between each pixel and the optical center based on the coordinates of each pixel and the coordinates of the optical center;

[0082] Specifically, by analyzing the positions of each pixel and its optical center on the imaging plane, such as... Figure 3 As shown, the coordinates A(x,y) of each pixel and the coordinates C(cx,cy) of the optical center are determined, and the distance between two points on the coordinate axes is calculated using the formula for distance between them. That is, the distance between each pixel and the optical center.

[0083] Step S24: Determine the calculation parameters corresponding to each pixel based on the distance between each pixel and the optical center and the focal length.

[0084] like Figure 3 As shown, according to the imaging principle, the line containing the focal length is the optical axis of the lens. Therefore, the focal length is perpendicular to the imaging plane, and each pixel and the optical center are located on the imaging plane. Thus, as... Figure 3 As shown, the triangle formed by pixel A, lens center point B, and optical center C is a right triangle.

[0085] Specifically, in the first model, the calculation parameters corresponding to each pixel can be determined based on the position of each pixel, the position of the optical center, and the focal length. The calculation parameters include, but are not limited to, the angle value corresponding to each pixel and the distance between each pixel and the center of the lens.

[0086] Furthermore, such as Figure 3As shown, in the first model right triangle ABC, the distance AC (m) between each pixel and the optical center is known, and the value of the other right-angled side BC is the focal length. On the one hand, the size of the other two acute angles can be calculated using inverse trigonometric functions, thus determining the angle value corresponding to each pixel; on the other hand, the size of the hypotenuse can be determined based on the Pythagorean theorem, thus determining the distance between each pixel and the center of the lens.

[0087] It should be noted that the inverse trigonometric function referred to in this embodiment can be one of the arctangent function, arcsine function, and arccosine function. The angle value corresponding to each pixel point referred to in this embodiment can be any one of the two acute angles, and no specific limitation is made here.

[0088] In one technical solution provided in this embodiment, the coordinates of each pixel and the optical center are determined based on their physical positions on the imaging plane. The distance between them is then calculated using a formula. Based on this distance and the focal length, the calculation parameters corresponding to each pixel are determined. Compared to determining a preset distance between each pixel and the optical center through a mapping relationship, this technical solution determines the real-time distance between them by comparing their physical positions during actual detection. This allows for a more accurate measurement of the distance between each pixel and the optical center, providing accurate parameters for subsequent calculations and reducing measurement errors.

[0089] Furthermore, a third embodiment of the image generation method of the present invention is proposed. Based on the above... Figure 7 In the embodiment shown, the calculation parameters corresponding to each pixel include the angle value corresponding to each pixel. The step of determining the calculation parameters corresponding to each pixel based on the distance between each pixel and the optical center and the focal length includes:

[0090] Step S31: Based on the distance between each pixel and the optical center and the focal length, calculate the angle value corresponding to each pixel using the arctangent function formula: ∝=costan -1 (m / f), where ∝ is the angle value corresponding to each pixel, m is the distance between each pixel and the optical center, and f is the focal length.

[0091] Specifically, such as Figure 3 As shown, taking a single pixel as an example, in right triangle ABC, the right-angled side BC is the focal length f, and the right-angled side AC is the distance m between the pixel and the optical center. According to the arctangent function α = cos(α / m), ... -1 (m / f) can be used to calculate the angle value corresponding to each pixel. It should be noted that in the technical solution provided in this embodiment, the angle α corresponding to each pixel refers to... Figure 3 Angle A in the diagram.

[0092] In a technical solution provided in the embodiment, the distance between each pixel point and the optical center and the focal length of the image sensor are known, that is, the sizes of two right-angle sides in a right-angled triangle are known, and the angle value corresponding to each pixel point can be calculated by using an inverse tangent function formula. Compared with the inverse sine function and the inverse cosine function, the embodiment does not need to additionally calculate the size of the hypotenuse by using the two right-angle sides, so that the calculation steps can be saved and the detection efficiency is improved.

[0093] Further, the fourth embodiment of the image generation method is provided. Based on the third embodiment, the calculation parameter corresponding to each pixel point includes the angle value corresponding to each pixel point, and the step of determining the calculation parameter corresponding to each pixel point according to the distance between each pixel point and the optical center and the focal length includes:

[0094] In step S41, the angle value corresponding to each pixel point is obtained by using an inverse tangent function formula according to the distance between each pixel point and the optical center and the focal length: β = costan -1 (f / m), wherein β is the angle value corresponding to each pixel point, m is the distance between each pixel point and the optical center, and f is the focal length.

[0095] Specifically, as shown in the drawing, Figure 4 For example, a pixel point is taken as an example, point D is the target position, a straight line parallel to the focal length BC is drawn through point D, and the straight line intersects with the imaging plane xOy plane at point E, and it can be known that triangle ABC and triangle ADE are similar triangles.

[0096] Further, after the angle α corresponding to the pixel point A is obtained by using the inverse tangent formula in triangle ABC, since triangle ABC and triangle ADE share the angle A, that is, the angle α, the angle α can be used for calculation in triangle ADE. Further, in triangle ADE, AD is the measured optical length d of the pixel point, and the size of DE, that is, the corrected optical length of the pixel point, can be obtained by using the trigonometric function formula D = d x sin α.

[0097] In a technical solution provided in the embodiment, the distance between each pixel point and the optical center and the focal length of the image sensor are known, that is, the sizes of two right-angle sides in a right-angled triangle are known, and the angle value corresponding to each pixel point can be calculated by using an inverse tangent function formula. Compared with the inverse sine function and the inverse cosine function, the embodiment does not need to additionally calculate the size of the hypotenuse by using the two right-angle sides, so that the calculation steps can be saved and the detection efficiency is improved.

[0098] Further, the fifth embodiment of the image generation method is provided. Based on the fourth embodiment, Figure 7In the embodiment shown, the calculation parameter corresponding to each pixel point includes an angle value corresponding to each pixel point, and the step of determining the calculation parameter corresponding to each pixel point according to the distance between each pixel point and the optical center and the focal length includes:

[0099] Step S51: According to the distance between each pixel point and the optical center and the focal length, the angle value corresponding to each pixel point is obtained by using the arctangent function formula: β = costan -1 (f / m), wherein β is the angle value corresponding to each pixel point, m is the distance between each pixel point and the optical center, and f is the focal length.

[0100] Specifically, as shown in the embodiment, Figure 3 for example, in a right triangle ABC, the right angle side BC is the focal length f, and the right angle side AC is the distance m between the pixel point and the optical center. According to the arctangent function β = costan -1 (f / m), the angle value corresponding to each pixel point can be obtained. It should be noted that the angle β corresponding to each pixel point here refers to the angle B in the right triangle ABC. Figure 3

[0101] In one technical solution provided in the embodiment, the distance between each pixel point and the optical center and the focal length of the image sensor are known, that is, the lengths of two sides of a right triangle are known. By using the arctangent function formula, the angle value corresponding to each pixel point can be calculated. Compared with the arcsine function and the arccosine function, the embodiment does not need to additionally calculate the length of the hypotenuse by using the two right angle sides, so that the calculation steps can be saved and the detection efficiency can be improved.

[0102] Further, the sixth embodiment of the image generation method is provided. Based on the above Figure 7 In the embodiment shown, the calculation parameter corresponding to each pixel point includes an angle value corresponding to each pixel point, and the step of determining the calculation parameter corresponding to each pixel point according to the distance between each pixel point and the optical center and the focal length includes:

[0103] Step S61: According to the angle value corresponding to each pixel point and the measured optical length corresponding to each pixel point, the corrected optical length corresponding to each pixel point is obtained by using the cosine function formula: h = d x cosβ, wherein h is the corrected optical length corresponding to each pixel point, d is the measured optical length corresponding to each pixel point, and β is the angle value corresponding to each pixel point.

[0104] Specifically, as shown in the embodiment, Figure 4 for example, point D is the target position, a straight line parallel to the focal length BC is drawn through point D, and the straight line intersects the imaging plane xOy at point E. It can be known that triangle ABC and triangle ADE are similar triangles. ​

[0105] Further, after the angle β corresponding to the pixel point A is obtained by using the arctangent formula in the triangle ABC, since the triangle ABC and the triangle ADE share the angle A, i.e., the angle α, in the triangle ADE, the angle β can be used for calculation. Further, in the triangle ADE, AD is the measured optical length d of the pixel point, and the size of DE, i.e., the corrected optical length of the pixel point, can be obtained by using the cosine function formula D=d×cosβ.

[0106] In one technical solution provided in the embodiment, the angle value corresponding to each pixel point and the measured optical length corresponding to each pixel point are known, i.e., the acute angle and the size of the hypotenuse in the right triangle are known, and the corrected optical length corresponding to each pixel point can be obtained by using the cosine function formula. Compared with the principle of proportionality of the three sides of the similar triangle, one technical solution provided in the embodiment can obtain the corrected optical length corresponding to each pixel point without additional calculation of other data, thereby saving the calculation steps and improving the detection efficiency.

[0107] Further, the seventh embodiment of the image generation method is provided. Based on the above-mentioned embodiments, before the step of generating the corrected image according to the corrected optical length corresponding to each pixel point, the method further includes: Figure 2

[0108] Step S71: the calculation parameter corresponding to each pixel point includes the distance between each pixel point and the lens center, and the step of determining the calculation parameter corresponding to each pixel point according to the distance between each pixel point and the optical center and the focal length includes:

[0109] According to the distance between each pixel point and the optical center and the focal length, the distance between each pixel point and the lens center is obtained by using the Pythagorean theorem formula: In the formula, n is the distance between each pixel point and the lens center, m is the distance between each pixel point and the optical center, and f is the focal length.

[0110] Specifically, in the first model, i.e., the right triangle ABC, the distance between each pixel point and the optical center, i.e., the size of the straight angle side AC, is known, the size of the focal length, i.e., the size of the other straight angle side BC, is known, and the size of the hypotenuse AB, i.e., the distance between each pixel point and the lens center, can be obtained by using the Pythagorean theorem formula.

[0111] Step S72: the step of determining the corrected optical length corresponding to each pixel point according to the calculation parameter corresponding to each pixel point and the measured optical length corresponding to each pixel point includes:

[0112] ​Based on the distance between each pixel and the center of the lens and the measured light length corresponding to each pixel, the corrected light length corresponding to each pixel is obtained using the side length ratio formula: h = f × d / n, where h is the corrected light length corresponding to each pixel, f is the focal length, d is the measured light length corresponding to each pixel, and n is the distance between each pixel and the center of the lens.

[0113] Specifically, such as Figure 4 As shown, in triangle ADE, the measured optical length (hypotenuse AD) for each pixel has already been determined. The required correction optical length (right-angled side DE) for each pixel needs to be calculated. Since the first model ABC and the second model ADE are similar triangles, and the similar sides AB of AD and BC of DE are known, based on the principle that the sides of similar triangles are proportional, the length of the right-angled side DE can be directly calculated. DE is the correction optical length for each pixel.

[0114] In this embodiment, the size of the hypotenuse is calculated in the first model using the Pythagorean theorem. Since the first and second models are similar triangles, the size of the target right-angled side of the second model, i.e., the corrected optical length corresponding to each pixel, is obtained using the side length ratio formula. This embodiment provides a technical solution that utilizes the principle that the three sides of similar triangles are proportional, eliminating the need for additional angle calculations to obtain the corrected optical length corresponding to each pixel. Therefore, it saves calculation steps and improves detection efficiency.

[0115] This invention provides an image generation apparatus, with reference to... Figure 8 A schematic diagram of the functional modules of an embodiment of the image generation device of the present invention.

[0116] The acquisition module is used to acquire the position of each pixel, the flight time of each pixel, the position of the optical center, and the focal length. Each pixel and the optical center are located on the imaging plane, and the focal length is the distance between the center of the lens and the optical center.

[0117] The calculation module is used to determine the calculation parameters corresponding to each pixel based on the position of each pixel in the first model, the position of the optical center, and the focal length.

[0118] The calculation module is also used to determine the measurement light length corresponding to each pixel based on the flight time of each pixel;

[0119] The calculation module is also used to determine the corrected optical length corresponding to each pixel based on the calculation parameters corresponding to each pixel and the measured optical length corresponding to each pixel. The calculation parameters corresponding to each pixel, the measured optical length corresponding to each pixel, and the corrected optical length corresponding to each pixel constitute a second model corresponding to the first model.

[0120] An image generation module is configured to generate a corrected image according to the corrected optical length of each pixel point.

[0121] Since the embodiments of the device part correspond to the embodiments of the method part, the embodiments of the device part are described in the description of the embodiments of the method part, and are not described here.

[0122] The embodiment of the present application provides an image generation device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps in any embodiment of the above image generation method.

[0123] Since the embodiments of the image generation device part correspond to the embodiments of the method part, the embodiments of the image generation device part are described in the description of the embodiments of the method part, and are not described here.

[0124] The embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is run by a processor to implement the steps in any embodiment of the above image generation method.

[0125] Since the embodiments of the computer readable storage medium part correspond to the embodiments of the method part, the embodiments of the computer readable storage medium part are described in the description of the embodiments of the method part, and are not described here.

[0126] It should be noted that in this paper, the term "including", "containing" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or system including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or system. Without more limitations, the element defined by the statement "including a" does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0127] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0128] Those skilled in the art can clearly understand the above-mentioned embodiment method can be realized by means of software and the necessary general hardware platform, of course, also can be through hardware, but in many cases the former is the better embodiment. Based on such understanding, the technical solutions of the present application essentially or say the part of the contribution to the prior art can be embodied in the form of software products, the computer software product is stored in a storage medium (such as ROM / RAM, magnetic disc, optical disc) as described above, including a number of instructions to make a terminal device (may be a mobile phone, computer, server, or network equipment, etc.) executes the method described in various embodiments of the present application.

[0129] The above is only the preferred embodiment of the present application, not therefore limit the patent scope of the present application, any equivalent structure or equivalent flow transformation made by using the content of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. An image generation method characterized by, The image generation method comprises the following steps: acquiring the positions of the pixel points, the time of flight of the pixel points, the position of the optical center and the focal length, the pixel points and the optical center being located on an imaging plane, the focal length being the distance between the lens center and the optical center, the positions of the pixel points, the position of the optical center and the focal length constructing a first model; determining the coordinates of the pixel points according to the positions of the pixel points in the first model; determining the coordinates of the optical center according to the position of the optical center in the first model; determining the distances between the pixel points and the optical center according to the coordinates of the pixel points and the coordinates of the optical center; determining the calculation parameters corresponding to the pixel points according to the distances between the pixel points and the optical center and the focal length; determining the measured optical lengths corresponding to the pixel points according to the time of flight of the pixel points; determining the corrected optical lengths corresponding to the pixel points according to the calculation parameters corresponding to the pixel points and the measured optical lengths corresponding to the pixel points, the calculation parameters corresponding to the pixel points, the measured optical lengths corresponding to the pixel points and the corrected optical lengths corresponding to the pixel points constituting a second model corresponding to the first model; generating a corrected image according to the corrected optical lengths corresponding to the pixel points; the calculation parameters corresponding to the pixel points comprise angle values corresponding to the pixel points, and the step of determining the calculation parameters corresponding to the pixel points according to the distances between the pixel points and the optical center and the focal length comprises: According to the distance between each pixel point and the optical center and the focal length, the angle value corresponding to each pixel point is obtained by using the inverse tangent function formula: , wherein, a is the angle value corresponding to each pixel point, m is the distance between each pixel point and the optical center, and f is the focal length. the step of determining the corrected optical lengths corresponding to the pixel points according to the calculation parameters corresponding to the pixel points and the measured optical lengths corresponding to the pixel points comprises: According to the angle value corresponding to each pixel point and the measured light length corresponding to each pixel point, the correction light length corresponding to each pixel point is obtained by using a sine function formula: In the formula, h is the correction light length corresponding to each pixel point, d is the measured light length corresponding to each pixel point, and a is the angle value corresponding to each pixel point.

2. The image generation method of claim 1, wherein, the calculation parameters corresponding to the pixel points comprise angle values corresponding to the pixel points, and the step of determining the calculation parameters corresponding to the pixel points according to the distances between the pixel points and the optical center and the focal length comprises: According to the distance between each pixel point and the optical center and the focal length, the angle value corresponding to each pixel point is obtained by using the inverse tangent function formula: , wherein, is the angle value corresponding to each pixel point, m is the distance between each pixel point and the optical center, and f is the focal length.

3. The image generation method of claim 2, wherein, the calculation parameters corresponding to the pixel points comprise angle values corresponding to the pixel points, and the step of determining the calculation parameters corresponding to the pixel points according to the distances between the pixel points and the optical center and the focal length comprises: According to the angle value corresponding to each pixel point and the measured light length corresponding to each pixel point, the corrected light length corresponding to each pixel point is obtained by using a cosine function formula: , wherein h is the corrected light length corresponding to each pixel point, d is the measured light length corresponding to each pixel point, and is the angle value corresponding to each pixel point.

4. The image generation method of claim 1, wherein, the calculation parameters corresponding to the pixel points comprise distances between the pixel points and the lens center, and the step of determining the calculation parameters corresponding to the pixel points according to the distances between the pixel points and the optical center and the focal length comprises: According to the distance between each pixel point and the optical center and the focal length, the distance between each pixel point and the lens center is obtained by using the Pythagorean theorem formula: , wherein n is the distance between each pixel point and the lens center, m is the distance between each pixel point and the optical center, and f is the focal length. the step of determining the corrected optical lengths corresponding to the pixel points according to the calculation parameters corresponding to the pixel points and the measured optical lengths corresponding to the pixel points comprises: According to the distance between the each pixel point and the lens center and the measured light length corresponding to the each pixel point, the correction light length corresponding to the each pixel point is obtained by using the side length ratio formula: In the formula, h is the correction light length corresponding to the each pixel point, f is the focal length, d is the measured light length corresponding to the each pixel point, and n is the distance between the each pixel point and the lens center.

5. An image generation apparatus characterized by comprising: The device comprises: an acquisition module, configured to acquire the positions of the pixel points, the time of flight of the pixel points, the position of the optical center and the focal length, the pixel points and the optical center being located on an imaging plane, the focal length being the distance between the lens center and the optical center; The computing module is configured to determine a corresponding computing parameter of each pixel point according to a position of each pixel point in the first model, a position of the optical center, and the focal length; determine a coordinate of each pixel point according to the position of each pixel point in the first model; determine a coordinate of the optical center according to the position of the optical center in the first model; determine a distance between each pixel point and the optical center according to the coordinate of each pixel point and the coordinate of the optical center; and determine a corresponding angle value of each pixel point by using an inverse tangent function formula according to the distance between each pixel point and the optical center and the focal length. In the formula, α is the corresponding angle value of each pixel point, m is the distance between each pixel point and the optical center, and f is the focal length. the calculation module is further configured to determine the measured optical lengths corresponding to the pixel points according to the time of flight of the pixel points; The computing module is further configured to obtain the corrected light length of each pixel point by using a sine function formula according to the angle value corresponding to each pixel point and the measured light length corresponding to each pixel point. In the formula, h is the corrected light length of each pixel point, d is the measured light length of each pixel point, and a is the angle value of each pixel point. The calculation parameter corresponding to each pixel point, the measured light length of each pixel point, and the corrected light length of each pixel point constitute a second model corresponding to the first model. an image generation module, configured to generate a corrected image according to the corrected optical lengths corresponding to the pixel points.

6. An image generation apparatus characterized by comprising: The device comprises a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the image generation method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps of the image generation method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Projector correction method and system, storage medium and electronic equipment

    CN112804508A

  • Image correction method and device and electronic equipment

    CN114187188A