Method and apparatus for image geometric distortion correction

By correcting image geometric distortion using downsampling and bilinear interpolation, the shortcomings of hardware and software implementations are overcome, achieving efficient and flexible image correction results.

CN116416143BActive Publication Date: 2026-06-05CAMBRICON TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CAMBRICON TECH CO LTD
Filing Date
2021-12-30
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies for image geometric distortion correction require large-area circuitry in hardware implementation or consume processor computing power in software implementation, and cannot be flexibly adjusted.

Method used

By downsampling the grid points of the input image, the scaling ratio is obtained by analyzing local distortion, and the coordinates of the grid points in the output image are mapped using bilinear interpolation, which reduces hardware area and processor computing power and improves flexibility.

Benefits of technology

It achieves efficient image geometric distortion correction, reduces hardware area and processor computing requirements, and can be flexibly adjusted according to new needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116416143B_ABST
    Figure CN116416143B_ABST
Patent Text Reader

Abstract

The present application relates to a method and apparatus for image geometric distortion correction. Firstly, a plurality of grid points of an input image are down-sampled, each grid point corresponding to an input coordinate; then, local distortion of the input coordinates is analyzed to obtain a scaling ratio; finally, output coordinates of the grid points in an output image are mapped according to the input coordinates and the scaling ratio. By calculating the scaling ratio, the present application greatly reduces the hardware area or the operation power of a processor for calculating the deformed coordinates, and improves the flexibility for meeting new requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention generally relates to the field of image processing. More specifically, this invention relates to methods and apparatus for correcting geometric distortions in images. Background Technology

[0002] Video geometric distortion correction refers to deforming the input video frame by frame to obtain video frames with distortion removed or a specific projection method. Video geometric distortion correction includes lens distortion correction, perspective transformation correction, and deformation of different projection methods. It is usually used as a sub-function of video processing such as binocular depth, image stitching, and video stabilization.

[0003] Video geometric distortion correction involves two stages: distortion coordinate calculation and pixel interpolation. There are two ways to implement geometric distortion correction in hardware: pure hardware implementation and a combination of hardware and software. Pure hardware implementation involves using hardware to perform coordinate calculation and pixel interpolation, while the combination involves first using software to calculate the coordinates and store them in a lookup table (LUT), then using hardware to read the lookup table for pixel interpolation. Compared to pure hardware implementation, the combination of hardware and software is more flexible, allowing modification of the software's coordinate calculation method as needed.

[0004] However, existing technologies involve calculations such as trigonometric functions and square roots when calculating deformed coordinates. If implemented in hardware, it would require a large area of ​​circuitry; if implemented in software, it would consume a large amount of processor computing power. Furthermore, once coordinate calculations are fixed in hardware, they cannot be flexibly adjusted when new requirements arise.

[0005] Therefore, an efficient solution for correcting image geometric distortion is urgently needed. Summary of the Invention

[0006] In order to at least partially solve the technical problems mentioned in the background art, the present invention provides a method and apparatus for correcting image geometric distortion.

[0007] In one aspect, the present invention discloses a method for correcting geometric distortion of an image, comprising: downsampling a plurality of grid points of an input image, each grid point corresponding to an input coordinate; analyzing local distortion of the input coordinates to obtain a scaling ratio; and mapping the grid points to output coordinates in an output image based on the input coordinates and the scaling ratio.

[0008] In another aspect, the present invention discloses a computer-readable storage medium having stored thereon computer program code for image geometric distortion correction, which, when run by a processing device, performs the aforementioned method.

[0009] In another aspect, the present invention discloses a computer program product, including a computer program for image geometric distortion correction, characterized in that the computer program, when executed by a processor, implements the steps of the aforementioned method.

[0010] In another aspect, the present invention discloses a computer device including a memory, a processor, and a computer program stored in the memory, characterized in that the processor executes the computer program to implement the steps of the aforementioned method.

[0011] In another aspect, the present invention discloses an image geometric distortion correction device, comprising: a downsampling module, an analysis module, and a mapping module. The downsampling module downsamples multiple grid points of the input image, each grid point corresponding to an input coordinate; the analysis module analyzes the local distortion of the input coordinates to obtain a scaling ratio; and the mapping module maps the grid points to the output coordinates in the output image according to the input coordinates and the scaling ratio.

