Image correction processing method and device

By using two distortion sub-models with different viewing angles in the camera for image correction processing, the problem of inaccurate image correction in the existing technology is solved, the accuracy of image correction is improved, and the application of visual tasks is promoted.

CN112365421BActive Publication Date: 2024-09-06SUZHOU ZHITU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011264634.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-12
Publication Date
2024-09-06
Estimated Expiration
2040-11-12

AI Technical Summary

Technical Problem

Existing cameras use a unified internal parameter distortion model during image correction processing, which leads to the problem of over-correction or under-correction of images, affecting subsequent applications such as target detection and ranging.

Method used

Two different distortion sub-models are used: the first distortion sub-model is used for image points where the camera angle is less than or equal to the preset angle of view, and the second distortion sub-model is used for image points where the camera angle is greater than the preset angle of view. By calculating the Correction processing is performed based on the viewing angle, and models with strong and weak nonlinear distortion correction capabilities are used for precise correction.

Benefits of technology

It effectively reduces the problem of inaccurate correction caused by the same internal parameter model, improves the accuracy of image correction, and promotes ranging and detection applications in visual tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112365421B
    Figure CN112365421B
Patent Text Reader

Abstract

An embodiment of the present invention provides an image correction processing method and device, wherein the image viewing angle corresponding to each image point in the image to be processed can be calculated, and the image points in the image to be processed whose image viewing angle is less than or equal to a preset viewing angle can be corrected using a first distortion sub-model, and the image points whose image viewing angle is greater than the preset viewing angle can be corrected using a second distortion sub-model. Image points with different degrees of distortion can be accurately corrected using different distortion models, effectively reducing the problem of inaccurate correction caused by using the same internal reference distortion model to correct image points, thereby facilitating applications such as ranging or detection of visual tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of camera technology, and in particular to an image correction processing method and device. Background Art

[0002] Vision-based target perception is an important component of autonomous driving environment perception, among which camera internal parameter calibration is the most basic part of visual perception.

[0003] However, existing cameras all use a unified intrinsic distortion model for internal calibration. Therefore, when the camera performs distortion correction processing on the image points of the captured image, the same intrinsic parameter model is used to perform distortion correction processing on the image, regardless of whether it is an image closer to the center area of ​​the camera lens (with smaller image distortion) or an image closer to the center area of ​​the camera (with larger image distortion). As a result, the image may be over-corrected or under-corrected, affecting subsequent applications such as target detection or ranging using the image. Summary of the invention

[0004] In view of this, an object of the present invention is to provide an image correction processing method and device to alleviate the above technical problems.

[0005] In a first aspect, an embodiment of the present invention provides an image correction processing method, wherein the method is applied to a processor of a camera, the processor stores a pre-calibrated camera distortion optimization model, the camera distortion optimization model includes a first distortion sub-model and a second distortion sub-model, wherein the camera viewing angle corresponding to the first distortion sub-model is less than or equal to a preset viewing angle, the camera viewing angle corresponding to the second distortion sub-model is greater than the preset viewing angle, and the nonlinear distortion correction capability of the second distortion sub-model exceeds the nonlinear distortion correction capability of the first distortion sub-model; the method includes: acquiring an image to be processed; calculating the image viewing angle corresponding to each image point in the image to be processed, wherein the image viewing angle is the angle between the image point and the optical axis; using the first distortion sub-model to perform correction processing on image points whose image viewing angle is less than or equal to the preset viewing angle; and using the second distortion sub-model to perform correction processing on image points whose image viewing angle is greater than the preset viewing angle.

[0006] In combination with the first aspect, an embodiment of the present invention provides a first possible implementation method of the first aspect, wherein the step of calculating the image viewing angle corresponding to each image point in the image to be processed includes: taking each image point in the image to be processed as a target image point, and performing the following operations for each target image point: extracting the pixel coordinate information of the target image point to obtain the pixel coordinate information of the target image point; calculating the coordinate information of the target image point on the camera imaging surface based on the pixel coordinate information, the image center point coordinate information, and the pixel size; calculating the square value of the distance between the target image point and the image center point according to the coordinate information; and calculating the image viewing angle corresponding to the target image point based on the square value of the distance and the focal length.

[0007] In combination with the first possible implementation of the first aspect, the embodiment of the present invention provides a second possible implementation of the first aspect, wherein the coordinate information of the target image point on the camera imaging plane is calculated by the following formula: d =(x p -x c )*pixel_size;y d =(y p -y c )*pixel_size; where x p Represents the horizontal coordinate in the pixel coordinate information, y p The ordinate representing the pixel coordinate information, x d Represents the horizontal coordinate in the coordinate information on the camera imaging surface, y d Indicates the ordinate in the coordinate information on the camera imaging surface, pixel_size indicates the pixel size; x c Represents the horizontal coordinate in the coordinate information of the center point of the image, y c Represents the ordinate in the coordinate information of the center point of the image; the square value of the distance between the target image point and the center point of the image is calculated by the following formula: R 2 =(x d +y d ) 2 ; Where R represents the distance between the target image point and the center point of the image; the image viewing angle corresponding to the target image point is calculated by the following formula: θ out1 =arctan(R / f); where θ out1 Indicates the image viewing angle.

