CN114581335A - Image-based distortion removal method - Google Patents

Image-based distortion removal method Download PDF

Info

Publication number
CN114581335A
CN114581335A CN202210272195.XA CN202210272195A CN114581335A CN 114581335 A CN114581335 A CN 114581335A CN 202210272195 A CN202210272195 A CN 202210272195A CN 114581335 A CN114581335 A CN 114581335A
Authority
CN
China
Prior art keywords
image
distortion
distorted
center
distorted image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210272195.XA
Other languages
Chinese (zh)
Inventor
陈华云
沈海波
林琦
吴成淳
张艺玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Yungan Technology Co ltd
Original Assignee
Xiamen Yungan Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Yungan Technology Co ltd filed Critical Xiamen Yungan Technology Co ltd
Priority to CN202210272195.XA priority Critical patent/CN114581335A/en
Publication of CN114581335A publication Critical patent/CN114581335A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the technical field of image processing, in particular to a distortion removing method based on an image, S1, obtaining a distorted image, and extracting image characteristics of the distorted image to obtain image characteristic information of the distorted image; s2, optical center calculation: firstly, obtaining a good distorted image by using a method of straight line interception and equality, enabling the image distortion to be approximately symmetrical about a geometric center point of the image, accurately obtaining the center coordinates of dots on the edge of the distorted image by using an image processing technology, and using the centroid coordinates in the dot area as the center coordinates of the dots; s3, calculating the initial value of the distortion coefficient; s4, optimizing and solving the distortion coefficient; s5, reconstructing distorted images, wherein gray level reconstruction, namely gray level interpolation, must be carried out on the corrected images in order to obtain good corrected images.

Description

