CN111383194B - Polar coordinate-based camera distortion image correction method - Google Patents

Polar coordinate-based camera distortion image correction method Download PDF

Info

Publication number
CN111383194B
CN111383194B CN202010161965.4A CN202010161965A CN111383194B CN 111383194 B CN111383194 B CN 111383194B CN 202010161965 A CN202010161965 A CN 202010161965A CN 111383194 B CN111383194 B CN 111383194B
Authority
CN
China
Prior art keywords
image
distortion
polar
camera
jpg
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.)
Active
Application number
CN202010161965.4A
Other languages
Chinese (zh)
Other versions
CN111383194A (en
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.)
Jiangsu University of Science and Technology
Original Assignee
Jiangsu University of Science and Technology
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 Jiangsu University of Science and Technology filed Critical Jiangsu University of Science and Technology
Priority to CN202010161965.4A priority Critical patent/CN111383194B/en
Publication of CN111383194A publication Critical patent/CN111383194A/en
Application granted granted Critical
Publication of CN111383194B publication Critical patent/CN111383194B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T5/80
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/66Analysis of geometric attributes of image moments or centre of gravity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Abstract

The invention discloses a camera distortion image correction method based on polar coordinates, which comprises the steps of generating a calibration standard image, manufacturing a plane calibration plate, collecting the calibration distortion image, carrying out corner detection on the calibration standard image and the calibration distortion image, converting the calibration standard image and the calibration distortion image into polar coordinates, establishing a distortion correction equation of polar diameter and polar angle, solving distortion parameters, and carrying out image correction. The method can realize the distortion correction of the camera without acquiring an internal reference matrix of the camera, thereby correcting the image acquired by the camera; the method adopts the polar coordinate form, simplifies the distortion correction formula, reduces the difficulty of solving distortion parameters, and can improve the distortion correction precision of the camera.

Description

