A fisheye image correction method based on the power series expansion method
By calculating the coefficients of the fish eye lens based on the power series expansion method, the problem of large error in the correction of fish eye images in the prior art is solved, and a more accurate and applicable correction effect is achieved.
Patent Information
- Application Number
- CN202210211695.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-04
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2042-03-04
AI Technical Summary
The existing fish eye lens image correction methods have large errors and different lenses cannot use the same parameters, resulting in unsatisfactory correction results.
The fish eye image correction method based on the power series expansion method is adopted. By obtaining the chessboard pattern pictures taken by the same fish eye lens, the distance from the corner point to the center of the picture and the projection angle are calculated, the coefficient of the power series expansion formula of the fish eye lens is calculated, and the coefficient with the best correction effect is selected as the correction parameter.
It realizes more accurate fish eye picture correction, reduces correction errors, and is suitable for different fish eye lenses, making it easy to save and apply correction parameters.
Smart Images

Figure CN114549295B_ABST
Abstract
Description
Technical Field
[0001] The present invention discloses a method, which relates to the technical field of image processing, and specifically is a method for correcting fish-eye images based on the power series expansion method. Background Art
[0002] The viewing angle of a fish-eye lens is extremely wide and it has applications in various fields. However, due to the distortion problem during the imaging process of the fish-eye lens, the photos taken by the lens cannot be directly applied. Therefore, it must be corrected to obtain a corrected image.
[0003] Currently, the common correction method is to use the calibration method to correct the distorted image by obtaining the internal conversion parameters of the lens camera. Generally speaking, there are certain errors in the correction of this method, and the same parameters cannot be used for different lenses. Summary of the Invention
[0004] In view of the problems of the prior art, the present invention provides a method for correcting fish-eye images based on the power series expansion method. The specific solution proposed by the present invention is as follows:
[0005] The present invention provides a method for correcting fish-eye images based on the power series expansion method, which acquires an image containing a complete chessboard pattern taken by the same fish-eye lens.
[0006] According to the corner points of the chessboard in the image, obtain the distance from the corner points to the center of the image.
[0007] According to the distance, the projection exit angle and the projection incident angle of the corner points, calculate the coefficients of the power series expansion formula of the fish-eye lens, and use the coefficients to perform cyclic test correction on the image.
[0008] Select the coefficients corresponding to the image with the best correction effect as the correction parameters of the fish-eye lens for fish-eye image correction.
[0009] Further, in the method for correcting fish-eye images based on the power series expansion method, the step of obtaining the distance from the corner points of the chessboard in the image to the center of the image includes:
[0010] Obtain the position coordinates of the corner points according to the world coordinate system and the image coordinate system.
[0011] Calculate the distance from the corner points to the center of the image by using the position coordinates of the corner points.
[0012] Further, in the method for correcting fish-eye images based on the power series expansion method, the step of calculating the coefficients of the power series expansion formula of the fish-eye lens according to the distance includes:
[0013] The projection exit angle of the corner point is calculated based on the distance and the equivalent focal length of the fisheye lens, the projection incident angle of the corner point is calculated based on the position coordinates of the corner point in the world coordinate system, and the coefficients of the power series expansion are calculated based on the projection exit angle and the projection incident angle of the corner point.
[0014] Further, in the fisheye image correction method based on the power series expansion method, the loop test correction of the image using the coefficients includes:
[0015] The average value of each coefficient is taken respectively, and the value of each coefficient is adjusted within a certain value range for the loop test of the image.
[0016] Further, the loop test of the image in the fisheye image correction method based on the power series expansion method includes:
[0017] For each loop test, the value of a certain coefficient is increased until the values of all the coefficients reach the maximum value within the value range.
[0018] Further, in the fisheye image correction method based on the power series expansion method, the selection of the coefficients corresponding to the image with the optimal correction effect as the correction parameters of the fisheye lens includes:
[0019] The distance from the corner point of the corrected image to the center of the image is obtained, and the difference is taken from the distance from the corner point of the corresponding uncorrected image to the center of the image. The difference is used as the error, and the average value of the errors is obtained. The coefficients corresponding to the corrected image with the smallest average value of the errors are selected as the correction parameters of the fisheye lens.
[0020] The present invention also provides a fisheye image correction device based on the power series expansion method, including an acquisition module and an analysis and calculation module.
[0021] The acquisition module acquires an image containing a complete chessboard pattern taken by the same fisheye lens.
[0022] The analysis and calculation module obtains the distance from the corner point of the chessboard in the image to the center of the image.
[0023] Based on the distance, the projection exit angle and the projection incident angle of the corner point, the coefficients of the power series expansion of the fisheye lens are calculated, and the loop test correction of the image is performed using the coefficients.
[0024] The coefficients corresponding to the image with the optimal correction effect are selected as the correction parameters of the fisheye lens for fisheye image correction.
[0025] Further, in the fisheye image correction device based on the power series expansion method, the analysis and calculation module calculates the coefficients of the power series expansion of the fisheye lens according to the distance, including:
[0026] The projection exit angle of the corner point is calculated based on the distance and the equivalent focal length of the fisheye lens, the projection incident angle of the corner point is calculated based on the position coordinates of the corner point in the world coordinate system, and the coefficients of the power series expansion are calculated based on the projection exit angle and the projection incident angle of the corner point.
[0027] Furthermore, in the fisheye image correction device based on the power series expansion method, the analysis and calculation module uses the coefficients to perform cyclic test correction on the image, including:
[0028] The average value of each coefficient is taken respectively, and the value of each coefficient is adjusted within a certain value range to perform cyclic test on the image. Each time a cyclic test is performed, the value of a certain coefficient is increased until the values of all the coefficients reach the maximum value within the value range.
[0029] Furthermore, in the fisheye image correction device based on the power series expansion method, the analysis and calculation module selects the coefficients corresponding to the image with the optimal correction effect as the correction parameters of the fisheye lens, including:
[0030] The distance from the corner point of the corrected image to the center of the image is obtained, the difference from the distance from the corner point of the corresponding uncorrected image to the center of the image is taken, and the difference is used as the error. The average value of the errors is obtained, and the coefficients corresponding to the corrected image with the smallest average value of the errors are selected as the correction parameters of the fisheye lens.
[0031] The beneficial effects of the present invention are:
[0032] The present invention provides a fisheye image correction method based on the power series expansion method. Based on the fisheye imaging principle, the imaging projection process is expanded by power series to obtain the image distortion coefficients. The coefficients are optimized through cyclic correction to obtain better correction coefficients, which is convenient for image correction of any fisheye lens image. Not only is the image easy to correct with small errors, but it is also convenient to save the correction parameters for different fisheye lenses. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for description in the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0034] Figure 1 It is a schematic flowchart of the method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0035] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, so that those skilled in the art can better understand the present invention and be able to implement it, but the exemplified embodiments are not intended to limit the present invention.
[0036] The present invention provides a fisheye image correction method based on the power series expansion method, which obtains an image containing a complete checkerboard pattern captured by the same fisheye lens.
[0037] Obtain the distance from the corner points of the checkerboard in the image to the center of the image.
[0038] Calculate the coefficients of the power series expansion of the fisheye lens according to the distance, the projection exit angle and the projection incident angle of the corner points, and use the coefficients to perform cyclic test correction on the image.
[0039] Select the coefficients corresponding to the image with the optimal correction effect as the correction parameters of the fisheye lens for fisheye image correction.
[0040] The method of the present invention is based on the fisheye imaging principle through an image, performs power series expansion, calculates distortion coefficients, averages the obtained coefficients, and cyclically corrects the image to obtain better correction parameters.
[0041] In specific applications, in some embodiments of the present invention, when performing fisheye image correction based on the power series expansion method,
[0042] Obtain an image containing a complete checkerboard pattern captured by the same fisheye lens, and detect the checkerboard corner points in the image.
[0043] Obtain the distance from the corner points to the center of the image, where (x ij , y ij ) and (x′ ij , y′ ij ) respectively represent the position coordinates of the jth corner point of the ith checkerboard in the world coordinate system and the image coordinate system, and (x 0 , y 0 ) and (x′ 0 , y′ 0 ) respectively represent the center positions in the world coordinate system and the image coordinate system. According to the formulas and respectively calculate the distances from each corner point to the center of the image.
[0044] Calculate the coefficients of the power series expansion of the fisheye lens according to the distance, the projection exit angle and the projection incident angle of the corner points, where the projection incident angle of the jth corner point of the ith checkerboard is calculated according to the formula
[0045] According to the exit angle θ′ ijThe trigonometric function relationship r′ of the equivalent focal length d′ of a fish-eye lens ij = d′tanθ′ ij , and when the exit angle θ′ ij is small, the approximation principle of the tangent function tanθ′ ij ≈ θ′ ij , the power series expansion relationship θ′ between the exit angle and the incident angle is obtained ij = θ ij (1 + p 1ij θ ij 2 + p 2ij θ ij 4 + p 3ij θ ij 6 + p 4ij θ ij 8 ), calculate the values of the coefficients p 1ij , p 2ij , p 3ij and p 4ij . d′ is the equivalent focal length of the fish-eye lens, with a value of 1, and θ′ ij is the projection exit angle of the j-th corner point of the i-th checkerboard
[0046] Take the average values of the obtained coefficients p 1ij , p 2ij , p 3ij and p 4ij respectively, to obtain and Use the opencv vision library cv2.fisheye.initUndistortRectifyMap() function to make each coefficient fluctuate up and down by 50%. Starting from and , loop once and increase a certain coefficient by 10% until and end, and perform cyclic correction tests on the pictures
[0047] Obtain each corrected picture, and use (x″ ij , y″ ij ) to represent the position of the j-th corner point in the i-th corrected picture. Use to represent the distance from the j-th corner point to the center of the i-th corrected picture. Use E ij = |r″ ij - r ij | to represent the error between the two distances. Use the formula to represent the average value of the distance errors from all corner points to the center in the i-th corrected picture. Select A corresponding picture, and use the coefficient corresponding to this picture as the optimal correction parameter of this fisheye camera.
[0048] The present invention also provides a fisheye picture correction device based on the power series expansion method, including an acquisition module and an analysis and calculation module.
[0049] The acquisition module obtains a picture containing a complete chessboard pattern taken by the same fisheye lens.
[0050] The analysis and calculation module obtains the distance from the corner points of the chessboard in the picture to the center of the picture.
[0051] Calculate the coefficients of the power series expansion formula of the fisheye lens according to the distance, the projection exit angle and the projection incident angle of the corner points, and use the coefficients to perform cyclic test correction on the picture.
[0052] Select the coefficient corresponding to the picture with the best correction effect as the correction parameter of the fisheye lens for fisheye picture correction.
[0053] Regarding the information interaction, execution process, etc. between the above-mentioned modules in the device, since they are based on the same concept as the method embodiment of the present invention, the specific content can be referred to the description in the method embodiment of the present invention, and will not be elaborated here.
[0054] It should be noted that not all steps and modules in the above-mentioned processes and device structures are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted according to needs. The system structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or some components in multiple independent devices can be jointly implemented.
[0055] The above-mentioned embodiments are only preferred embodiments given to fully illustrate the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or transformations made by those skilled in the art on the basis of the present invention are all within the protection scope of the present invention. The protection scope of the present invention is subject to the claims.
Claims
1. A fisheye image correction method based on the power series expansion method, characterized in that obtain an image containing a complete chessboard pattern captured by the same fisheye lens, obtain the distance from the corner points of the chessboard in the image to the center of the image according to the corner points of the chessboard, calculate the coefficients of the power series expansion of the fisheye lens according to the distance, the projection exit angle and the projection incident angle of the corner points, including: calculate the projection exit angle of the corner points according to the distance and the equivalent focal length of the fisheye lens, calculate the projection incident angle of the corner points according to the position coordinates of the corner points in the world coordinate system, and calculate the coefficients of the power series expansion according to the projection exit angle and the projection incident angle of the corner points, perform cyclic test correction on the image using the coefficients, including: take the average value of each coefficient respectively, adjust the value of each coefficient within a certain value range to perform cyclic test on the image, and the cyclic test of the image includes: increase the value of a certain coefficient each time a cyclic test is performed until the values of all coefficients reach the maximum value within the value range, select the coefficients corresponding to the image with the best correction effect as the correction parameters of the fisheye lens for fisheye image correction, where the distance from the corner points of the corrected image to the center of the image is obtained, and the difference is taken with the distance from the corner points of the corresponding uncorrected image to the center of the image, take the absolute value of the difference as the error, obtain the average error value, and select the coefficients corresponding to the corrected image with the smallest average error value as the correction parameters of the fisheye lens.
2. A fisheye image correction method based on the power series expansion method according to claim 1, characterized in that the obtaining the distance from the corner points of the chessboard in the image to the center of the image includes: obtain the position coordinates of the corner points according to the world coordinate system and the image coordinate system, calculate the distance from the corner points to the center of the image using the position coordinates of the corner points.
3. A fisheye image correction device based on the power series expansion method, characterized in that it includes a collection module and an analysis and calculation module, the collection module obtains an image containing a complete chessboard pattern captured by the same fisheye lens, the analysis and calculation module obtains the distance from the corner points of the chessboard in the image to the center of the image, calculate the coefficients of the power series expansion of the fisheye lens according to the distance, the projection exit angle and the projection incident angle of the corner points, including: calculate the projection exit angle of the corner points according to the distance and the equivalent focal length of the fisheye lens, calculate the projection incident angle of the corner points according to the position coordinates of the corner points in the world coordinate system, and calculate the coefficients of the power series expansion according to the projection exit angle and the projection incident angle of the corner points, the analysis and calculation module performs cyclic test correction on the image using the coefficients, including: take the average value of each coefficient respectively, adjust the value of each coefficient within a certain value range to perform cyclic test on the image, where each time a cyclic test is performed, the value of a certain coefficient is increased until the values of all coefficients reach the maximum value within the value range, Select the coefficient corresponding to the picture with the optimal correction effect as the correction parameter of the fisheye lens for fisheye picture correction. Among them, the analysis and calculation module obtains the distance from the corner point of the corrected picture to the center of the picture, takes the difference from the distance from the corresponding corner point of the picture before correction to the center of the picture, takes the absolute value of the difference as the error, obtains the average error value, and selects the coefficient corresponding to the corrected picture with the smallest average error value as the correction parameter of the fisheye lens.
Citation Information
Patent Citations
Fisheye image correction method after calibration conducted by fisheye lens
CN104240236A
Distortion parameter based fisheye camera calibration method
CN107248178A
Fish-eye lens correction method and device and portable terminal
CN107767422A