Image-based distortion removal method
Technical Field
The invention relates to the technical field of image processing, in particular to an image-based distortion removal method.
Background
The existing large-field short-focal-length lens generally has certain optical distortion in the imaging process, so that the quality of an imaged image is reduced due to certain changes in the size and shape of the imaged image, errors are brought to subsequent image analysis and image measurement, and even misjudgment is caused, and therefore an image-based distortion removal method is needed to improve the problems.
Disclosure of Invention
It is an object of the present invention to provide an image-based method for distortion removal to solve the above-mentioned problems in the background art.
In order to achieve the purpose, the invention provides the following technical scheme:
an image-based undistorting method, comprising the steps of:
s1, acquiring a distorted image, and extracting image characteristics of the distorted image to obtain image characteristic information of the distorted image;
s2, optical center calculation: firstly, obtaining a good distorted image by using a method of straight line interception and equality, enabling the image distortion to be approximately symmetrical about a geometric center point of the image, accurately obtaining the center coordinates of dots on the edge of the distorted image by using an image processing technology, and using the centroid coordinates in the dot area as the center coordinates of the dots;
s3, calculating an initial value of the distortion coefficient: simplifying the distortion correction model by using the first and second characteristics of optical imaging, respectively calculating distortion coefficients in the horizontal and vertical directions by using the second and third characteristics, and taking the average value of the distortion coefficients as an initial distortion coefficient;
s4, optimizing and solving the distortion coefficient: setting an objective function for obtaining an optimum distortion factor
Figure BDA0003554011650000011
Optimized solution is carried out, epsilon1And epsilon2Is represented as follows:
Figure BDA0003554011650000021
Figure BDA0003554011650000022
s5, distortion graph reconstruction: in order to obtain a good corrected image, the corrected image must be subjected to gray scale reconstruction, i.e., gray scale interpolation.
As a preferred aspect of the present invention, the acquiring a distorted image includes radial distortion and tangential distortion;
the radial distortion is caused by the inherent characteristics of the convex lens of the lens itself, resulting from the fact that the rays are more curved away from the center of the lens than close to the center;
the tangential distortion is generated because the lens itself is not parallel to the camera sensor plane (imaging plane) or the image plane, which is often caused by mounting deviation of the lens attached to the lens module.
As a preferred aspect of the present invention, the optical center is calculated by: fitting 4 unitary cubic curves in the horizontal and vertical directions respectively by using the centroid coordinate in the dot area as the central coordinate of the dot to obtain the mean value of inflection points of the 4 curves in each direction as the optical center of the CCD; and then moving the calibration template on the two-dimensional support so that the center of mass of the dot closest to the optical center is coincident with the optical center of the CCD.
As a preferable aspect of the present invention, the initial value of the distortion coefficient is obtained by: the dot pitch on the two straight lines should be equal without distortion.
As a preferable aspect of the present invention, the optimal solution of the distortion coefficient is: wherein epsilon1And epsilon2Respectively the corrected horizontal and vertical root mean square errors, epsilon is the radial root mean square error, and N is the number of sample points.
As a preferred embodiment of the present invention, the distortion pattern reconstruction: and carrying out gray level reconstruction on the multi-scale distorted image and the corresponding multi-scale image characteristic information by using weighted linear interpolation to obtain a distortion-removed image.
Compared with the prior art, the invention has the beneficial effects that:
1. according to the invention, gray level reconstruction is carried out on the corrected image through weighted linear interpolation, so that the correction precision of the distorted image is effectively improved, the gray level reconstruction error of the distorted image is reduced, firstly, an inflection point is calculated by using a unitary cubic curve to estimate an optical center, and the method is simple and accurate; then, an initial distortion coefficient is obtained on two mutually perpendicular lines of the optical center, so that the method is simple and easy to understand; then, an optimal distortion coefficient is obtained by utilizing an optimized objective function, and the method is accurate and efficient; and finally, carrying out gray level reconstruction by using weighted linear interpolation, so that the visual effect is good after the image is corrected, and the radial root mean square error of the gray level reconstruction is greatly reduced.
2. The method is simple, convenient and practical, does not depend on the internal parameters of the camera lens and a complex measuring device, and the corrected root mean square error and the gray level reconstruction root mean square error both reach a sub-pixel level.
Drawings
FIG. 1 is a flow chart of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts based on the embodiments of the present invention belong to the protection scope of the present invention.
In order that the invention may be readily understood, a more complete description of the invention briefly described above will be rendered by reference to the appended drawings, which illustrate several embodiments of the invention, but which are capable of being practiced in many different forms and are not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The invention provides a technical scheme that:
please refer to fig. 1, which illustrates an image-based distortion removal method, including the following steps:
s1, acquiring a distorted image, and extracting image characteristics of the distorted image to obtain image characteristic information of the distorted image;
s2, optical center calculation: firstly, obtaining a good distorted image by using a method of straight line interception and equality, enabling the image distortion to be approximately symmetrical about a geometric center point of the image, accurately obtaining the center coordinates of dots on the edge of the distorted image by using an image processing technology, and using the centroid coordinates in the dot area as the center coordinates of the dots;
s3, obtaining an initial value of the distortion coefficient: simplifying the distortion correction model by utilizing the first characteristic and the second characteristic of optical imaging, respectively solving distortion coefficients in the horizontal direction and the vertical direction by utilizing the second characteristic and the third characteristic, and taking the average value of the distortion coefficients as an initial distortion coefficient;
s4, optimizing and solving the distortion coefficient: setting an objective function for obtaining an optimum distortion factor
Figure BDA0003554011650000041
Optimized solution is carried out, epsilon1And ε2Is represented as follows:
Figure BDA0003554011650000042
Figure BDA0003554011650000043
s5, reconstruction of distortion graphics: in order to obtain a good corrected image, the corrected image must be subjected to gray level reconstruction, i.e., gray level interpolation.
Acquiring a distorted image comprising radial distortion and tangential distortion;
radial distortion is due to the intrinsic properties of the lens' own convex lens, resulting from rays being more curved away from the center of the lens than closer to the center;
the tangential distortion is caused by the fact that the lens itself is not parallel to the camera sensor plane (imaging plane) or the image plane, which is often caused by mounting deviations of the lens to the lens module.
Optical center calculation: fitting 4 unitary cubic curves in the horizontal and vertical directions respectively by using the centroid coordinate in the dot area as the central coordinate of the dot to obtain the mean value of inflection points of the 4 curves in each direction as the optical center of the CCD; and then moving the calibration template on the two-dimensional support so that the center of mass of the dot closest to the optical center is coincident with the optical center of the CCD.
The initial value of the distortion coefficient is obtained: the dot pitch on the two straight lines should be equal without distortion.
And (3) optimizing and solving the distortion coefficient: wherein epsilon1And ε2Respectively the corrected horizontal and vertical root mean square errors, epsilon is the radial root mean square error, and N is the number of sample points.
And (3) reconstructing a distorted graph: and carrying out gray level reconstruction on the multi-scale distorted image and the corresponding multi-scale image characteristic information by using weighted linear interpolation to obtain a distortion-removed image.
Example (b): acquiring a distorted image, and performing image feature extraction on the distorted image to obtain image feature information of the distorted image, wherein the acquired distorted image comprises radial distortion and tangential distortion, the radial distortion is caused by the inherent characteristics of a convex lens of a lens, the generation reason is that light rays are more bent at a position far away from the center of the lens than at a position close to the center, the tangential distortion is caused by the fact that the lens is not parallel to a camera sensor plane (imaging plane) or an image plane, and the condition is mostly caused by the installation deviation of the lens pasted on a lens module;
optical center calculation: firstly, obtaining a good distorted image by using a method of straight line interception equality, enabling the image distortion to be approximately symmetrical about a geometric central point of the image, accurately obtaining the central coordinates of dots on the edge of the distorted image by using an image processing technology, using the centroid coordinates in the dot area as the central coordinates of the dots, respectively fitting 4 unitary cubic curves in the horizontal direction and the vertical direction to obtain the mean value of inflection points of the 4 curves in each direction as the optical center of the CCD; then moving a calibration template on the two-dimensional support to ensure that the center of mass of a dot closest to the optical center is superposed with the optical center of the CCD;
the initial value of the distortion coefficient is obtained: simplifying the distortion correction model by utilizing the first characteristic and the second characteristic of optical imaging, respectively calculating distortion coefficients in the horizontal direction and the vertical direction by utilizing the second characteristic and the third characteristic, taking the average value of the distortion coefficients as the initial distortion coefficient, and under the condition of no distortion, the dot pitches on two straight lines are equal;
and (3) optimizing and solving the distortion coefficient: setting an objective function for obtaining an optimum distortion factor
Figure BDA0003554011650000061
Optimized solution is carried out, epsilon1And ε2Is represented as follows:
Figure BDA0003554011650000062
Figure BDA0003554011650000063
wherein epsilon1And epsilon2Respectively a corrected horizontal root mean square error and a corrected vertical root mean square error, wherein epsilon is a radial root mean square error, and N is the number of sample points;
reconstruction of a distorted graph: in order to obtain a good corrected image, gray level reconstruction, namely gray level interpolation, is carried out on the corrected image, and gray level reconstruction is carried out on the multi-scale distorted image and the corresponding multi-scale image characteristic information by using weighted linear interpolation to obtain a distortion-removed image;
gray level reconstruction is carried out on the corrected image through weighted linear interpolation, so that the accuracy of distorted image correction is effectively improved, the gray level reconstruction error of the distorted image is reduced, an inflection point is solved by using a unitary cubic curve to estimate an optical center, and the method is simple and accurate; then, an initial distortion coefficient is obtained on two mutually perpendicular lines of the optical center, so that the method is simple and easy to understand; then, an optimal distortion coefficient is obtained by utilizing an optimized objective function, and the method is accurate and efficient; and finally, gray level reconstruction is carried out by using weighted linear interpolation, so that the visual effect is good after the image is corrected, the radial root mean square error of the gray level reconstruction is greatly reduced, the method is simple, convenient and practical and does not depend on the internal parameters of a camera lens and a complex measuring device, and the corrected root mean square error and the gray level reconstruction root mean square error both reach a sub-pixel level.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (6)