[0008] In combination with the first aspect, an embodiment of the present invention provides a third possible implementation of the first aspect, wherein the calibration step of the camera distortion optimization model includes: obtaining a checkerboard image set obtained by photographing a checkerboard from multiple angles by a camera; wherein the checkerboard image set includes multiple checkerboard images; calculating the corner point viewing angle according to the pixel coordinates of the corner points in the checkerboard image; wherein the corner point viewing angle is the angle between the corner point and the optical axis; all corner points in the checkerboard image set whose corner point viewing angle is less than or equal to a preset viewing angle constitute a first corner point pair set, and corner points whose corner point viewing angle is greater than the preset viewing angle constitute a second corner point pair set; wherein each first corner point pair in the first corner point set is composed of a corner point pixel coordinate and a corner point world coordinate, and each second corner point pair in the second corner point set is composed of a corner point pixel coordinate and a corner point world coordinate; using the first corner point pair set to calibrate a first internal parameter of the first distortion sub-model, and using the second corner point set to calibrate a second internal parameter of the second distortion sub-model, so as to obtain a calibrated camera distortion optimization model.

[0009] In combination with the third possible implementation of the first aspect, an embodiment of the present invention provides a fourth possible implementation of the first aspect, wherein, before calibrating the first intrinsic parameter of the first distortion sub-model using the first corner point pair set and calibrating the second intrinsic parameter of the second distortion sub-model using the second corner point set, the above method also includes: fitting the first distortion sub-model and the second distortion sub-model respectively based on a pre-stored distortion list to obtain the first intrinsic parameter initial value of the first distortion initial sub-model and the second intrinsic parameter initial value of the second distortion initial sub-model; wherein the distortion list stores multiple specific incident angles and paraxial distances corresponding to the specific incident angles, and the paraxial distance is the distance between the distorted image point and the center point of the image; calibrating the external parameters of the camera using the Zhang Zhengyou model to obtain the external parameter initial value; wherein the first distortion sub-model and the second distortion sub-model correspond to the same external parameter initial value.

[0010] In combination with the fourth possible implementation of the first aspect, an embodiment of the present invention provides a fifth possible implementation of the first aspect, wherein the steps of fitting the first distortion sub-model and the second distortion sub-model based on a pre-stored distortion list to obtain a first intrinsic parameter initial value of the first distortion initial sub-model and a second intrinsic parameter initial value of the second distortion initial sub-model include: calculating a target viewing angle corresponding to a specific incident angle based on the focal length of the camera and a paraxial distance corresponding to the specific incident angle; fitting a specific incident angle less than or equal to a preset viewing angle in the distortion list, and a target viewing angle corresponding to the specific incident angle, to the first distortion sub-model to obtain a first intrinsic parameter initial value of the first distortion sub-model; fitting a specific incident angle greater than the preset viewing angle in the distortion list, and a target viewing angle corresponding to the specific incident angle, to the second distortion sub-model to obtain a second intrinsic parameter initial value of the second distortion sub-model.

[0011] In combination with the fifth possible implementation of the first aspect, the embodiment of the present invention provides a sixth possible implementation of the first aspect, wherein the target viewing angle corresponding to a specific incident angle is calculated by the following formula: θ out =arctan(r d / f); where θ out represents the target viewing angle, r d represents the paraxial distance, and f represents the focal length of the camera.

[0012] In combination with the fourth possible implementation of the first aspect, an embodiment of the present invention provides a seventh possible implementation of the first aspect, wherein the step of calibrating the first intrinsic parameter of the first distorted sub-model using the first corner point pair set includes: calculating the reprojected pixel coordinates corresponding to each corner point based on the first intrinsic parameter initial value, the external parameter initial value and the first corner point pair set, and subtracting the coordinates from the actual pixel coordinates of the corner point to obtain a reprojection error; optimizing the first intrinsic parameter initial value and the external parameter initial value by minimizing the reprojection error to obtain the first internal parameter, so as to calibrate the first internal parameter of the first distorted sub-model.