[0012] This invention significantly reduces the hardware area or processor computing power required to calculate deformable coordinates by calculating the scaling ratio, thereby improving flexibility in responding to new demands. Attached Figure Description

[0013] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. In the drawings, several embodiments of the invention are illustrated by way of example and not limitation, and like or corresponding reference numerals denote like or corresponding parts. Wherein:

[0014] Figure 1 This is a schematic diagram illustrating the geometric distortion of an exemplary captured image;

[0015] Figure 2 It shows the image taken through a fisheye lens and the image seen by the human eye;

[0016] Figure 3 This is a flowchart illustrating an image geometric distortion correction method according to an embodiment of the present invention;

[0017] Figure 4 This is a schematic diagram illustrating downsampling in an embodiment of the present invention;

[0018] Figure 5 This is a schematic diagram illustrating the calculation of the interpolated output coordinates of a reference pixel using bilinear interpolation according to an embodiment of the present invention; and

[0019] Figure 6 This is a schematic diagram illustrating an image geometric distortion correction device according to another embodiment of the present invention. Detailed Implementation

[0020] 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, not all, of the embodiments of the present invention. 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.

[0021] It should be understood that the terms "first," "second," "third," and "fourth," etc., in the claims, specification, and drawings of this invention are used to distinguish different objects, rather than to describe a specific order. The terms "comprising" and "including" used in the specification and claims of this invention indicate the presence of the described features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof.

[0022] It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this specification and claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.

[0023] As used in this specification and claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection."

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

[0025] Image geometric distortion refers to the deformation of the geometric position of image pixels relative to the reference system (the actual position on the ground) during the imaging process, such as compression, stretching, offset, and twisting. This causes the geometric position, size, shape, and orientation of the captured image to be deformed, which does not match the actual situation.

[0026] Figure 1 The diagram illustrates geometric distortion of exemplary captured images, wherein captured image 101 is a normal, distortion-free geometric image, captured image 102 is a geometric image with pincushion distortion, and captured image 103 is a geometric image with barrel distortion.

[0027] The morphology of image geometric distortion is not limited to Figure 1The images show pincushion and barrel distortion. Another common type of image geometric distortion occurs when shooting with a fisheye lens, which is a lens with a focal length of 16mm or less and an angle of view close to or equal to 180 degrees. It is an extreme wide-angle lens. In order to achieve the maximum shooting angle, the front lens element of this lens has a very short diameter and protrudes forward in a parabolic shape, which is quite similar to the eye of a fish, hence the name fisheye lens.

[0028] Due to the ultra-wide-angle nature of fisheye lenses, their field of view exceeds the range that the human eye can see. Therefore, the images captured by fisheye lenses are very different from what people see. Figure 2 Images taken with a fisheye lens are shown, where image 201 is an image taken with a fisheye lens, and image 202 is the view as seen by a person from the same angle.

[0029] One embodiment of the present invention is a method for correcting geometric distortion of an image, used to correct a distorted input image and produce a distortion-free or near-realistic output image. For example, this embodiment can correct a captured image 102 with pincushion distortion or a captured image 103 with barrel distortion to a normal, distortion-free captured image 101, or correct a captured image 201 taken with a fisheye lens to a captured image 202 that is visible to the human eye. Figure 3 A flowchart illustrating the image geometric distortion correction method of this embodiment is shown.

[0030] In step 301, multiple grid points of the input image are downsampled, with each grid point corresponding to an input coordinate. The input image here refers to a captured image with geometric distortion, such as the aforementioned captured image 102, captured image 103, or captured image 201. Downsampling, also known as downsampling, in this embodiment involves sampling pixel values ​​every few pixels. For example, regardless of the size of the input image, 64×64 pixels (i.e., grid points) are sampled.

[0031] Figure 4 The diagram illustrates the downsampling process in this embodiment. The resolution of the input image 401 is exemplarily 1600×1200. Assuming that it is sampled with 64×64 grid points, this means that one grid point is sampled every 1600÷64=25 pixels in length, and one grid point is sampled every 18 pixels in width since 1200÷64=18.75, taking the integer part of the width. This is as shown by the squares in the figure.

