A method for automatic correction of distorted images

By establishing the reference image group and calculating the correlation coefficient, the distortion coefficient is automatically extracted, and the image correction is corrected using the distortion equivalent spherical model, which solves the problem of automatic correction of wide-angle lens distortion images, and achieves efficient image correction effect.

CN115564658BActive Publication Date: 2025-09-05CHINA JILIANG UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110733047.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2025-09-05
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

The prior art is difficult to automatically determine the distortion coefficient, which leads to the inability to effectively correct the image distortion captured by wide-angle lenses, especially the image correction of pillow-type and barrel-type distortions.

Method used

By establishing a reference image group, the correlation coefficient between the standard image and the reference image is calculated, the distortion coefficient is automatically extracted, and the image correction is performed using the distortion equivalent spherical model, including preprocessing, correlation coefficient calculation and distortion type judgment.

Benefits of technology

Automatic correction of distorted images is realized, parameter adjustment is simplified, calculation efficiency is improved, and image correction of different distortion sizes is suitable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115564658B_ABST
    Figure CN115564658B_ABST
Patent Text Reader

Abstract

This invention proposes a method for automatically correcting distorted images. After inputting a source image, the distorted image to be corrected is first obtained. Image preprocessing is then performed to calculate the correlation coefficient between the pixel matrices of the standard image and the reference image, thereby obtaining the distortion coefficients of the distorted image to be corrected. This method then uses a distortion equivalent sphere to simulate the distortion generated, thereby generating a distortion correction model. The distorted image is then corrected and the corrected image is output. The correlation coefficients are calculated based on a binarized image, resulting in minimal computational effort and a simple algorithm. Furthermore, this method has a wide range of applications and can effectively correct both barrel and pincushion distortions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of aberration correction, and in particular to a method for automatically correcting distorted images. Background Art

[0002] Wide-angle lenses are widely used in security applications due to their wide field of view. However, images captured with wide-angle lenses can introduce barrel distortion, which can cause visual discomfort. Similar to barrel distortion (negative distortion), there is pincushion distortion (positive distortion), which together constitute radial distortion. Radial distortion can be corrected by improving lens manufacturing processes and using computer language to process distorted images. However, due to technological limitations, designing a lens that meets field of view requirements while avoiding radial distortion is currently difficult and unattainable. Therefore, using computer language to correct distorted images is of great significance.

[0003] The method of correcting distortion using perspective projection of equivalent surfaces offers the advantages of low computational effort, ease of implementation, and the absence of equations. Han Guangliang and Song Jianzhong proposed using a distortion equivalent spherical model to simulate distortion in their paper "Image Distortion Correction Based on Distortion Equivalent Surfaces," published in the January 2005 issue of Optical Technology, Vol. 31, No. 1. However, due to the varying magnitudes of distortion in distorted images, a single spherical model cannot be used to simulate images of any magnitude. Therefore, obtaining the distortion coefficients is a key issue that cannot be avoided in order to achieve automatic correction of distorted images. Summary of the Invention

[0004] Aiming at the problem that it is difficult to determine the distortion coefficient when correcting distortion using the equivalent spherical perspective projection method, a reference image group is established, and the correlation coefficients between the standard image and the reference image are calculated and analyzed, thereby realizing the automatic extraction of the distortion coefficient of the distorted image and the automatic correction of the distorted image.

[0005] A method for automatically correcting distorted images includes: reading in a source image; generating a distorted image to be corrected; preprocessing the distorted image to be corrected to obtain a standard image; calculating a correlation coefficient of a pixel matrix between the standard image and each reference image in a reference image group; obtaining a distortion coefficient of the distorted image to be corrected; determining the distortion type, performing distortion correction, and outputting the corrected image.

[0006] The source image is a distorted image of any size that exhibits pincushion distortion or barrel distortion. If the source image exhibits pincushion distortion, interpolation or downsampling is used to convert it into a 768×768 pixel distorted image to be corrected. If the source image exhibits barrel distortion, interpolation or downsampling is used to convert it into a 256×256 pixel distorted image to be corrected. Preferably, the interpolation method is nearest neighbor interpolation, and the downsampling method is equal-interval sampling.

[0007] The preprocessing first sets a binarization threshold and performs a binarization operation on the distorted image to be corrected so that the pixel values ​​of the obtained binary image contain only two grayscale values ​​of "0" and "255". As a preferred method, the binarization threshold is 0.01; if the distorted image to be corrected contains barrel distortion, the nearest neighbor interpolation method is also used to expand the binary image pixels to 768×768.

[0008] The standard image refers to a binary image with 768×768 pixels obtained after preprocessing.

[0009] The reference image group contains 48 distorted images with preset different distortion coefficients, including 21 pincushion distortion reference images, where the distortion coefficients of the pincushion distortion reference images range from +150 to +350, and one image is set every 10; and 27 barrel distortion reference images, where, except for the first barrel distortion reference image with a distortion coefficient of -91, the distortion coefficients of the remaining barrel distortion reference images range from -100 to -350, and one image is set every 10.

[0010] The correlation coefficients are calculated respectively from the standard image and each reference image in the reference image group, and there are 48 correlation coefficients in total.

[0011] The distortion coefficient of the distorted image to be corrected is obtained by first obtaining the maximum value of the correlation coefficients. The reference image corresponding to the maximum correlation coefficient is called the best matching reference image, and the distortion coefficient of the best matching reference image is set as the distortion coefficient of the distorted image to be corrected.