Polar coordinate-based camera distortion image correction method
Technical Field
The invention relates to an image processing technology, in particular to a method for correcting image distortion caused by camera distortion based on polar coordinates.
Background
Cameras produce distortion of the image during imaging due to machining and mounting errors. The distortion of the camera imaging mainly comprises three forms of radial distortion, tangential distortion and Bao Lengjing distortion. The calibration method is generally adopted as the checkerboard calibration method proposed by Zhang Zhengyou. In the calibration, according to the known size of the checkerboard, the rectangular coordinates of the corner points are determined, compared with the rectangular coordinates of the corner points in the distorted image of the camera, and the distortion coefficient is calculated.
Both radial and tangential aberrations are related to the distance of the image point from the center point. In practical applications, a quick correction of image distortion is required. According to the invention, radial and tangential distortion of the camera is directly analyzed and solved in a polar coordinate form, so that the image distortion caused by the camera distortion is corrected, the thought is clear, the distortion fitting formula is simplified, and the correction speed is improved.
Disclosure of Invention
The invention aims to: the invention aims to provide a novel polar coordinate-based camera calibration pattern and an image distortion correction method caused by camera distortion.
The technical scheme is as follows: the invention provides a camera distortion image correction method based on polar coordinates, which comprises the following steps:
(1) Manufacturing a calibration plate: drawing a calibration standard image PicCorrect. Jpg through computer programming, wherein the calibration standard image comprises two concentric circles and four rays starting from the circle center, and two of the four rays are vertical and two of the four rays are horizontal; manufacturing a plane calibration plate by using a calibration standard image;
(2) Collecting a calibration distortion image, extracting a calibration standard image and corner points of the calibration distortion image, and converting the calibration standard image and the corner points of the calibration distortion image into polar coordinates: the distorted image acquired by the plane calibration plate through the camera is a calibration distorted image PicCapt; respectively extracting pixel rectangular coordinates of corner points at the intersection points of concentric circles and four rays in the image by using a sub-pixel corner detection method; respectively taking the centers of concentric circles in PicCorrect. Jpg and PicCapt. Jpg as poles of polar coordinates, and constructing a polar coordinate system in the forward direction of the polar axis horizontally to the right; converting rectangular coordinates of the corner points obtained through detection into polar coordinates; matching the angular points detected in PicCorrect. Jpg and PicCapt. Jpg, and calibrating the polar coordinates of the angular points in the standard image to be
Figure BDA0002406126130000021
Calibrating polar coordinates of corner points in distorted images to be +.>
Figure BDA0002406126130000022
(3) Determining a distortion coefficient: the mean value of the polar paths of the angular points in PicCorrect. Jpg and PicCapt. Jpg are respectively counted and are respectively used for Mr c And Mr, the scaling factor of the two graphs is k 0 =Mr c Substituting polar coordinates of angular points except for the circle center in the two figures into the following correction equation respectively:
Figure BDA0002406126130000023
solving the equation to obtain a distortion correction coefficient k 1 ,k 2 ,k 3 ,k 4 ,k 5 ,k 6 And image deflection angle
Figure BDA0002406126130000024
/>
(4) Camera image distortion correction: collecting an image in the same plane as the calibration plate, recording as Pic2Revi. Jpg, taking the center of the Pic2Revi. Jpg image as a pole, constructing a polar coordinate system in a horizontal direction as a polar axis forward direction, and converting rectangular coordinates (x, y) of each pixel point into polar coordinates
Figure BDA0002406126130000025
Will->
Figure BDA0002406126130000026
Substituting into the correction equation to obtain corrected polar coordinates
Figure BDA0002406126130000027
Polar coordinates +.>
Figure BDA0002406126130000028
Converted into rectangular coordinates, denoted as (x) c ,y c ) And (5) making the pixel values before and after conversion equal, and interpolating the converted image to obtain a corrected image.
In the step (2), when the calibration distortion image is acquired, the center of the calibration distortion image is the center of a calibration circle in the calibration plate; the two sets of horizontal and vertical lines are as horizontal and vertical as possible.
In the step (3), the distortion correction coefficient k is calculated by a least square method 1 ,k 2 ,k 3 ,k 4 ,k 5 ,k 6 And image deflection angle
Figure BDA0002406126130000029
In the step (2), corner coordinates are extracted from the calibration standard image and the calibration distortion image by using a goodfeaturestrack () function in python software.
In the step (2), the corner points detected in the calibration standard image and the calibration distortion image are matched, and the specific steps are as follows:
ordering the angular points in PicCorrect. Jpg and PicCapt. Jpg according to the polar diameters from small to large, and ordering the angular points according to the polar angles with the same polar diameter from small to large; and after sorting, the corner numbers in PicCorrect. Jpg and PicCapt. Jpg are the same and are matched corner pairs.
The beneficial effects are that: compared with the prior art, the invention has the following advantages:
(1) The concentric circles and the rays from the circle center are used as the patterns of the calibration plate, so that the polar coordinate values of the corner points in the calibration standard image can be easily and accurately determined.
(2) The calibration standard image is also subjected to angular point detection and the polar coordinates of the angular points are obtained, so that the accuracy and the error of an angular point detection algorithm and coordinate conversion can be checked, and the error caused by the accuracy of the angular point detection algorithm is reduced.
(3) The ratio of the average value of the polar diameters of all the angular points in the calibration standard image and the calibration distortion image is used as the scaling factor of the two images, and compared with the scaling factor obtained by using the polar diameter of only one point, the error of scaling factor estimation is reduced.
(4) Since all the radial distortion correction formulas and tangential distortion correction formulas are in the form of polar coordinates, the radial distortion correction formulas and tangential distortion correction formulas can be directly expressed as correction formulas of polar diameter and polar angle:
Figure BDA0002406126130000031
the equation does not contain coupling terms any more, so that the solution of the coefficients is simplified, and the solution precision is improved. The center of the pattern is aligned with the "+" of the center of the image when photographing, thus eliminatingBesides the offset of the center point, the polar diameter correction formula is simplified; the two rays are as horizontal as possible, but still have small angle deviation, and parameters are added in the formula
Figure BDA0002406126130000032
The method is used for eliminating the deviation of the integral rotation of the pattern in the solving process, and ensures the accuracy of distortion parameter solving.
Drawings
FIG. 1 is a general flow chart of the present invention for a polar coordinate based camera distortion correction method;
FIG. 2 is a calibration standard image based on polar coordinates;
FIG. 3 is a schematic illustration of center alignment during calibration plate image acquisition;
fig. 4 is a schematic diagram of the result of corner detection on a calibration distorted image.
Detailed Description
The technical scheme of the present invention is described in detail below, but the scope of the present invention is not limited to the embodiments.
As shown in fig. 1, the method for correcting a camera distortion image based on polar coordinates of the present invention comprises the following steps:
(1) Manufacturing a calibration plate: two concentric circles and four rays from the center of the circle are drawn through computer programming, wherein two of the two rays are vertical and two of the two rays are horizontal. The standard image was saved as PicCorrect. Jpg picture, as shown in FIG. 2, which was later analyzed as an undistorted image; and printing the picture, adhering the picture on a wood board to serve as a calibration board, and collecting an image by a camera and correcting distortion.
(2) Extracting the coordinates of corner points of two images, and converting to obtain polar coordinates: the distorted image acquired by the calibration plate through the camera is stored as PicCapt. Jpg, the PicCorrect. Jpg and PicCapt. Jpg are utilized to simultaneously extract the pixel rectangular coordinates of the corner points at the intersection point of the concentric circles and the rays of the two images by using a sub-pixel corner point detection method, the circle center is used as the origin of the polar coordinates, and the polar coordinates of all the corner points in the two images are obtained through conversion from the rectangular coordinate system to the polar coordinate system and are respectively expressed as
Figure BDA0002406126130000041
And->
Figure BDA0002406126130000042
(3) Determining a distortion coefficient: the mean value of the polar paths of the corner points in PicCorrect. Jpg and PicCapt. Jpg is counted by Mr respectively c And Mr, the scaling factor of the two graphs is k 0 =Mr c And (2) Mr, sorting the polar coordinates of 8 angular points except for the circle center in the two graphs from small to large according to polar diameters, sorting the polar points with the same polar diameters from small to large according to polar angles, completing corresponding matching of the 8 angular points in the two graphs, and substituting the polar coordinates into the following two equations respectively:
Figure BDA0002406126130000043
solving the equation to obtain a distortion correction coefficient k 1 ,k 2 ,k 3 ,k 4 ,k 5 ,k 6 And image deflection angle
Figure BDA0002406126130000044
(4) Camera image distortion correction: collecting any image of the calibration plate in the same plane, marking as Pic2Revi. Jpg, taking the center of the image as the origin of coordinates, converting the rectangular coordinates (x, y) of each point into polar coordinates, substituting the polar coordinates into the correction equation obtained in the step (3), obtaining corrected polar coordinates, converting the polar coordinates into rectangular coordinates, marking as (x) c ,y c ) Let the pixel values before and after conversion be equal, i.e. f (x c ,y c ) =f (x, y), interpolates the converted image, resulting in a corrected image.
Example 1:
in this embodiment, the algorithm of python+opencv is used to implement design and distortion correction of the pattern.
The calibration standard pattern adopts two concentric circles with different radiuses and four rays which start from the circle center, two horizontal rays and two vertical rays, and is shown in figure 2. The calibration pattern drawn by the python software was saved as PicCorrect. Jpg. Printing the pattern, adhering the pattern on a flat wood board, and collecting an image of the pattern by using a camera. The center of the image acquisition area is set to be "+" through software, the calibration plate is moved to enable the circle center in the calibration plate to coincide with "+", and meanwhile, when two horizontal rays are horizontally placed as much as possible, an image is acquired, and in FIG. 3, the acquired image is stored as PicCapt.
And converting PicCorrect. Jpg and PicCapt. Jpg into gray images, setting the number of corner points to be 9, and extracting rectangular coordinates of sub-pixel corner points by using a goodfeaturesToTrack () function, wherein the corner point detection result of PicCapt. Jpg is shown in figure 4. And taking a corner point at the center of a circle as a pole, taking the horizontal direction as the positive direction of a polar axis, and respectively constructing a polar coordinate system in PicCorrect. Jpg and PicCapt.
The average value of the polar diameters of 9 angular points in PicCorrect. Jpg and PicCapt. Jpg is obtained respectively by Mr c And Mr, the scaling factor of the two graphs is k 0 =Mr c /Mr. The scaling factor reflects how far or how far the calibration plate is from the camera. The polar coordinates of 8 angular points except the circle center in the two figures are firstly ordered according to the polar diameters from small to large, the polar diameters are the same and ordered according to the polar angles from small to large, so that the 8 angular points in the two figures are matched correspondingly, and then the following calibration equations are substituted respectively:
Figure BDA0002406126130000051
solving the variable k for equation (1) 1 ,k 2 ,k 3 The coefficient matrix is
Figure BDA0002406126130000052
The equation is converted into:
Figure BDA0002406126130000053
then using lstqr to obtain k by least square method 1 ,k 2 ,k 3 Is a solution to (a).
For equation (2), to
Figure BDA0002406126130000054
And k 4 ,k 5 ,k 6 Solving as variables, the coefficient matrix is +>
Figure BDA0002406126130000055
The equation is converted into:
Figure BDA0002406126130000056
then using lstqr to obtain
Figure BDA0002406126130000057
And k 4 ,k 5 ,k 6 Is a solution to (a). In this embodiment, the coefficient k obtained by equations (1) and (2) 1 ,k 2 ,k 3 And k 4 ,k 5 ,k 6 The values differ slightly and are therefore regarded as identical parameters. If the distortion correction accuracy is high, the distortion correction parameters can be treated as different distortion correction parameters.
Any image in the same plane as the calibration plate is collected and marked as Pic2Revi. Jpg, and a polar coordinate system is constructed with the center of the image as a pole and the horizontal direction as the polar axis forward direction; converting rectangular coordinates (x, y) of each pixel point into polar coordinates, and recording as
Figure BDA0002406126130000058
Substituting into the previous correction equations (1) and (2) to obtain corrected polar coordinates +.>
Figure BDA0002406126130000059
The polar coordinates are converted into rectangular coordinates, which are denoted as (x) c ,y c ) Let the pixel values before and after conversion be equal, i.e. f (x c ,y c ) =f (x, y), interpolates the converted image, resulting in a corrected image. />