[0013] In combination with the fourth possible implementation of the first aspect, an embodiment of the present invention provides an eighth possible implementation of the first aspect, wherein the step of calibrating the second internal parameter of the second distorted sub-model using the second corner point pair set includes: calculating the reprojected pixel coordinates of the corner point in each corner point pair based on the second internal parameter initial value, the external parameter initial value and the second corner point pair set, and subtracting the coordinates from the actual pixel coordinates of the corner point to obtain a reprojection error; optimizing the second internal parameter initial value and the external parameter initial value by minimizing the reprojection error to obtain the second internal parameter, so as to calibrate the second internal parameter of the second distorted sub-model.

[0014] In a second aspect, an embodiment of the present invention further provides an image correction processing device, wherein the device is applied to a processor of a camera, the processor stores a pre-calibrated camera distortion optimization model, the camera distortion optimization model includes a first distortion sub-model and a second distortion sub-model, wherein the camera viewing angle corresponding to the first distortion sub-model is less than or equal to a preset viewing angle, the camera viewing angle corresponding to the second distortion sub-model is greater than the preset viewing angle, and the nonlinear distortion correction capability of the second distortion sub-model exceeds the nonlinear distortion correction capability of the first distortion sub-model; the above-mentioned device includes: an acquisition module, used to acquire an image to be processed; a calculation module, used to calculate the image viewing angle corresponding to each image point in the image to be processed, wherein the image viewing angle is the angle between the image point and the optical axis; a first correction processing module, used to use the first distortion sub-model to perform correction processing on image points whose image viewing angle is less than or equal to the preset viewing angle; and a second correction processing module, used to use the second distortion sub-model to perform correction processing on image points whose image viewing angle is greater than the preset viewing angle.

[0015] The embodiments of the present invention bring the following beneficial effects:

[0016] An embodiment of the present invention provides an image correction processing method and device, wherein the image viewing angle corresponding to each image point in the image to be processed can be calculated, and the image points in the image to be processed whose image viewing angle is less than or equal to a preset viewing angle can be corrected using a first distortion sub-model, and the image points whose image viewing angle is greater than the preset viewing angle can be corrected using a second distortion sub-model. Image points with different degrees of distortion can be accurately corrected using different distortion models, effectively reducing the problem of inaccurate correction caused by using the same internal reference distortion model to correct image points, thereby facilitating applications such as ranging or detection of visual tasks.

[0017] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description and the drawings.

[0018] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 A flowchart of an image correction processing method provided by an embodiment of the present invention;

[0021] Figure 2 A flowchart of a camera distortion optimization model calibration method provided by an embodiment of the present invention;

[0022] Figure 3 A flowchart of another camera distortion optimization model calibration method provided by an embodiment of the present invention;

[0023] Figure 4 A schematic diagram of a distortion list provided by an embodiment of the present invention;

[0024] Figure 5 A schematic diagram of the structure of an image correction processing device provided by an embodiment of the present invention;

[0025] Figure 6 A schematic diagram of curve fitting provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0027] In order to solve the problem that the image is over-corrected or under-corrected when the same internal reference model is used to perform distortion correction on the image, an image correction processing method and device are provided in an embodiment of the present invention, which can alleviate the above technical problems.

[0028] To facilitate understanding of this embodiment, an image correction processing method disclosed in an embodiment of the present invention is first introduced in detail.

[0029] An embodiment of the present invention provides an image correction processing method, wherein the method is applied to a processor of a camera, the processor stores a pre-calibrated camera distortion optimization model, the camera distortion optimization model includes a first distortion sub-model and a second distortion sub-model, wherein the camera viewing angle corresponding to the first distortion sub-model is less than or equal to a preset viewing angle, the camera viewing angle corresponding to the second distortion sub-model is greater than the preset viewing angle, and the nonlinear distortion correction capability of the second distortion sub-model exceeds the nonlinear distortion correction capability of the first distortion sub-model.

[0030] The nonlinear distortion correction capability of the above model refers to the strength of the image correction degree. The stronger the nonlinear distortion correction capability, the stronger the image correction degree. Conversely, the weaker the correction degree. In actual use, the above preset viewing angle can be set according to actual needs and is not limited here.

[0031] See also Figure 1 The flowchart of an image correction processing method shown in FIG. 1 includes the following steps:

[0032] Step S102, obtaining an image to be processed;

[0033] The image to be processed is the image captured by the camera of the above-mentioned camera.

[0034] Step S104, calculating the image viewing angle corresponding to each image point in the image to be processed, wherein the image viewing angle is the angle between the image point and the optical axis;

[0035] In a specific implementation, each image point in the image to be processed may be used as a target image point, and the following operations from step A1 to step A4 are performed for each target image point to implement the calculation process of step S104:

[0036] Step A1, extracting pixel coordinate information of a target image point to obtain pixel coordinate information of the target image point;