[0012] The distortion correction is performed by determining whether the distortion type of the distorted image to be corrected is pincushion or barrel by checking the positive or negative value of the distortion coefficient of the distorted image to be corrected. The distortion correction is then performed using the distortion equivalent spherical model proposed by Han Guangliang and Song Jianzhong in "Image Distortion Correction Based on Distortion Equivalent Surfaces" published in the Journal of Optical Technology, Vol. 31, No. 1, January 2005, to achieve distortion correction and output a corrected image.

[0013] Compared with the original method, this method can realize automatic correction of distorted images. Not only does it not require manual adjustment of parameters to pursue the output effect, but the content of the distorted image will not affect the correction result. At the same time, the calculation is simple and the efficiency is high. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 It refers to the distorted image to be corrected, the standard image, the best matching reference image, and the corrected image in the barrel distortion correction process.

[0015] Figure 2 These are the distorted image to be corrected, the standard image, the best matching reference image, and the corrected image in the pincushion distortion correction process.

[0016] Figure 3A reference image group consisting of 48 reference images. DETAILED DESCRIPTION

[0017] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0018] The specific software environment of this embodiment is Windows 10 system, the simulation environment is Matlab R2018a, and the processor is the seventh-generation Core i5-7300.

[0019] A process of an automatic correction method for distorted images includes:

[0020] Read in the source image; generate the distorted image to be corrected; preprocess the distorted image to be corrected to obtain a standard image; calculate the correlation coefficient of the pixel matrix between the standard image and each reference image in the reference image group; obtain the distortion coefficient of the distorted image to be corrected; determine the distortion type, perform distortion correction and output the corrected image.

[0021] Example 1

[0022] A 256×256-pixel barrel-distorted image is selected as the source image for correction. The source image is of suitable size and does not require interpolation or downsampling. This is the distorted image to be corrected. The distorted image to be corrected is preprocessed to obtain a standard image. The correlation coefficient between the standard image and each reference image in the reference image set is calculated. The maximum correlation coefficient, 1.00, is found to identify the best-matching reference image. The distortion coefficient of the best-matching reference image is -150, so the distortion coefficient of the distorted image to be corrected is also -150. Distortion correction is performed and the corrected image is output.

[0023] In the preprocessing process, the distorted image to be corrected is first binarized, and the binarization threshold is set to 0.01 to obtain a binarized image; then the nearest neighbor interpolation method is used to set the pixel size of the binarized image to 768×768 to obtain a standard image.

[0024] The distorted image to be corrected, the standard image, the best matching reference image, and the corrected image are as follows: Figure 1 shown.

[0025] Example 2

[0026] A 768×768 pixel image with pincushion distortion is selected for correction. The distorted image to be corrected is preprocessed to obtain a standard image. The correlation coefficient between the standard image and each reference image in the reference image set is calculated. The maximum correlation coefficient, 1.00, is found, and the best matching reference image is determined. The distortion coefficient of the best matching reference image is +250, so the distortion coefficient of the distorted image to be corrected is also +250. Distortion correction is performed and the corrected image is output.

[0027] In the preprocessing process, the distorted image to be corrected is first binarized, and the binarization threshold is set to 0.01 to obtain a binarized image; the binarized image with a pixel size of 768×768 is the standard image.

[0028] The distorted image to be corrected, the standard image, the best matching reference image, and the corrected image are as follows: Figure 2 shown.

[0029] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. A person skilled in the art may make several modifications and improvements without departing from the principles of the present invention, which should also be considered as the scope of protection of the present invention.

Claims

1. A method for automatically correcting distorted images, characterized in that: include: Read in the source image; generating a distorted image to be corrected; and preprocessing the distorted image to be corrected to obtain a standard image; Calculating the correlation coefficient of the pixel matrix between the standard image and each reference image in the reference image group, obtaining the distortion coefficient of the distorted image to be corrected, performing distortion correction and outputting the corrected image; The source image is a distorted image of any size containing pincushion distortion or barrel distortion. If the source image contains pincushion distortion, it is set to a distorted image to be corrected with 768×768 pixels using an interpolation or downsampling method; if the source image contains barrel distortion, it is set to a distorted image to be corrected with 256×256 pixels using an interpolation or downsampling method. The preprocessing step first sets a binarization threshold and performs a binarization operation on the distorted image to be corrected, so that the pixel values ​​of the obtained binarized image contain only two grayscale values, "0" and "255". If the distorted image to be corrected contains barrel distortion, the pixels of the binarized image are further expanded to 768×768 using the nearest neighbor interpolation method. The standard image refers to the binarized image with a pixel size of 768×768 obtained after the preprocessing. The reference image group contains 48 distorted images with preset different distortion coefficients, including 21 pincushion distortion reference images, where the distortion coefficients of the pincushion distortion reference images range from +150 to +350, and one image is set every 10; and 27 barrel distortion reference images, where, except for the first barrel distortion reference image with a distortion coefficient of -91, the distortion coefficients of the remaining barrel distortion reference images range from -100 to -350, and one image is set every 10.

2. The method for automatically correcting distorted images according to claim 1, wherein: The correlation coefficients are obtained by respectively calculating the correlation coefficients of the pixel matrices between the standard image and each reference image in the reference image group, and there are 48 correlation coefficients in total.

3. The method for automatically correcting distorted images according to claim 1, wherein: The distortion coefficient of the distorted image to be corrected is obtained by first obtaining the maximum value of the correlation coefficients. The reference image corresponding to the maximum correlation coefficient is called the best matching reference image, and the distortion coefficient of the best matching reference image is set as the distortion coefficient of the distorted image to be corrected.

Citation Information

Patent Citations

  • Image processing method, terminal device and computer readable medium

    CN109785256A