Claims (5)

1. A camera distortion image correction method based on polar coordinates is characterized by comprising the following steps: the method sequentially comprises the following steps of:
(1) Manufacturing a calibration plate: drawing two concentric circles and four rays from the circle center as standard images through computer programming, wherein the four rays are two vertical rays and two horizontal rays; storing the standard image as PicCorrect. Jpg picture, and analyzing the PicCorrect. Jpg picture as an undistorted image; printing the standard image, adhering the standard image on a wood board to serve as a calibration board, and collecting the image by a camera and correcting distortion;
(2) Extracting the coordinates of corner points of two images, and converting to obtain polar coordinates: the distorted image acquired by the calibration plate through the camera is stored as PicCapt. Jpg, the PicCorrect. Jpg and PicCapt. Jpg are utilized to simultaneously extract the pixel rectangular coordinates of the corner points at the intersection point of the concentric circles and the rays of the two images by using a sub-pixel corner point detection method, the circle center is used as the origin of the polar coordinates, and the polar coordinates of all the corner points in the two images are obtained through conversion from the rectangular coordinate system to the polar coordinate system and are respectively expressed as
Figure FDA0004059033000000011
And->
Figure FDA0004059033000000012
(3) Determining a distortion coefficient: the mean value of the polar paths of the corner points in PicCorrect. Jpg and PicCapt. Jpg is counted by Mr respectively c And Mr, the scaling factor of the two graphs is k 0 =Mr c And (2) substituting polar coordinates of angular points except for the circle center in the two figures into the following two correction equations respectively:
Figure FDA0004059033000000013
solving the equation to obtain a distortion correction coefficient k 1 ,k 2 ,k 3 ,k 4 ,k 5 ,k 6 And image deflection angle
Figure FDA0004059033000000014
(4) Camera image distortion correction: any image of the calibration plate in the same plane is collected and recorded as Pic2Revi. Jpg, and rectangular coordinates (x, y) of each point are converted into polar coordinates by taking the center of the image as the origin of coordinates
Figure FDA0004059033000000015
Will->
Figure FDA0004059033000000016
Substituting into the correction equation in the step (3) to obtain corrected polar coordinates +.>
Figure FDA0004059033000000017
Polar coordinates +.>
Figure FDA0004059033000000018
Converted into rectangular coordinates, denoted as (x) c ,y c ) Let the pixel values before and after conversion be equal, i.e. the pixel value at (x, y) is equal to (x) c ,y c ) Pixel values at the positions are equal; and interpolating the converted image to obtain a corrected image.
2. The method for correcting a camera distortion image based on polar coordinates according to claim 1, wherein: in the step (1), a radial combined pattern which is formed by concentric circles and starts from the circle center is used as a calibration plate pattern; the concentric circles and ray patterns generated by the program are stored as images, can be used as correction standards of undistorted images and can also be used as evaluation standards of the accuracy of subsequent algorithms; the printed pattern is used as a calibration plate, the center of an image is marked with a "+" when the camera collects, so that the pattern is aligned with the center of the pattern, two groups of horizontal lines and vertical lines are horizontal and vertical as much as possible, and the collected image is used for solving the distortion coefficient of the camera.
3. The method for correcting a camera distortion image based on polar coordinates according to claim 1, wherein: in the step (2), since the radius of each concentric circle and the polar angle of each ray in the standard pattern PicCorrect. Jpg drawn by the program are known, the polar coordinates of all the corner points of the concentric circles and the rays are known, and the polar coordinates can be used for subsequent camera calibration.
4. The method for correcting a camera distortion image based on polar coordinates according to claim 1, wherein: in the step (3), a formula is adopted
Figure FDA0004059033000000021
Describing a functional relation between the polar diameter of the camera and the polar angle before and after distortion correction; determining the scaling factor k of the statistics PicCorrect. Jpg and PicCapt. Jpg by the ratio of the mean values of the polar diameters of the same points 0 The method comprises the steps of carrying out a first treatment on the surface of the After the standard image and the distorted image are aligned by the "+" center, only parameters are needed
Figure FDA0004059033000000022
Describing a fixed deflection angle; parameter k 1 ,k 2 ,k 3 And k 4 ,k 5 ,k 6 The magnitude of the distortion of the pole diameter and the pole angle with the increase of the pole diameter and the pole angle order is reflected respectively.
5. The method for correcting a camera distortion image based on polar coordinates according to claim 1, wherein: in the step (4), the distortion correction of the image acquired by the camera is completed by adopting rectangular coordinates to polar coordinates and then adopting the conversion from the polar coordinates to the rectangular coordinates.
CN202010161965.4A 2020-03-10 2020-03-10 Polar coordinate-based camera distortion image correction method Active CN111383194B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010161965.4A CN111383194B (en) 2020-03-10 2020-03-10 Polar coordinate-based camera distortion image correction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010161965.4A CN111383194B (en) 2020-03-10 2020-03-10 Polar coordinate-based camera distortion image correction method

Publications (2)

Publication Number Publication Date
CN111383194A CN111383194A (en) 2020-07-07
CN111383194B true CN111383194B (en) 2023-04-21

Family

ID=71219853

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010161965.4A Active CN111383194B (en) 2020-03-10 2020-03-10 Polar coordinate-based camera distortion image correction method

Country Status (1)

Country Link
CN (1) CN111383194B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102655947B1 (en) * 2020-09-03 2024-04-11 세메스 주식회사 Apparatus for treating substrate and method for treating apparatus
CN113435559B (en) * 2021-08-27 2021-12-14 深圳企业云科技股份有限公司 Label anti-transfer method based on computer vision recognition
CN113808220A (en) * 2021-09-24 2021-12-17 上海闻泰电子科技有限公司 Calibration method and system of binocular camera, electronic equipment and storage medium
CN115905237B (en) * 2022-12-09 2024-03-22 江苏泽景汽车电子股份有限公司 Image processing method, device, HUD and storage medium
CN116342435B (en) * 2023-05-30 2023-08-22 合肥埃科光电科技股份有限公司 Distortion correction method for line scanning camera, computing equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100493207C (en) * 2007-03-14 2009-05-27 北京理工大学 Distortion measurement and correction method for CCD shooting system and comprehensive test target
JP5385740B2 (en) * 2009-09-25 2014-01-08 キヤノン株式会社 Imaging apparatus and image data correction method
CN102750697B (en) * 2012-06-08 2014-08-20 华为技术有限公司 Parameter calibration method and device
CN106780374B (en) * 2016-12-01 2020-04-24 哈尔滨工业大学 Fisheye image distortion correction method based on fisheye imaging model
CN109345461A (en) * 2018-09-30 2019-02-15 中国科学院长春光学精密机械与物理研究所 A kind of image distortion correction method, apparatus, equipment and storage medium

Also Published As

Publication number Publication date
CN111383194A (en) 2020-07-07

Similar Documents

Publication Publication Date Title
CN111383194B (en) Polar coordinate-based camera distortion image correction method
CN110276808B (en) Method for measuring unevenness of glass plate by combining single camera with two-dimensional code
CN109272570B (en) Space point three-dimensional coordinate solving method based on stereoscopic vision mathematical model
CN111243033B (en) Method for optimizing external parameters of binocular camera
CN111369630A (en) Method for calibrating multi-line laser radar and camera
CN109859272B (en) Automatic focusing binocular camera calibration method and device
CN107633536A (en) A kind of camera calibration method and system based on two-dimensional planar template
CN109544628B (en) Accurate reading identification system and method for pointer instrument
CN109272555B (en) External parameter obtaining and calibrating method for RGB-D camera
WO2021129437A1 (en) Method and system for light calibration field camera without requiring white image
CN112489137A (en) RGBD camera calibration method and system
CN113129384B (en) Binocular vision system flexible calibration method based on one-dimensional coding target
CN114359405A (en) Calibration method of off-axis Samm 3D line laser camera
CN112598747A (en) Combined calibration method for monocular camera and projector
CN108550171B (en) Linear array camera calibration method containing eight-diagram coding information based on cross ratio invariance
CN113012234A (en) High-precision camera calibration method based on plane transformation
CN113610929B (en) Combined calibration method of camera and multi-line laser
CN116309829A (en) Cuboid scanning body group decoding and pose measuring method based on multi-view vision
CN111699513B (en) Calibration plate, internal parameter calibration method, machine vision system and storage device
Zhang et al. Improved Camera Calibration Method and Accuracy Analysis for Binocular Vision
CN116381712A (en) Measurement method based on linear array camera and ground laser radar combined device
CN112489141B (en) Production line calibration method and device for single-board single-image strip relay lens of vehicle-mounted camera
CN112950723B (en) Robot camera calibration method based on edge scale self-adaptive defocus fuzzy estimation
CN115601441A (en) Geometric parameter calibration method for focusing type light field camera
CN112102419A (en) Calibration method and system of dual-light imaging equipment and image registration method

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
GR01 Patent grant
GR01 Patent grant