[0032] Each grid point corresponds to a coordinate in the input image, referred to here as the input coordinate. In this embodiment, the input coordinates are represented in polar coordinates, where the length *r* represents the length of the line segment from a grid point to the pole, and the angle *θ* represents the angle of a grid point relative to the polar axis in the input image, i.e., the angle from the polar axis to the line segment. The input coordinates are defined by the length *r* and the angle *θ*.

[0033] In step 302, the local distortion of the input coordinates is analyzed to obtain the scaling ratio. In this step, the scaling ratio is calculated using polar coordinates. The following example uses a fisheye image with virtual PTZ (pan / tilt / zoom, representing a lens that can move up, down, left, and right and has zoom and magnification control functions) to illustrate how the scaling ratio is obtained.

[0034] For a 180-degree fisheye lens, its focal length f can be obtained according to the imaging equation. fish for:

[0035]

[0036] Where W is the width of the input image. A tiny angular spacing Δθ maps to the arc length l of the fisheye image. fish for:

[0037]

[0038] For the equidistant fisheye model, the image arc length corresponding to a tiny angular spacing Δθ at any angle is l. fish .

[0039] The focal length f of the pinhole imaging model using a regular lens (i.e., what the human eye sees) is... pers It can be obtained using the following formula:

[0040]

[0041] Where fov is the half field of view of a normal lens.

[0042] For an angle θ within half the field of view, the image position change caused by a small angle change Δθ is l. pers for:

[0043]

[0044] The ratio of the projection of a tiny arc of the same size onto the output image to its projection onto the input image is:

[0045]

[0046] The projection length ratio is the scaling factor. In other words, the scaling factor is the arc length of the grid point in the output image divided by the arc length of the grid point in the input image. From the above derivation, it can be seen that the scaling factor is a function of the angle θ.

[0047] As can be seen from the scaling formula, the scaling ratio varies at different locations, reflecting different degrees of distortion. Taking a 180-degree isometric fisheye lens as an example, if the virtual lens's horizontal field of view is 128 degrees (i.e., fov = 64), the scaling ratio is 0.785 when θ = 0 degrees, 0.9 when θ = 30 degrees, and 1.57 when θ = 60 degrees. If the virtual lens's horizontal field of view is reduced to 90 degrees (i.e., fov = 45), the scaling ratio is 1.57 when θ = 0 degrees, 1.81 when θ = 30 degrees, and 2.22 when θ = 45 degrees.

[0048] In step 303, the reference pixel with the smallest scaling ratio is obtained according to the above function. A smaller scaling ratio indicates a greater distance between the same pixel in the output image and the input image, meaning a higher degree of distortion. The quality of the correction result depends on the correction of the pixel with the highest degree of distortion. This embodiment mainly focuses on the mapping accuracy at the point of maximum distortion. If the mapping accuracy at the point of maximum distortion meets expectations, the mapping accuracy of other pixels will inevitably be more ideal. Therefore, in this step, the pixel with the smallest scaling ratio in the input image is obtained according to the scaling ratio calculation formula; this is referred to as the reference pixel.

[0049] In step 304, the interpolated output coordinates of the reference pixel are calculated using bilinear interpolation. Generally, the reference pixel will not fall exactly on the grid points. However, in this embodiment, only the input coordinates of the grid points are known. Therefore, the grid points that are closest to the reference pixel on the horizontal and vertical axes are first found. Then, the coordinates of these grid points on the output image (referred to as the output coordinates here) are calculated using the scaling ratio formula. Finally, the output coordinates corresponding to the reference pixel are obtained by interpolation on the horizontal and vertical axes, respectively.