1. An image-based de-distortion method, characterized by: the method comprises the following steps:
s1, acquiring a distorted image, and extracting image characteristics of the distorted image to obtain image characteristic information of the distorted image;
s2, optical center calculation: firstly, obtaining a good distorted image by using a method of straight line interception and equality, enabling the image distortion to be approximately symmetrical about a geometric center point of the image, accurately obtaining the center coordinates of dots on the edge of the distorted image by using an image processing technology, and using the centroid coordinates in the dot area as the center coordinates of the dots;
s3, calculating an initial value of the distortion coefficient: simplifying the distortion correction model by using the first and second characteristics of optical imaging, respectively calculating distortion coefficients in the horizontal and vertical directions by using the second and third characteristics, and taking the average value of the distortion coefficients as an initial distortion coefficient;
s4, optimizing and solving the distortion coefficient: setting an objective function for obtaining an optimum distortion factor
Figure FDA0003554011640000011
Optimized solution is carried out, epsilon1And ε2Is represented as follows:
Figure FDA0003554011640000012
Figure FDA0003554011640000013
s5, distortion graph reconstruction: in order to obtain a good corrected image, the corrected image must be subjected to gray scale reconstruction, i.e., gray scale interpolation.
2. An image based distortion removal method as claimed in claim 1, wherein: the acquiring of the distorted image comprises radial distortion and tangential distortion;
the radial distortion is due to the intrinsic characteristics of the convex lens of the lens itself, which arises because the rays are more curved away from the center of the lens than close to the center;
the tangential distortion is generated because the lens itself is not parallel to the camera sensor plane (imaging plane) or the image plane, which is often caused by mounting deviation of the lens attached to the lens module.
3. An image based distortion removal method as claimed in claim 1, wherein: the optical center calculation: fitting 4 unitary cubic curves in the horizontal and vertical directions respectively by using the centroid coordinate in the dot area as the central coordinate of the dot to obtain the mean value of inflection points of the 4 curves in each direction as the optical center of the CCD; and then moving the calibration template on the two-dimensional support so that the center of mass of the dot closest to the optical center is coincident with the optical center of the CCD.
4. An image based distortion removal method as claimed in claim 1, wherein: the initial value of the distortion coefficient is obtained: in the absence of distortion, the dot spacing on the two lines should be equal.
5. An image based distortion removal method as claimed in claim 1, wherein: and (3) optimizing and solving the distortion coefficient: wherein epsilon1And ε2Respectively the corrected horizontal and vertical root mean square errors, wherein epsilon is the radial root mean square error, and N is the number of sample points.
6. An image based distortion removal method as claimed in claim 1, wherein: and reconstructing the distorted image: and carrying out gray level reconstruction on the multi-scale distorted image and the corresponding multi-scale image characteristic information by using weighted linear interpolation to obtain a distortion-removed image.
CN202210272195.XA 2022-03-18 2022-03-18 Image-based distortion removal method Pending CN114581335A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210272195.XA CN114581335A (en) 2022-03-18 2022-03-18 Image-based distortion removal method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210272195.XA CN114581335A (en) 2022-03-18 2022-03-18 Image-based distortion removal method