[0037] The pixel coordinate information is the coordinate information in the pixel coordinate system, where the pixel coordinate system: the digital image captured by the camera can be stored as an array in the computer, and the value of each image point (pixel) in the array is the brightness (grayscale) of the image point. A rectangular coordinate system uv is defined on the image, and the coordinates (u, v) of each pixel are the column number and row number of the pixel in the array respectively. Therefore, (u, v) is the coordinate in the image coordinate system in pixels.

[0038] Step A2, calculating the coordinate information of the target image point on the camera imaging surface based on the pixel coordinate information, the image center point coordinate information, and the pixel size;

[0039] The coordinate information on the camera imaging surface is the coordinate information under the camera imaging surface coordinate system. Since the image coordinate system only indicates the number of columns and rows of pixels in the digital image, and does not use physical units to represent the physical position of the pixel in the image, it is necessary to establish an imaging plane coordinate system xy represented by physical units (such as centimeters and millimeters).

[0040] In this embodiment, the coordinate information of the target image point on the camera imaging surface is calculated by the following formula: d =(x p -x c )*pixel_size;y d =(y p -y c )*pixel_size; where x p Represents the horizontal coordinate in the pixel coordinate information, y p The ordinate representing the pixel coordinate information, x d Represents the horizontal coordinate in the coordinate information on the camera imaging surface, y d Indicates the ordinate in the coordinate information on the camera imaging surface, pixel_size indicates the pixel size; x c Represents the horizontal coordinate in the coordinate information of the center point of the image, y c Indicates the vertical coordinate in the coordinate information of the center point of the image.

[0041] Step A3, calculating the square value of the distance between the target image point and the image center point according to the coordinate information;

[0042] Specifically, the square of the distance between the target image point and the image center point is calculated by the following formula: 2 =(x d +y d ) 2 ; Where R represents the distance between the target image point and the image center point.

[0043] Step A4, calculating the image viewing angle corresponding to the target image point based on the squared distance value and the focal length.

[0044] The image viewing angle corresponding to the target image point is calculated by the following formula: θ out1 =arctan(R / f); where θ out1 Indicates the image viewing angle.

[0045] Step S106, using the first distortion sub-model to perform correction processing on image points whose image viewing angle is less than or equal to a preset viewing angle;

[0046] Step S108: using the second distortion sub-model to perform correction processing on image points whose image viewing angle is greater than a preset viewing angle.

[0047] Based on step S104, the image viewing angle corresponding to each image point in the image can be determined. Since the distortion of image points whose image viewing angle is less than or equal to the preset viewing angle is small, the first distortion sub-model with relatively weak nonlinear distortion correction ability can be used to correct it. The distortion of image points whose image viewing angle is greater than the preset viewing angle is large. Therefore, it is necessary to use the second distortion sub-model with relatively strong linear distortion correction ability to correct it, so as to avoid over-correction or under-correction of the image.

[0048] An embodiment of the present invention provides an image correction processing method, wherein the image viewing angle corresponding to each image point in the image to be processed can be calculated, and the image points in the image to be processed whose image viewing angle is less than or equal to a preset viewing angle can be corrected using a first distortion sub-model, and the image points whose image viewing angle is greater than the preset viewing angle can be corrected using a second distortion sub-model. Image points with different degrees of distortion can be accurately corrected using different distortion models, effectively reducing the problem of inaccurate correction caused by using the same internal reference distortion model to correct image points, thereby facilitating applications such as ranging or detection of visual tasks.

[0049] As one implementation method, the calibration steps of the camera distortion optimization model are described in detail below. Figure 2 A flow chart of a calibration method of a camera distortion optimization model is shown, and the method specifically comprises the following steps:

[0050] Step S202, obtaining a checkerboard image set obtained by photographing the checkerboard with a camera at multiple angles; wherein the checkerboard image set includes a plurality of checkerboard images;

[0051] Step S204, calculating the viewing angle of the corner point according to the pixel coordinates of the corner point in the checkerboard image; wherein the viewing angle of the corner point is the angle between the corner point and the optical axis;

[0052] The process of calculating the angle of view of the corner point is the same as the process of calculating the angle of view of the image (step A1 to step A4), so it will not be described in detail here.

[0053] Step S206, forming a first corner point pair set from all corner points in the checkerboard image set whose viewing angle is less than or equal to a preset viewing angle, and forming a second corner point pair set from corner points whose viewing angle is greater than the preset viewing angle; wherein each first corner point pair in the first corner point set is composed of a corner point pixel coordinate and a corner point world coordinate, and each second corner point pair in the second corner point set is composed of a corner point pixel coordinate and a corner point world coordinate;

[0054] The corner point pixel coordinates are the coordinates under the corner point pixel coordinates, and the corner point world coordinates are the coordinates under the world coordinate system, where the world coordinate system: selects a reference coordinate system in the environment to describe the position of the camera and the object.

[0055] Step S208, calibrating the first internal parameter of the first distortion sub-model using the first corner point pair set, and calibrating the second internal parameter of the second distortion sub-model using the second corner point set, so as to obtain a calibrated camera distortion optimization model.

[0056] In actual use, the first distortion submodel with a calibrated first internal parameter can be used to correct images with a viewing angle less than or equal to a preset viewing angle, and the second distortion submodel with a calibrated second internal parameter can be used to correct images with a viewing angle greater than the preset viewing angle.

[0057] In order to calibrate the first intrinsic parameter of the first distortion sub-model and the second intrinsic parameter of the second distortion sub-model faster and more accurately, in this embodiment, the initial value of the intrinsic parameter of the first distortion sub-model, the initial value of the intrinsic parameter of the second distortion sub-model and the initial value of the extrinsic parameter of the camera can be determined first. On the basis of the above embodiment, the embodiment of the present invention provides another calibration method for the camera distortion optimization model, see Figure 3 A flowchart of another camera distortion optimization model calibration method is shown, the method specifically comprising the following steps:

[0058] Step S302, obtaining a checkerboard image set obtained by photographing the checkerboard with a camera at multiple angles; wherein the checkerboard image set includes a plurality of checkerboard images;

[0059] Step S304, calculating the viewing angle of the corner point according to the pixel coordinates of the corner point in the checkerboard image; wherein the viewing angle of the corner point is the angle between the corner point and the optical axis;

[0060] Step S306, forming a first corner point pair set from all corner points in the checkerboard image set whose viewing angle is less than or equal to a preset viewing angle, and forming a second corner point pair set from corner points whose viewing angle is greater than the preset viewing angle; wherein each first corner point pair in the first corner point set is composed of a corner point pixel coordinate and a corner point world coordinate, and each second corner point pair in the second corner point set is composed of a corner point pixel coordinate and a corner point world coordinate;

[0061] Step S308, fitting the first distortion sub-model and the second distortion sub-model respectively based on the pre-stored distortion list to obtain a first internal parameter initial value of the first distortion initial sub-model and a second internal parameter initial value of the second distortion initial sub-model; wherein the distortion list stores a plurality of specific incident angles and paraxial distances corresponding to the specific incident angles, and the paraxial distance is the distance between the distorted image point and the center point of the image;

[0062] For ease of explanation, Figure 4 A schematic diagram of a distortion list is shown, such as Figure 4 As shown, the data in the first column represent a specific incident angle, which can be understood as the camera viewing angle, and the data in the second column are the paraxial distances between the distorted image point and the image center point. Figure 4 Only part of the data is shown in the figure to facilitate understanding.

[0063] Specific basis Figure 4 The process of fitting the first distortion sub-model and the second distortion sub-model with the data in , and obtaining the first internal parameter initial value of the first distortion initial sub-model and the second internal parameter initial value of the second distortion initial sub-model, can be implemented by steps B1 to B3:

[0064] Step B1, calculating the target viewing angle corresponding to the specific incident angle based on the focal length of the camera and the paraxial distance corresponding to the specific incident angle;

[0065] Specifically, the target viewing angle corresponding to a specific incident angle can be calculated by the following formula: θ out =arctan(r d / f); where θ out represents the target viewing angle, r d represents the paraxial distance, and f represents the focal length of the camera.

[0066] Step B2, fitting a specific incident angle in the distortion list that is less than or equal to a preset viewing angle and a target viewing angle corresponding to the specific incident angle to the first distortion sub-model, so as to obtain a first internal parameter initial value of the first distortion sub-model;

[0067] In this embodiment, the model formula of the first distortion sub-model is: Will Figure 4 A plurality of specific incident angles θ less than or equal to a preset viewing angle in , and with a specific incident angle θin The corresponding target viewing angle θ out Substitute into the above model formula to fit the coefficients k1, k2, k3, which are the first internal parameter initial values ​​of the first distortion sub-model.

[0068] Step B3, fitting the specific incident angle in the distortion list that is greater than the preset viewing angle and the target viewing angle corresponding to the specific incident angle to the second distortion sub-model to obtain a second internal parameter initial value of the second distortion sub-model.

[0069] The model formula of the second distortion sub-model is also: Will Figure 3 A plurality of specific incident angles θ greater than a preset viewing angle in , and with a specific incident angle θ in The corresponding target viewing angle θ out Substitute into the above model formula to fit the coefficients k4, k5, k6, which are the second internal parameter initial values ​​of the second distortion sub-model.

[0070] For ease of understanding, Figure 6 A schematic diagram of curve fitting is shown, with the calculated target viewing angle as the vertical axis and the specific incident angle as the horizontal axis, and the curve fitting is Figure 6 The fitting curves corresponding to the first distortion sub-model and the second distortion sub-model shown in , wherein the M1 fitting curve is the first distortion sub-model corresponding to a camera viewing angle less than or equal to a preset viewing angle (60°), and the M2 fitting curve is the first distortion sub-model corresponding to a camera viewing angle greater than the preset viewing angle (60°) and less than the viewing angle α 0 The second distortion submodel, where the viewing angle α 0 The viewing angle is greater than the preset viewing angle (60°).

[0071] Step S310, calibrating the extrinsic parameters of the camera using the Zhang Zhengyou model to obtain initial values ​​of the extrinsic parameters; wherein the first distortion sub-model and the second distortion sub-model correspond to the same initial value of the extrinsic parameters;

[0072] In this embodiment, the extrinsic parameters of the camera are calibrated using the Zhang Zhengyou model to obtain the initial values ​​of the extrinsic parameters, which is the same as the existing process of determining the extrinsic parameters of the camera using the Zhang Zhengyou model, and will not be described in detail here.

[0073] Step S312: calibrate the first internal parameter of the first distortion sub-model using the first corner point pair set, and calibrate the second internal parameter of the second distortion sub-model using the second corner point set, so as to obtain a calibrated camera distortion optimization model.

[0074] The process of calibrating the first intrinsic parameter of the first distortion sub-model using the first corner point pair set can be implemented by steps C1 to C3, specifically:

[0075] Step C1, based on the first intrinsic parameter initial value, the extrinsic parameter initial value and the first corner point pair set, the reprojected pixel coordinates corresponding to each corner point are calculated, and the difference is made with the real pixel coordinates of the corner point to obtain the reprojection error;

[0076] The calculation process of the reprojection error can be as follows: first determine the reprojected pixel coordinates of the corner point according to the world coordinates of the corner point according to the first intrinsic parameter initial value and the extrinsic parameter initial value of the current camera, and then perform difference calculation on the reprojected pixel coordinates of the corner point and the real pixel coordinates of the corner point to obtain the error corresponding to the corner point, wherein the real pixel coordinates of the corner point are the coordinates in the image coordinate system.

[0077] The process from the corner point world coordinates to the reprojected pixel coordinates can be calculated by the following formula:

[0078] c X=[R,P][x,y,0,1] T =[x',y',z',1] T (1);

[0079] in, c X is the coordinate of the corner point in the camera coordinate system, R is the rotation matrix of the chessboard relative to the camera, and P is the three-dimensional translation vector of the chessboard relative to the camera; x, y (the coordinates of the corner point in the x and y directions in the world coordinate system, and the z-axis coordinate of each chessboard square on the chessboard is 0 by default), x', y', z' (the coordinates of the corner point in the camera coordinate system);

[0080]

[0081]

[0082]

[0083] in, is the pixel coordinate of the corner point.

[0084] The calculation formula of the reprojection error is: is the actual pixel coordinate of the corner point. is the reprojected pixel coordinate); where i represents the number of corner points.

[0085] Step C2, optimizing the first internal parameter initial value and the external parameter initial value by minimizing the reprojection error to obtain the first internal parameter, so as to calibrate the first internal parameter of the first distortion sub-model.

[0086] Using the LM optimization method, optimize the function Get the first internal parameter {c x ,c y,f,k1,k2,k3}, specifically: According to the chain rule, based on Find out About R, T, f, c x , c y , partial derivatives of k1, k2, k3, calculate the Jacobian matrix J, construct the incremental equation, use the LM optimization method, iteratively calculate R, T, f, c x , c y , the optimal values ​​of k1, k2, and k3 are obtained, and the obtained optimal value is the first internal parameter calibrated by the first distortion sub-model. w X represents the world coordinates of the corner point.

[0087] The process of calibrating the second internal parameter of the second distortion sub-model using the second corner point pair set can be implemented by steps D1 to D3, specifically:

[0088] Step D1, based on the second intrinsic parameter initial value, the extrinsic parameter initial value and the second corner point pair set, calculate the reprojected pixel coordinates of the corner point in each corner point pair, and make a difference with the real pixel coordinates of the corner point to obtain a reprojection error;

[0089] The process of calculating the reprojection error of the second corner point to the concentrated corner point is the same as the above-mentioned process of calculating the reprojection error of the first corner point to the concentrated corner point, so it will not be described in detail here.

[0090] Step D2, optimizing the second internal parameter initial value and the external parameter initial value by minimizing the reprojection error to obtain the second internal parameter, so as to calibrate the second internal parameter of the second distortion sub-model.

[0091] In the process of calibrating the second internal reference, due to the c x , c y , f has been determined, so we only need to optimize the distortion parameters {k4, k5, k6} of the second internal parameter. Using the LM optimization method, we minimize the reprojection error to obtain the optimal values ​​of k4, k5, k6. The optimal values ​​are the second internal parameters calibrated by the second distortion sub-model. Specifically: According to the chain rule, we can respectively obtain With respect to the partial derivatives of k4, k5, and k6, calculate the Jacobian matrix J, construct the incremental equation, and use the LM optimization method to iteratively calculate the optimal values ​​of k4, k5, and k6.

[0092] Corresponding to the above method embodiment, an embodiment of the present invention provides an image correction processing device, wherein the device is applied to a processor of a camera, the processor stores a pre-calibrated camera distortion optimization model, the camera distortion optimization model includes a first distortion sub-model and a second distortion sub-model, wherein the camera viewing angle corresponding to the first distortion sub-model is less than or equal to a preset viewing angle, the camera viewing angle corresponding to the second distortion sub-model is greater than the preset viewing angle, and the nonlinear distortion correction capability of the second distortion sub-model exceeds the nonlinear distortion correction capability of the first distortion sub-model; Figure 5 A schematic diagram of the structure of an image correction processing device is shown in FIG. Figure 5 As shown, the device comprises:

[0093] An acquisition module 502 is used to acquire an image to be processed;

[0094] A calculation module 504 is used to calculate the image viewing angle corresponding to each image point in the image to be processed, wherein the image viewing angle is the angle between the image point and the optical axis;

[0095] A first correction processing module 506, configured to use a first distortion sub-model to perform correction processing on image points whose image viewing angle is less than or equal to a preset viewing angle;

[0096] The second correction processing module 508 is used to use the second distortion sub-model to perform correction processing on image points whose image viewing angle is greater than a preset viewing angle.

[0097] The image correction processing device provided in the embodiment of the present invention has the same technical features as the image correction processing method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.

[0098] The computer program product of the image correction processing device provided in the embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0099] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0100] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0101] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0102] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0103] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. An image correction processing method, It is characterized in that The method is applied to a camera processor, the processor stores a pre-calibrated camera distortion optimization model, the camera distortion optimization model includes a first distortion sub-model and a second distortion sub-model, wherein the camera viewing angle corresponding to the first distortion sub-model is less than or equal to a preset viewing angle, the camera viewing angle corresponding to the second distortion sub-model is greater than the preset viewing angle, and the nonlinear distortion correction capability of the second distortion sub-model exceeds the nonlinear distortion correction capability of the first distortion sub-model; the method includes: Get the image to be processed; Calculating the image viewing angle corresponding to each image point in the image to be processed, wherein the image viewing angle is the angle between the image point and the optical axis; Using the first distortion sub-model, correction processing is performed on image points whose image viewing angle is less than or equal to the preset viewing angle; Using the second distortion sub-model, correction processing is performed on image points whose image viewing angle is greater than the preset viewing angle; The step of calculating the image viewing angle corresponding to each image point in the image to be processed comprises: Each image point in the image to be processed is used as a target image point, and the following operations are performed for each target image point: Extracting pixel coordinate information of the target image point to obtain pixel coordinate information of the target image point; Calculate the coordinate information of the target image point on the camera imaging surface based on the pixel coordinate information, the image center point coordinate information, and the pixel size; Calculate the square value of the distance between the target image point and the image center point according to the coordinate information; The image viewing angle corresponding to the target image point is calculated based on the squared distance value and the focal length.

2. The method according to claim 1, It is characterized in that The coordinate information of the target image point on the camera imaging surface is calculated by the following formula: x d =(x p -x c ) *pixel_size;y d =(y p -y c ) *pixel_size; Among them, x p Indicates the horizontal coordinate in the pixel coordinate information, y p The ordinate representing the pixel coordinate information, x d Represents the horizontal coordinate in the coordinate information on the camera imaging surface, y d represents the ordinate in the coordinate information on the camera imaging surface, pixel_size represents the pixel size; x c Represents the horizontal coordinate in the coordinate information of the center point of the image, y c Represents the ordinate in the coordinate information of the center point of the image; The square value of the distance between the target image point and the image center point is calculated by the following formula: R 2 =(x d +y d ) 2 ; Where R represents the distance between the target image point and the center point of the image; The image viewing angle corresponding to the target image point is calculated by the following formula: θ out1 =arctan(R / f); Among them, θ out1 Represents the image viewing angle.

3. The method according to claim 1, It is characterized in that The calibration step of the camera distortion optimization model includes: Acquire a checkerboard image set obtained by photographing the checkerboard at multiple angles by the camera; wherein the checkerboard image set includes a plurality of checkerboard images; Calculating the viewing angle of the corner point according to the pixel coordinates of the corner point in the checkerboard image; wherein the viewing angle of the corner point is the angle between the corner point and the optical axis; All corner points in the checkerboard image set whose viewing angle is less than or equal to the preset viewing angle constitute a first corner point pair set, and the corner points whose viewing angle is greater than the preset viewing angle constitute a second corner point pair set; wherein each first corner point pair in the first corner point pair set is composed of a corner point pixel coordinate and a corner point world coordinate, and each second corner point pair in the second corner point pair set is composed of a corner point pixel coordinate and a corner point world coordinate; The first intrinsic parameter of the first distortion sub-model is calibrated using the first corner point pair set, and the second intrinsic parameter of the second distortion sub-model is calibrated using the second corner point pair set to obtain the calibrated camera distortion optimization model.

4. The method according to claim 3, It is characterized in that Before calibrating the first internal parameter of the first distorted sub-model by using the first corner point pair set and calibrating the second internal parameter of the second distorted sub-model by using the second corner point set, the method further includes: The first distortion sub-model and the second distortion sub-model are respectively fitted based on a pre-stored distortion list to obtain a first internal parameter initial value of the first distortion initial sub-model and a second internal parameter initial value of the second distortion initial sub-model; wherein the distortion list stores a plurality of specific incident angles and paraxial distances corresponding to the specific incident angles, and the paraxial distance is the distance between the distorted image point and the center point of the image; The extrinsic parameters of the camera are calibrated using the Zhang Zhengyou model to obtain initial values ​​of the extrinsic parameters; wherein the first distortion sub-model and the second distortion sub-model correspond to the same initial value of the extrinsic parameters.

5. The method according to claim 4, It is characterized in that The step of fitting the first distortion sub-model and the second distortion sub-model respectively based on a pre-stored distortion list to obtain a first internal parameter initial value of the first distortion initial sub-model and a second internal parameter initial value of the second distortion initial sub-model includes: Calculating a target viewing angle corresponding to the specific incident angle based on the focal length of the camera and a paraxial distance corresponding to the specific incident angle; Fitting the specific incident angle in the distortion list that is less than or equal to the preset viewing angle and the target viewing angle corresponding to the specific incident angle to the first distortion sub-model to obtain a first internal parameter initial value of the first distortion sub-model; The specific incident angle in the distortion list that is greater than the preset viewing angle and the target viewing angle corresponding to the specific incident angle are fitted to the second distortion sub-model to obtain a second internal parameter initial value of the second distortion sub-model.

6. The method according to claim 5, It is characterized in that The target viewing angle corresponding to the specific incident angle is calculated by the following formula: θ out =arctan(r d / f); Among them, θ out represents the target viewing angle, r d represents the paraxial distance, and f represents the focal length of the camera.

7. The method according to claim 4, It is characterized in that The step of calibrating the first intrinsic parameter of the first distortion sub-model by using the first corner point pair set includes: Based on the first intrinsic parameter initial value, the extrinsic parameter initial value and the first set of corner point pairs, calculate the reprojected pixel coordinates of the corner point in each corner point pair, and make a difference between the reprojected pixel coordinates and the real pixel coordinates of the corner point to obtain a reprojection error; The first internal parameter initial value and the external parameter initial value are optimized by minimizing the reprojection error to obtain the first internal parameter, so as to calibrate the first internal parameter of the first distortion sub-model.

8. The method according to claim 4, It is characterized in that The step of calibrating the second intrinsic parameter of the second distortion sub-model by using the second corner point pair set includes: Based on the second intrinsic parameter initial value, the extrinsic parameter initial value and the second set of corner point pairs, calculate the reprojected pixel coordinates of the corner point in each corner point pair, and make a difference between the reprojected pixel coordinates and the real pixel coordinates of the corner point to obtain a reprojection error; The second internal parameter initial value and the external parameter initial value are optimized by minimizing the reprojection error to obtain the second internal parameter, so as to calibrate the second internal parameter of the second distortion sub-model.

9. An image correction processing device, It is characterized in that The image correction processing method according to any one of claims 1 to 8 is applied to a camera processor, wherein the processor stores a pre-calibrated camera distortion optimization model, and the camera distortion optimization model includes a first distortion sub-model and a second distortion sub-model, wherein the camera viewing angle corresponding to the first distortion sub-model is less than or equal to a preset viewing angle, the camera viewing angle corresponding to the second distortion sub-model is greater than the preset viewing angle, and the nonlinear distortion correction capability of the second distortion sub-model exceeds the nonlinear distortion correction capability of the first distortion sub-model; the device includes: An acquisition module, used for acquiring an image to be processed; A calculation module, used to calculate the image viewing angle corresponding to each image point in the image to be processed, wherein the image viewing angle is the angle between the image point and the optical axis; A first correction processing module, used for performing correction processing on image points whose image viewing angle is less than or equal to the preset viewing angle by using the first distortion sub-model; The second correction processing module is used to use the second distortion sub-model to perform correction processing on image points whose image viewing angle is greater than the preset viewing angle.