[0050] Figure 5 This diagram illustrates how bilinear interpolation is used to calculate the interpolated output coordinates of a reference pixel in this embodiment. For a more intuitive explanation, Figure 5 It is presented in rectangular coordinates rather than polar coordinates. As mentioned earlier, the reference pixel 501 has been calculated in step 303, and its input coordinates are (x... R ,y R Based on the x-coordinate of the reference pixel 501 R It can be deduced that among all grid points, the one whose x-coordinate is closest to x is... R Let x1 and x2 be the ordinates of the reference pixel 501. RIt can be deduced that among all grid points, the one whose ordinate is closest to y is... R Let x1 and y2 be the coordinates of x1, x2, y1, and y2. Based on (x1, y1), (x2, y1), (x1, y2), and (x2, y2), we can obtain the four grid points 502, 503, 504, and 505 that are closest to the reference pixel 501.

[0051] Next, using the scaling ratio calculation formula, the output coordinates of grid points 502, 503, 504, and 505 on the output image are calculated. Finally, based on the output coordinates of grid points 502, 503, 504, and 505, the output coordinates (x, y, y) corresponding to the reference pixel point 501 are interpolated on the horizontal and vertical axes respectively. q ,y q ).

[0052] In step 305, the reference output coordinates of the reference pixel are obtained. In this embodiment, the reference output coordinates of the reference pixel are obtained by looking up a table using existing technology to find the pixel in the output image that is closest to the reference pixel. This can be done in the same way as described in step 304, and will not be repeated here. Then, the reference output coordinates are calculated by interpolation based on the four pixels obtained from the table lookup.

[0053] In step 306, the distance between the interpolated output coordinates and the reference output coordinates is compared with a threshold, i.e., it is determined whether the distance between the interpolated output coordinates and the reference output coordinates is greater than the threshold, in order to determine the number of grid points. More specifically, the interpolated output coordinates (x, y, z) obtained in step 304 are calculated. q ,y q The distance between the output image and the reference output coordinates is compared with a threshold. In this embodiment, the threshold is the length of a single pixel in the output image.

[0054] When the distance is greater than the threshold, it indicates that the output coordinates (x) are... q ,y q The error is greater than the length of a single pixel. This error mainly comes from the insufficient number of grid points, resulting in a large deviation in the interpolated output coordinates calculated using bilinear interpolation. In this case, step 307 is executed to increase the number of grid points, for example, to 128×128 grid points. The denser the grid points, the higher the interpolation accuracy. Then, return to step 301 and repeat the aforementioned steps based on the increased number of grid points.

[0055] When the distance is not greater than the threshold, the output coordinates (x) are displayed. q ,y qIf the error is no greater than the length of a single pixel, such an error is acceptable and there is no need to adjust the number of grid points. In this case, step 308 is executed to map the output coordinates of the grid points in the output image based on the input coordinates and the scaling ratio. That is, the input coordinates of each grid point are mapped to the output image based on the scaling ratio to obtain the output coordinates of all grid points.

[0056] In step 309, the output coordinates of pixels outside the grid points are calculated using bilinear interpolation. The pixels outside the grid points in the output image are obtained using bilinear interpolation. This completes the correction of the geometrically distorted input image into a distortion-free output image.

[0057] Another embodiment of the present invention is an image geometric distortion correction device, specifically, this image geometric distortion correction device is used to achieve the following: Figure 3 The image geometric distortion correction method shown. Figure 6 A schematic diagram of the image geometric distortion correction device of this embodiment is shown. As shown in the figure, the image geometric distortion correction device includes: a downsampling module 601, an analysis module 602, a processing module 603, and a mapping module 604.

[0058] The downsampling module 601 downsamples multiple grid points of the input image, with each grid point corresponding to an input coordinate. The input image here refers to a captured image with geometric distortion, such as the aforementioned captured image 102, captured image 103, or captured image 201. Downsampling, also known as downsampling, in this embodiment involves sampling pixel values ​​every few pixels. Each grid point in the input image corresponds to an input coordinate, which is represented in polar coordinates and defined by length r and angle θ.

[0059] Analysis module 602 is used to analyze the local distortion of the input coordinates to obtain the scaling ratio. Taking virtual PTZ using a fisheye image as an example, the scaling ratio is:

[0060]

[0061] The projection length ratio is the scaling factor. In other words, the scaling factor is the arc length of the grid point in the output image divided by the arc length of the grid point in the input image. From the above derivation, it can be seen that the scaling factor is a function of the angle θ.

[0062] The processing module 603 obtains the reference pixel with the smallest scaling ratio according to the above function. As described in the previous embodiment, the quality of the correction result depends on the correction of the pixel with the highest degree of distortion. This embodiment also focuses on the mapping accuracy at the point of maximum distortion. As long as the mapping accuracy at the point of maximum distortion meets expectations, the mapping accuracy of other pixels will inevitably be more ideal. Therefore, the processing module 603 calculates the reference pixel with the smallest scaling ratio in the input image according to the scaling ratio calculation formula.

[0063] Next, the processing module 603 uses bilinear interpolation to calculate the interpolated output coordinates of the reference pixel. More specifically, the processing module 603 first finds the grid points on the horizontal and vertical axes that are closest to the reference pixel, then uses the scaling ratio formula to calculate the output coordinates of these grid points on the output image, and finally interpolates the output coordinates corresponding to the reference pixel on the horizontal and vertical axes respectively.

[0064] After obtaining the interpolated output coordinates, the processing module 603 continues to obtain the reference output coordinates of the reference pixel. In this embodiment, the processing module 603 uses existing technology to look up a table to find the four pixels in the output image that are closest to the reference pixel, and then calculates the reference output coordinates based on the four pixels obtained from the table lookup.

[0065] Next, the processing module 603 compares the distance between the interpolated output coordinates and the reference output coordinates with a threshold, that is, it determines whether the distance between the interpolated output coordinates and the reference output coordinates is greater than the threshold, in order to determine the number of grid points. In this embodiment, the threshold is the length of a single pixel in the output image.

[0066] When the distance is greater than the threshold, it indicates that the output coordinates (x) are... q ,y q If the error is greater than the length of a single pixel, the processing module 603 increases the number of grid points, for example, by adjusting it to 128×128 grid points. Then, the downsampling module 601 downsamples the input image based on the increased number of grid points, and the analysis module 602 and the processing module 603 re-execute the aforementioned task.

[0067] When the distance is not greater than the threshold, the output coordinates (x) are displayed. q ,y q If the error is no greater than the length of a single pixel, such an error is acceptable and there is no need to adjust the number of grid points. In this case, the mapping module 604 maps the output coordinates of the grid points in the output image according to the input coordinates and the scaling ratio. That is, the input coordinates of each grid point are mapped to the output image based on the scaling ratio to obtain the output coordinates of all grid points.

[0068] After obtaining the output coordinates of all grid points, the processing module 603 uses bilinear interpolation to calculate the output coordinates of pixels outside the grid points. Thus, the image geometric distortion correction device corrects the geometrically distorted input image into a distortion-free output image.

[0069] Another embodiment of the present invention is a computer-readable storage medium storing computer program code for image geometric distortion correction. When the computer program code is run by a processing device, it performs the following... Figure 3 The method shown. Another embodiment of the present invention is a computer program product, including a computer program for image geometric distortion correction, characterized in that, when the computer program is executed by a processor, it implements as shown in the figure. Figure 3 The steps of the method shown are described. Another embodiment of the present invention is a computer device, including a memory, a processor, and a computer program stored in the memory, characterized in that the processor executes the computer program to implement the following... Figure 3 The steps of the method shown.

[0070] In some implementation scenarios, the integrated unit described above can be implemented as a software program module. If implemented as a software program module and sold or used as an independent product, the integrated unit can be stored in a computer-readable storage device (CMSDD). Therefore, when the solution of this invention is embodied in a software product (e.g., a computer-readable storage medium), the software product can be stored in a memory, which may include several instructions to cause a computer device (e.g., a personal computer, server, or network device) to execute some or all of the steps of the method described in the embodiments of this invention. The aforementioned memory may include, but is not limited to, various media capable of storing program code, such as USB flash drives, flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0071] This invention obtains pixel coordinates based on grid points and interpolation. The calculation process is relatively simple, does not require a large area of ​​circuitry or excessive processor power, and can be flexibly adjusted according to new needs.

[0072] Depending on the application scenario, the electronic devices or apparatus of the present invention may include servers, cloud servers, server clusters, data processing devices, robots, computers, printers, scanners, tablet computers, smart terminals, PC devices, IoT terminals, mobile terminals, mobile phones, dashcams, navigators, sensors, cameras, video cameras, projectors, watches, headphones, mobile storage, wearable devices, visual terminals, autonomous driving terminals, vehicles, home appliances, and / or medical devices. The vehicles include airplanes, ships, and / or vehicles; the home appliances include televisions, air conditioners, microwave ovens, refrigerators, rice cookers, humidifiers, washing machines, lights, gas stoves, and range hoods; the medical devices include MRI scanners, ultrasound machines, and / or electrocardiographs. The electronic devices or apparatus of the present invention can also be applied in fields such as the Internet, IoT, data centers, energy, transportation, public management, manufacturing, education, power grids, telecommunications, finance, retail, construction sites, and healthcare. Furthermore, the electronic devices or apparatus of the present invention can also be used in application scenarios related to artificial intelligence, big data, and / or cloud computing, such as cloud computing, edge computing, and terminal computing. In one or more embodiments, the high-computing-power electronic devices or apparatuses according to the present invention can be applied to cloud devices (e.g., cloud servers), while the low-power electronic devices or apparatuses can be applied to terminal devices and / or edge devices (e.g., smartphones or cameras). In one or more embodiments, the hardware information of the cloud devices and the hardware information of the terminal devices and / or edge devices are compatible with each other, so that suitable hardware resources can be matched from the hardware resources of the cloud devices to simulate the hardware resources of the terminal devices and / or edge devices based on the hardware information of the terminal devices and / or edge devices, so as to complete the unified management, scheduling and collaborative work of end-to-cloud or cloud-edge-end integration.

[0073] It should be noted that, for the sake of brevity, this invention describes some methods and their embodiments as a series of actions and combinations thereof. However, those skilled in the art will understand that the solution of this invention is not limited to the order of the described actions. Therefore, based on the disclosure or teachings of this invention, those skilled in the art will understand that some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art will understand that the embodiments described in this invention can be considered as optional embodiments, that is, the actions or modules involved are not necessarily essential for the implementation of one or more solutions of this invention. In addition, depending on the solution, the description of some embodiments of this invention also has different emphases. In view of this, those skilled in the art will understand that parts not described in detail in a certain embodiment of this invention can also refer to the relevant descriptions of other embodiments.

[0074] In terms of specific implementation, based on the disclosure and teachings of this invention, those skilled in the art will understand that the several embodiments disclosed herein can also be implemented in other ways not disclosed herein. For example, regarding the various units in the electronic device or device embodiments described above, this document has divided them based on logical functions, but in actual implementation, there may be other ways of division. As another example, multiple units or components can be combined or integrated into another system, or some features or functions in a unit or component can be selectively disabled. Regarding the connection relationship between different units or components, the connection discussed above in conjunction with the accompanying drawings can be a direct or indirect coupling between units or components. In some scenarios, the aforementioned direct or indirect coupling involves a communication connection utilizing an interface, wherein the communication interface can support electrical, optical, acoustic, magnetic, or other forms of signal transmission.

[0075] In this invention, the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units. The aforementioned components or units may be located in the same position or distributed across multiple network units. Furthermore, depending on actual needs, some or all of the units can be selected to achieve the purpose of the solution described in the embodiments of this invention. Additionally, in some scenarios, multiple units in the embodiments of this invention may be integrated into one unit or each unit may exist physically independently.

[0076] In other implementation scenarios, the integrated units described above can also be implemented in hardware, i.e., as specific hardware circuits, which may include digital circuits and / or analog circuits. The physical implementation of the circuit's hardware structure may include, but is not limited to, physical devices, which may include, but are not limited to, transistors or memristors. Therefore, the various devices described herein (e.g., computing devices or other processing devices) can be implemented using appropriate hardware processors, such as central processing units, GPUs, FPGAs, DSPs, and ASICs. Furthermore, the aforementioned storage units or storage devices can be any suitable storage medium (including magnetic storage media or magneto-optical storage media), such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), ROM, and RAM.

[0077] The foregoing can be better understood in accordance with the following terms:

[0078] Clause A1. A method for correcting geometric distortion of an image, comprising: downsampling a plurality of grid points of an input image, each grid point corresponding to an input coordinate; analyzing local distortion of the input coordinates to obtain a scaling ratio; and mapping the grid points to output coordinates in an output image based on the input coordinates and the scaling ratio.

[0079] Clause A2. The method described in Clause A1 further includes: calculating the output coordinates of pixel points other than the plurality of grid points using bilinear interpolation.

[0080] Clause A3. The method according to Clause A1, wherein the scaling ratio is the arc length of the grid point in the output image divided by the arc length of the grid point in the input image.

[0081] Clause A4. The method according to Clause A3, wherein the input coordinates include the angle of the grid point relative to the polar axis in the input image, and the scaling ratio is a function of the angle.

[0082] Clause A5. The method according to Clause A4 further comprises: obtaining a reference pixel with the smallest scaling ratio according to the function; calculating the interpolated output coordinates of the reference pixel using bilinear interpolation; obtaining the reference output coordinates of the reference pixel; and comparing the distance between the interpolated output coordinates and the reference output coordinates with a threshold to determine the number of the plurality of grid points.

[0083] Clause A6. The method according to Clause A5, wherein the step of obtaining the reference output coordinates comprises: looking up a table to find the pixel closest to the reference pixel; and interpolating the reference output coordinates based on the pixel obtained from the table lookup.

[0084] Clause A7. The method according to Clause A5, wherein the threshold is the pixel length of the output image.

[0085] Clause A8. The method according to Clause A7, wherein the comparison step includes: increasing the number when the distance is greater than the pixel length; wherein the downsampling, analysis, and mapping steps are performed on the grid points after increasing the number.

[0086] Clause A9. The method according to Clause A7 further includes: performing the mapping step when the distance is not greater than the pixel length.

[0087] Clause A10. A computer-readable storage medium having stored thereon computer program code for correcting geometric distortion of an image, which, when run by a processing device, performs the method described in any one of Clauses A1 to 9.

[0088] Clause A11. A computer program product comprising a computer program for correcting geometric distortion of an image, characterized in that, when the computer program is executed by a processor, it implements the steps of the method described in any one of Clauses A1 to A9.

[0089] Clause A12. A computer apparatus comprising a memory, a processor, and a computer program stored in the memory, characterized in that the processor executes the computer program to implement the steps of the method described in any one of Clauses A1 to A9.

[0090] Clause A13. An image geometric distortion correction apparatus, comprising: a downsampling module for downsampling a plurality of grid points of an input image, each grid point corresponding to an input coordinate; an analysis module for analyzing local distortion of the input coordinates to obtain a scaling ratio; and a mapping module for mapping the grid points to output coordinates in an output image based on the input coordinates and the scaling ratio.

[0091] Clause A14. The apparatus according to Clause A13 further includes: a processing module for calculating the output coordinates of pixel points other than the plurality of grid points using bilinear interpolation.

[0092] Clause A15. The apparatus according to Clause A13, wherein the scaling ratio is the arc length of the grid point in the output image divided by the arc length of the grid point in the input image.

[0093] Clause A16. The apparatus according to Clause A15, wherein the input coordinates include the angle of the grid points relative to the polar axis in the input image, and the scaling ratio is a function of the angle.

[0094] Clause A17. The apparatus according to Clause A16 further includes: a processing module for: obtaining a reference pixel with the smallest scaling ratio according to the function; calculating interpolated output coordinates of the reference pixel using bilinear interpolation; obtaining reference output coordinates of the reference pixel; and comparing the distance between the interpolated output coordinates and the reference output coordinates with a threshold to determine the number of the plurality of grid points.

[0095] Clause A18. The apparatus according to Clause A17, wherein the processing module looks up a table to find the pixel closest to the reference pixel and calculates the reference output coordinates based on the pixel interpolation obtained from the table lookup.

[0096] Clause A19. The apparatus according to Clause A17, wherein the threshold is the pixel length of the output image.

[0097] Clause A20. The apparatus according to Clause A19, wherein the processing module determines that when the distance is greater than the pixel length, the quantity is increased, wherein the downsampling module downsamples the input image based on the grid points after the quantity is increased, the analysis module obtains the scaling ratio based on the grid points after the quantity is increased, and the mapping module maps the output coordinates based on the grid points after the quantity is increased.

[0098] Clause A21. The apparatus according to Clause A19, wherein the processing module determines that the number of the plurality of grid points is maintained when the distance is not greater than the pixel length.

[0099] The embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for correcting geometric distortion of an image, comprising: The input image is downsampled to multiple grid points, each grid point corresponding to an input coordinate; Analyze the local distortion of the input coordinates to obtain the scaling ratio; as well as Based on the input coordinates and the scaling ratio, map the output coordinates of the grid points in the output image; The input coordinates include the angle of the grid point relative to the polar axis in the input image, and the scaling ratio is a function of the angle, expressed as: Where fov is the half field of view of a normal lens, and angle θ is the angle of the grid point relative to the polar axis in the input image.

2. The method according to claim 1, further comprising: The output coordinates of pixels outside the multiple grid points are calculated using bilinear interpolation.

3. The method according to claim 1, further comprising: According to the function, the reference pixel with the smallest scaling ratio is obtained; The interpolated output coordinates of the reference pixel are calculated using bilinear interpolation. Obtain the reference output coordinates of the reference pixel; as well as The distance between the interpolated output coordinates and the reference output coordinates is compared with a threshold to determine the number of the plurality of grid points.

4. The method according to claim 3, wherein the step of obtaining the reference output coordinates includes: Find the pixel that is closest to the reference pixel by looking up the table; as well as The reference output coordinates are calculated based on the pixel points obtained from the lookup table through interpolation.

5. The method according to claim 3, wherein the threshold is the pixel length of the output image.

6. The method of claim 5, wherein the comparison step comprises: When the distance is greater than the pixel length, the quantity is increased; The downsampling, analysis, and mapping steps are performed using the increased number of grid points.

7. The method according to claim 5, further comprising: The mapping step is performed when the distance is not greater than the pixel length.

8. A computer-readable storage medium having stored thereon computer program code for image geometric distortion correction, wherein when the computer program code is run by a processing device, it performs the method according to any one of claims 1 to 7.

9. A computer program product, comprising a computer program for image geometric distortion correction, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.

11. An image geometric distortion correction device, comprising: The downsampling module uses multiple grid points of the input image to downsample, with each grid point corresponding to an input coordinate; An analysis module is used to analyze the local distortion of the input coordinates to obtain the scaling ratio; as well as A mapping module is used to map the grid points to the output coordinates in the output image based on the input coordinates and the scaling ratio; The input coordinates include the angle of the grid point relative to the polar axis in the input image, and the scaling ratio is a function of the angle, expressed as: Where fov is the half field of view of a normal lens, and angle θ is the angle of the grid point relative to the polar axis in the input image.

12. The apparatus of claim 11, further comprising: The processing module is used to calculate the output coordinates of pixels other than the plurality of grid points using bilinear interpolation.

13. The apparatus of claim 11, further comprising: The processing module is used to: According to the function, the reference pixel with the smallest scaling ratio is obtained; The interpolated output coordinates of the reference pixel are calculated using bilinear interpolation. Obtain the reference output coordinates of the reference pixel; as well as The distance between the interpolated output coordinates and the reference output coordinates is compared with a threshold to determine the number of the plurality of grid points.

14. The apparatus of claim 13, wherein the processing module looks up a table to find the pixel closest to the reference pixel and calculates the reference output coordinates based on the pixel interpolation obtained from the table lookup.

15. The apparatus of claim 13, wherein the threshold is the pixel length of the output image.

16. The apparatus of claim 15, wherein the processing module determines that when the distance is greater than the pixel length, the quantity is increased, wherein the downsampling module downsamples the input image based on the grid points after the quantity is increased, the analysis module obtains the scaling ratio based on the grid points after the quantity is increased, and the mapping module maps the output coordinates based on the grid points after the quantity is increased.

17. The apparatus of claim 15, wherein the processing module determines that the number of the plurality of grid points is maintained when the distance is not greater than the pixel length.