Publications (1)

Publication Number Publication Date
CN114581335A true CN114581335A (en) 2022-06-03

Family

ID=81776907

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210272195.XA Pending CN114581335A (en) 2022-03-18 2022-03-18 Image-based distortion removal method

Country Status (1)

Country Link
CN (1) CN114581335A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114878583A (en) * 2022-07-08 2022-08-09 四川大学 Image processing method and system for dark field imaging of distorted spot lighting defects

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114878583A (en) * 2022-07-08 2022-08-09 四川大学 Image processing method and system for dark field imaging of distorted spot lighting defects
CN114878583B (en) * 2022-07-08 2022-09-20 四川大学 Image processing method and system for dark field imaging of distorted spot lighting defects

Similar Documents

Publication Publication Date Title
CN111260731B (en) Self-adaptive detection method for checkerboard sub-pixel level corner points
CN108764229B (en) Water gauge image automatic identification method based on computer vision technology
CN110675376A (en) PCB defect detection method based on template matching
CN114494045B (en) Large spur gear geometric parameter measurement system and method based on machine vision
CN112818988A (en) Automatic reading identification method and system for pointer instrument
CN113592955B (en) Round workpiece plane coordinate high-precision positioning method based on machine vision
CN111354047B (en) Computer vision-based camera module positioning method and system
JP2016205876A (en) Image recognition device
CN112101351B (en) Text line rotation correction method and device based on projection
CN114581335A (en) Image-based distortion removal method
CN113450418A (en) Improved method, device and system for underwater calibration based on complex distortion model
CN116503462A (en) Method and system for quickly extracting circle center of circular spot
CN111815580B (en) Image edge recognition method and small module gear module detection method
CN114387318A (en) Automatic remote sensing image registration method and device, electronic equipment and storage medium
CN113705564A (en) Pointer type instrument identification reading method
CN116958983A (en) Pointer type pressure gauge automatic calibrator indication reading method based on machine vision
CN114998571B (en) Image processing and color detection method based on fixed-size markers
CN116343215A (en) Inclination correction method and system for document image
CN115375576A (en) Image correction method for biological characteristic photoelectric scanning device
CN112414316B (en) Strain gauge sensitive grid size parameter measuring method
Xu et al. Research on machine vision-based reading method for pointer meters
CN116804532B (en) 3D measurement method for distance between parallel line segments
CN111199563B (en) Single crystalline silicon solar wafer image positioning method based on improved Hough transform algorithm
CN117455870B (en) Connecting wire and connector quality visual detection method
CN115115925B (en) MS-YOLOv3 industrial instrument reading detection method based on multi-scale feature information fusion

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination