Image geometric correction method, system and device based on high-order polynomial
Through the image geometry correction method based on higher order polynomials, the polynomial equation system model is optimized and iteratively processed, and the problems of large-scale resource occupation and multiplexing of image geometry correction in the prior art are solved, and more efficient image correction and resource utilization are achieved.
Patent Information
- Application Number
- CN202411613825.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-11-13
AI Technical Summary
In the prior art, the image geometry correction method has problems such as multiple resamplings that lead to large system resource occupation, difficult to reuse the similar distortion image correction process, and high cost of correction of abnormal geometric feature point data.
Using image geometric correction method based on higher order polynomials, we construct a polynomial equation system model, extract geometric feature points and reference feature points, optimize the polynomial equation system model, and obtain the correction results through iterative processing and resampling.
It improves the robustness of image geometric correction, reduces the number of geometric feature point acquisition and resampling, significantly reduces the system resource usage, and simplifies the multiplexing and abnormal data correction process of similar distorted images.
Smart Images

Figure CN119151839B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, system and device for image geometric correction based on high-order polynomials. Background Art
[0002] The geometric correction of images is also called image registration. During the generation process, images are affected by external factors such as lens optical system errors and atmospheric refraction, which will inevitably produce a certain degree of image distortion. In order to correct geometric distortions such as translation, scaling, rotation, torsion, and bending of images, it is usually necessary to perform geometric correction on the images. The purpose of geometric correction is to match the position of objects in the image with their actual position, thereby improving the usability and accuracy of the image.
[0003] In most image processing or geographic information software, geometric correction is performed by selecting the position data of geometric feature points. The method used is generally polynomial correction. The correction calculation is performed on the correction image according to the position data of the geometric feature points of the correction image and the pixels are resampled to generate a new image. The sum of square errors between the geometric feature point data of the corrected image and the registered image is minimized, thereby achieving the purpose of correcting the image to the expected shape.
[0004] However, in the case of nonlinear image distortion, when using polynomials to correct images, due to the high degree of the polynomial (generally cubic polynomials), a large amount of accurate geometric feature point data is required to calculate the coefficients of the polynomial. When using polynomial step correction to correct images in a gradual approximation method, it is necessary to perform multiple iterations and resample the original image, and perform geometric correction calculations again based on the resampled results, which will result in additional storage usage during multiple resampling processes, which is a large resource usage for business implementation.
[0005] At the same time, in real-life scene applications, when image distortions belong to the same system error and the parameters that need to be corrected are equal, since the position data of the geometric feature points required for each image are different, the existing geometric correction cannot be reused or is difficult to reuse when correcting multiple distorted images of the same type, resulting in the defect of repeated work when correcting multiple distorted images of the same type.
[0006] In addition, in the prior art, after the same image has been geometrically corrected multiple times, the original image has been resampled a corresponding number of times. Once the position data of a certain geometric feature point in the middle is abnormal or the error is too large, the final correction result will have an unacceptable deviation, which will lead to the failure of image correction. At this time, if the position data of the abnormal geometric feature point is to be corrected, the original image can only repeat each correction step, which makes the cost of image correction high. Summary of the invention
[0007] 1. Technical issues to be resolved
[0008] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides an image geometric correction method, system and device based on high-order polynomials, which solve the technical problems in the existing correction methods that multiple resampling system resources are large, the correction process of the same type of distortion is difficult to reuse, and the cost of correcting abnormal geometric feature point data is high.
[0009] (II) Technical solution
[0010] In order to achieve the above object, the main technical solutions adopted by the present invention include:
[0011] In a first aspect, an embodiment of the present invention provides an image geometric correction method based on a high-order polynomial, comprising:
[0012] According to the acquired distortion type of the image to be corrected, a polynomial equation group model for correcting the geometric information of the image is constructed;
[0013] According to the highest degree of the polynomial equation group model, geometric feature points are extracted from the image to be corrected, and each geometric feature point corresponds to a reference feature point in a preset reference image one by one;
[0014] Based on the position data of the geometric feature points and the position data of the reference feature points, the polynomial equation group model is optimized and rendered for verification to obtain the optimal polynomial equation group model;
[0015] According to the optimal polynomial equation group model and the set iteration termination condition, the position data of the pixels in the image to be corrected are processed by multiple polynomial iterations, and the image to be corrected is resampled with the iteration result to obtain the correction result of the image to be corrected.
[0016] Optionally, based on the acquired distortion type of the image to be corrected, constructing a polynomial equation group model for correcting geometric information of the image includes:
[0017] Performing a pre-detection including straight line detection and / or grid detection on the acquired image to be corrected to obtain the distortion type of the image to be corrected;
[0018] When the distortion type of the image to be corrected is linear distortion, a first-order polynomial equation model is constructed for image geometric correction;
[0019] When the distortion type of the image to be corrected is nonlinear distortion, a high-order polynomial equation group model is constructed for image geometric correction.
[0020] Optionally, according to the highest degree of the polynomial equation group model, geometric feature points are extracted from the image to be corrected, and each geometric feature point corresponds one-to-one to a reference feature point in a preset reference image, including:
[0021] Get the highest degree of the polynomial equation system model;
[0022] Determining the number of geometric feature points to be extracted from the image to be corrected according to the highest degree of the polynomial equation group model;
[0023] According to the number of geometric feature points and the sampling rules of geometric feature points, geometric feature points are extracted from the image to be corrected;
[0024] Among them, the sampling rules of geometric feature points include:
[0025] Each geometric feature point has a one-to-one corresponding reference feature point in the preset reference image;
[0026] The geometric feature points are evenly distributed within the image range of the image to be corrected;
[0027] The geometric feature points cover every distorted position of the image to be corrected.
[0028] Optionally, determining the number of geometric feature points to be extracted from the image to be corrected according to the highest degree of the polynomial equation group model comprises:
[0029] According to the highest degree of the polynomial equation group model, the minimum sampling number of geometric feature points is combined to obtain the formula to obtain the minimum sampling number of geometric feature points;
[0030] According to the minimum sampling number of geometric feature points, the number of geometric feature points extracted from the image to be corrected is determined, and the number of geometric feature points is not less than the minimum sampling number of geometric feature points;
[0031] Among them, the formula for obtaining the minimum number of sampling geometric feature points is:
[0032] L min =(N+1)*(N+2) / 2
[0033] Where, L min represents the minimum number of sampling geometric feature points, and N represents the highest degree of the polynomial equation model.
[0034] Optionally, based on the position data of the geometric feature points and the position data of the reference feature points, the polynomial equation group model is optimized and rendered for verification, and obtaining the optimal polynomial equation group model includes:
[0035] Obtaining position data of geometric feature points and position data of reference feature points;
[0036] Based on the position data of the geometric feature points and the position data of the reference feature points, the coefficients in the polynomial equation group model are optimized and updated to obtain an optimized polynomial equation group model;
[0037] Rendering the image to be corrected according to the optimized polynomial equation group model to obtain a rendered image after correction of the image to be corrected;
[0038] Compare the rendered image with the reference image to determine whether the comparison result is within the set error threshold range;
[0039] When the comparison result is within the set error threshold range, the optimized polynomial equation group model is determined to be the optimal polynomial equation group model.
[0040] Optionally, according to the optimal polynomial equation group model, combined with the set iteration termination condition, multiple polynomial iterations are performed on the position data of the pixels in the image to be corrected, and the image to be corrected is resampled based on the iteration result, and the correction result of the image to be corrected is obtained, which includes:
[0041] Obtaining position data of pixels in the image to be corrected;
[0042] The number of polynomials in the optimal polynomial equation system model is set as the iteration termination condition;
[0043] According to the iteration termination condition, the position data of the pixel is subjected to multiple polynomial iterations through the optimal polynomial equation group model to obtain the corrected position data of the pixel;
[0044] The image is resampled according to the correction position data of each pixel to obtain the correction result of the image to be corrected.
[0045] Optionally, after performing multiple polynomial iterative processes on the position data of the pixels in the image to be corrected according to the optimal polynomial equation group model and the set iteration termination condition, and resampling the image to be corrected with the iterative result to obtain the correction result of the image to be corrected, the method further includes:
[0046] Determine whether the calibration result meets the set accuracy value;
[0047] When the calibration result does not meet the set accuracy value, it is determined whether the position data of the geometric feature point and / or the reference feature point is the set abnormal data;
[0048] If the position data of the geometric feature points and / or the reference feature points are not the set abnormal data, the correction result is used as the initial iteration data, and multiple polynomial iterations are performed through the optimal polynomial equation group model to obtain the correction result that meets the set accuracy value;
[0049] If the position data of the geometric feature points and / or the reference feature points are set abnormal data, the geometric feature points and / or the reference feature points are resampled, and the coefficients of the polynomial equation group model are corrected according to the resampling results;
[0050] According to the modified polynomial equation group model and the set iteration termination condition, the position data of the pixels in the image to be corrected are processed by multiple polynomial iterations, and the image to be corrected is resampled with the iteration result to obtain the correction result of the image to be corrected.
[0051] Optionally, the optimal polynomial equations model can perform geometric correction on a distorted image with the same distortion type as the image to be corrected:
[0052] Acquire a distorted image having the same distortion type as the image to be corrected, and extract position data of pixels in the distorted image;
[0053] The number of polynomials in the optimal polynomial equation system model is set as the iteration termination condition;
[0054] According to the iteration termination condition, the position data of the pixel in the distorted image is subjected to multiple polynomial iterations through the optimal polynomial equation group model to obtain the corrected position data of the pixel;
[0055] Image resampling is performed according to the correction position data of each pixel in the distorted image to obtain a correction result in the distorted image.
[0056] In a second aspect, an embodiment of the present invention provides an image geometric correction system based on a high-order polynomial, comprising:
[0057] A polynomial equation group model building module is used to build a polynomial equation group model for correcting the geometric information of the image according to the acquired distortion type of the image to be corrected;
[0058] A geometric feature point extraction module is used to extract geometric feature points from the image to be corrected according to the highest degree of the polynomial equation group model, and each geometric feature point corresponds to a reference feature point in a preset reference image.
[0059] A polynomial equation group model optimization module is used to optimize and render the polynomial equation group model based on the position data of the geometric feature points and the position data of the reference feature points to obtain the optimal polynomial equation group model;
[0060] The image geometry correction module is used to perform multiple polynomial iterations on the position data of the pixels in the image to be corrected based on the optimal polynomial equation group model and the set iteration termination conditions, and to resample the image to be corrected with the iteration results to obtain the correction result of the image to be corrected.
[0061] In a third aspect, an embodiment of the present invention provides a camera device with image geometric correction, including:
[0062] A shooting unit, used for shooting images;
[0063] A storage unit, connected to the shooting unit, for storing images;
[0064] The image processing unit is connected to the storage unit and is used to execute the above-mentioned steps of the image geometric correction method based on high-order polynomials on the distorted image.
[0065] (III) Beneficial effects
[0066] The beneficial effects of the present invention are as follows: the present invention proposes a method for image geometric correction based on high-order polynomials, which optimizes the polynomial equation group model by using the geometric feature points in the image to be corrected and the reference feature points in the reference image, and then performs multiple polynomial iterations on the pixels of the image to be corrected by obtaining the optimal polynomial equation group model, and finally resamples the iterative results to obtain the correction results. Compared with the prior art, the method improves the robustness of high-order polynomial image geometric correction, reduces the number of times geometric feature points are obtained, and optimizes the number of resampling in the entire image correction process to 1, which significantly reduces the system resource occupancy during image correction.
[0067] At the same time, the position data of the geometric feature points in the present invention are only used to optimize the polynomial equation group model, so that when correcting multiple images with the same type of distortion, only a more typical instance needs to be selected to perform the geometric correction steps of the present invention, and other images can directly reuse the optimal polynomial equation group model of the typical instance, thereby eliminating the need for selecting the geometric feature point position data of other images of the same type and correcting them in steps, thereby simplifying the geometric correction steps.
[0068] In addition, the position data of the geometric feature points in the present invention do not directly parameterize the geometric correction of the image, so that when the position data of the geometric feature points are abnormal and the correction effect is not ideal, the correction step with the problem can be corrected separately, and the abnormal polynomial equation model can be replaced to correct the abnormal data without affecting other correction steps. There is no need to recalculate all correction steps, thereby reducing the correction cost of the abnormal geometric feature point data. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 A schematic diagram of a flow chart of an image geometric correction method based on a high-order polynomial provided by an embodiment of the present invention;
[0070] Figure 2 A schematic diagram of an algorithm flow of an image geometric correction method based on a high-order polynomial provided by an embodiment of the present invention;
[0071] Figure 3 A schematic diagram of an algorithm flow for performing geometric correction on multiple distorted images of the same type provided by an embodiment of the present invention;
[0072] Figure 4 This is a comparison diagram of a distorted image before and after geometric correction provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0073] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation modes in conjunction with the accompanying drawings.
[0074] refer to Figure 1-3 As shown, an image geometry correction method based on a high-order polynomial is proposed in an embodiment of the present invention, which includes: first, according to the acquired distortion type of the image to be corrected, a polynomial equation group model for correcting the geometric information of the image is constructed. Then, according to the highest degree of the polynomial equation group model, geometric feature points are extracted from the image to be corrected, and each geometric feature point corresponds to a reference feature point in a preset reference image. Then, based on the position data of the geometric feature points and the position data of the reference feature points, the polynomial equation group model is optimized and rendered to verify, and an optimal polynomial equation group model is obtained. Finally, according to the optimal polynomial equation group model, combined with the set iteration termination condition, multiple polynomial iterations are performed on the position data of the pixels in the image to be corrected, and the image to be corrected is resampled with the iteration result to obtain the correction result of the image to be corrected.
[0075] Since this embodiment optimizes the polynomial equation group model by using the geometric feature points in the image to be corrected and the reference feature points in the reference image, and then performs multiple polynomial iterations on the pixels of the image to be corrected by obtaining the optimal polynomial equation group model, and finally resamples the iterative results to obtain the correction results, compared with the prior art, this embodiment improves the robustness of high-order polynomial image geometric correction, reduces the number of times geometric feature points are obtained, and optimizes the number of resampling in the entire image correction process to 1, which significantly reduces the system resource usage during image correction.
[0076] At the same time, in this embodiment, the position data of the geometric feature points are only used to optimize the polynomial equation group model, so that when correcting multiple images with the same type of distortion, only a more typical instance needs to be selected to perform the geometric correction step of the present invention, and other images can directly reuse the optimal polynomial equation group model of the typical instance, thereby eliminating the need for selecting the geometric feature point position data of other images of the same type and correcting them in steps, thereby simplifying the geometric correction steps.
[0077] In addition, in this embodiment, the position data of the geometric feature points does not directly parameterize the geometric correction of the image, so that when the position data of the geometric feature points is abnormal and the correction effect is not ideal, the correction step with the problem can be corrected separately, and the abnormal polynomial equation model can be replaced to correct the abnormal data without affecting other correction steps. There is no need to recalculate all correction steps, thereby reducing the correction cost of the abnormal geometric feature point data.
[0078] In order to better understand the above technical solution, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a clearer and more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0079] Specifically, refer to Figure 1 As shown, this embodiment proposes an image geometric correction method based on a high-order polynomial, the method comprising:
[0080] S1. According to the acquired distortion type of the image to be corrected, a polynomial equation group model for correcting the geometric information of the image is constructed.
[0081] In this embodiment, step S1 may include the following sub-steps S11-S12:
[0082] S11, performing a pre-detection including straight line detection and / or grid detection on the acquired image to be corrected, to obtain the distortion type of the image to be corrected.
[0083] Line detection: First, extract the edge information in the image to be corrected. Then, use algorithms such as Hough transform or random sampling consensus algorithm (RANSAC) to fit the edge information to obtain a set of straight lines. Finally, by comparing the difference between the fitted straight line and the ideal straight line (i.e., the straight line without distortion), the distortion type of the image is evaluated. For example, if the straight line in the image to be corrected is bent outward, the distortion type is barrel distortion (non-linear distortion); if the straight line in the image to be corrected is bent inward, the distortion type is pincushion distortion (non-linear distortion); if there are multiple straight lines in the image to be corrected that should be parallel, but the slopes of the straight lines are different, the distortion type of the image is linear distortion.
[0084] Grid detection: First, take a picture of the image to be corrected that contains a grid test card. Then, use image processing algorithms (such as corner detection, contour detection, etc.) to identify the grid structure in the image to be corrected. Finally, by comparing the difference between the identified grid structure and the ideal grid structure, the distortion type of the image is evaluated. Common distortion analysis indicators include distortion rate, distortion direction, etc. For example, if the lines of the grid are curved or tilted at the edge of the image, the distortion type of the image to be corrected is barrel distortion or pincushion distortion; if the angle between the grid lines is significantly different from the theoretical value (such as 90 degrees), the distortion type of the image to be corrected is linear distortion.
[0085] S12. When the distortion type of the image to be corrected is linear distortion, a first-order polynomial equation group model is constructed for image geometric correction.
[0086] S13. When the distortion type of the image to be corrected is nonlinear distortion, a high-order polynomial equation group model is constructed according to the number of distortion inflection points in the image to be corrected for image geometry correction.
[0087] The polynomial degree of the polynomial equation model corresponds to the number of distortion inflection points in the distorted image. For example, a first-order polynomial equation model corresponds to linear distortion (no distortion inflection point), a second-order polynomial equation model corresponds to parabolic distortion (1 distortion inflection point), and a third-order polynomial equation model corresponds to curvilinear distortion (2 distortion inflection points).
[0088] In a specific embodiment, Figure 4 The image to be corrected as shown is subjected to geometric correction. First, through pre-detection of straight line detection and / or grid detection, it is obtained that the distortion type of the image to be corrected is nonlinear distortion (curve distortion). Then, based on the distortion type of the image to be corrected, a polynomial equation group model as shown below is constructed. The polynomial equation group model is a cubic polynomial equation group model.
[0089] (1)
[0090] (1) In the formula, x and y Represents the position data of the geometric feature points in the image to be corrected ( x , y ), x * and y * Represents the position data of the reference feature points in the reference image ( x * , y * ), a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t Represents the 20 coefficients of the cubic polynomial in the polynomial equation model.
[0091] S2. Extracting geometric feature points from the image to be corrected according to the highest degree of the polynomial equation group model, wherein each geometric feature point corresponds one-to-one to a reference feature point in a preset reference image.
[0092] In this embodiment, step S2 may include the following sub-steps S21-S23:
[0093] S21. Obtain the highest degree of the polynomial equation group model.
[0094] S22. Determine the number of geometric feature points to be extracted from the image to be corrected according to the highest degree of the polynomial equation group model.
[0095] Further, sub-step S22 specifically includes: first, according to the highest degree of the polynomial equation group model, combined with the minimum sampling number of geometric feature points, formula (2) is obtained to obtain the minimum sampling number of geometric feature points, and then, according to the minimum sampling number of geometric feature points, the number of geometric feature points extracted from the image to be corrected is determined, and the number of geometric feature points is not less than the minimum sampling number of geometric feature points. The number of geometric feature points is not less than the minimum sampling number of geometric feature points, so that when the position data of the geometric feature points is abnormal, the abnormal geometric feature points can be quickly replaced by the pre-collected geometric feature points, and the geometric feature points do not need to be re-sampled, which further reduces the correction cost of the abnormal geometric feature point data.
[0096] The formula for obtaining the minimum number of sampling geometric feature points is:
[0097] L min =(N+1)*(N+2) / 2 (2)
[0098] (2) In the formula, L min represents the minimum number of sampling geometric feature points, and N represents the highest degree of the polynomial equation model.
[0099] S23, extracting geometric feature points from the image to be corrected based on the number of geometric feature points and in combination with a sampling rule of the geometric feature points.
[0100] The sampling rules of the geometric feature points include: each geometric feature point has a one-to-one corresponding reference feature point in a preset reference image; the geometric feature points are evenly distributed within the image range of the image to be corrected; and the geometric feature points cover each distorted position of the image to be corrected.
[0101] S3. Based on the position data of the geometric feature points and the position data of the reference feature points, the polynomial equation group model is optimized and rendered for verification to obtain an optimal polynomial equation group model.
[0102] In this embodiment, step S3 may include the following sub-steps S31-S35:
[0103] S31. Obtain position data of geometric feature points and position data of reference feature points.
[0104] S32. Based on the position data of the geometric feature points and the position data of the reference feature points, the coefficients in the polynomial equation group model are optimized and updated to obtain an optimized polynomial equation group model.
[0105] S33, rendering the image to be corrected according to the optimized polynomial equation group model to obtain a rendered image after the image to be corrected is corrected.
[0106] S34: Compare the rendered image with the reference image to determine whether the comparison result is within a set error threshold range.
[0107] S35. When the comparison result is within the set error threshold range, determine that the optimized polynomial equation group model is the optimal polynomial equation group model.
[0108] In this embodiment, after optimizing the coefficients in the polynomial equations model, the optimized polynomial equations model is directly rendered and verified to determine the optimal polynomial equations model, so that when each pixel of the image is corrected by the optimal polynomial equations model, there is no need to render again, so that the image to be corrected only needs to be resampled pixel update once to obtain the corrected image, which has the effect of reducing the proportion of system resources occupied during image correction.
[0109] In a specific embodiment, the process of optimizing and rendering the above cubic polynomial equation model is as follows:
[0110] The first step is to find the formula based on the minimum number of sampling geometric feature points to obtain the image to be corrected ( Figure 4 The minimum number of sampling geometric feature points in ) is 10.
[0111] The second step is to select the minimum number of geometric feature points from the image to be corrected ( Figure 4 ) collects 11 geometric feature points, and their coordinate data are respectively ( x 0, y 0)、( x 1, y 1) ( x 2, y 2) ( x 3, y 3) x 4, y 4) x 5, y 5) x 6, y6) ( x 7, y 7) ( x 8, y 8) x 9, y 9) and ( x 10 , y 10 ), collect 11 reference feature points corresponding to the 11 geometric feature points from the reference image, and their coordinate data are respectively ( x * 0, y * 0)、( x * 1, y * 1) ( x * 2, y * 2) ( x * 3, y * 3) x * 4, y * 4) x * 5, y * 5) x * 6, y * 6) ( x * 7, y * 7) ( x * 8, y * 8) x * 9, y * 9) and ( x * 10 , y * 10 )
[0112] In the third step, 10 geometric feature points and 10 reference feature points are selected from the 11 geometric feature points and the 11 reference feature points and substituted into the polynomial equation group model (1) to obtain the polynomial equation group (3) and the polynomial equation group (4) shown below.
[0113] Polynomial equation system (3):
[0114] (3)
[0115] Polynomial equation system (4):
[0116] (4)
[0117] The fourth step is to solve the polynomial equations (3) and (4) to obtain the optimal coefficients of a polynomial equation in the cubic polynomial equation model: ( a 1, b 1, c 1, d 1, e 1, f 1, g 1, h 1, i 1, j 1) and ( k 1, l 1, m 1, n 1, o 1, p 1, q 1, r 1, s 1, t 1).
[0118] The fifth step is to update the coefficients in the polynomial equation model (1) based on the optimal coefficients to obtain an optimized polynomial equation model (5).
[0119] (5)
[0120] (5) In the formula, x ’ ,y ’ Represents geometric feature points ( x , y ) Corrected coordinate data.
[0121] In the sixth step, the image to be corrected is rendered according to the optimized polynomial equation group (5) to obtain a rendered image after correction of the image to be corrected.
[0122] In the seventh step, the rendered image is compared with the reference image to determine whether the comparison result is within the set error threshold.
[0123] In the eighth step, when the comparison result is within the set error threshold range, the optimized polynomial equation group (5) is determined to be an optimal polynomial equation group.
[0124] In the ninth step, repeat the third step to the eighth step to obtain multiple optimal polynomial equation groups to form an optimal polynomial equation group model.
[0125] S4. Based on the optimal polynomial equation group model and the set iteration termination condition, multiple polynomial iterations are performed on the position data of the pixels in the image to be corrected, and the image to be corrected is resampled with the iteration result to obtain the correction result of the image to be corrected.
[0126] In this embodiment, step S4 may include the following sub-steps S41-S44:
[0127] S41, obtaining position data of pixels in the image to be corrected.
[0128] S42. Setting the number of polynomials in the optimal polynomial equation group model as an iteration termination condition.
[0129] S43. According to the iteration termination condition, the position data of the pixel is subjected to multiple polynomial iterations through the optimal polynomial equation group model to obtain the corrected position data of the pixel.
[0130] S44, performing image resampling according to the correction position data of each pixel to obtain a correction result of the image to be corrected.
[0131] For example, when a cubic polynomial equation model is used for image geometric correction, when obtaining the image to be corrected ( Figure 4 ), bring the position data into an optimal polynomial equation group in the optimal polynomial equation group model for one iteration to obtain the position data after the first iteration. Then, use the position data after the first iteration as a new pixel to iterate into the next optimal polynomial equation group in the optimal polynomial equation group model to obtain the position data after the second iteration, and so on until the number of iterations is consistent with the number of polynomials in the optimal polynomial equation group model, and use the last iteration data as the position data of the corrected pixel. Finally, perform image resampling once based on the position data of each corrected pixel to obtain the correction result of the image to be corrected, such as Figure 4 shown.
[0132] In this embodiment, after step S4, the following sub-steps S51-S54 are also included:
[0133] S51, judging whether the calibration result meets the set accuracy value.
[0134] S52: When the calibration result does not meet the set accuracy value, it is determined whether the position data of the geometric feature point and / or the reference feature point is the set abnormal data.
[0135] S53a. If the position data of the geometric feature points and / or the reference feature points are not the set abnormal data, the correction result is used as the initial iterative data, and multiple polynomial iterations are performed through the optimal polynomial equation group model to obtain a correction result that meets the set accuracy value.
[0136] S53b. If the position data of the geometric feature points and / or the reference feature points are set abnormal data, the geometric feature points and / or the reference feature points are resampled, and the coefficients of the polynomial equation group model are corrected according to the resampling results.
[0137] S54, based on the modified polynomial equation group model and in combination with the set iteration termination condition, multiple polynomial iterations are performed on the position data of the pixels in the image to be corrected, and the image to be corrected is resampled with the iteration result to obtain the correction result of the image to be corrected.
[0138] It is worth mentioning that the optimal polynomial equation group model can perform geometric correction on a distorted image with the same distortion type as the image to be corrected, and the specific correction process may include:
[0139] F1. Obtain a distorted image having the same distortion type as the image to be corrected, and extract position data of pixels in the distorted image.
[0140] F2. Set the number of polynomials in the optimal polynomial equations model as the iteration termination condition.
[0141] F3. According to the iteration termination condition, the position data of the pixel in the distorted image is subjected to multiple polynomial iterations through the optimal polynomial equation group model to obtain the corrected position data of the pixel.
[0142] F4. Resample the image according to the correction position data of each pixel in the distorted image to obtain a correction result in the distorted image.
[0143] In addition, an embodiment of the present invention further proposes an image geometric correction system based on a high-order polynomial, which includes:
[0144] The polynomial equation group model building module is used to build a polynomial equation group model for correcting the geometric information of the image according to the acquired distortion type of the image to be corrected.
[0145] The geometric feature point extraction module is used to extract geometric feature points from the image to be corrected according to the highest degree of the polynomial equation group model, and each geometric feature point corresponds one-to-one to a reference feature point in a preset reference image.
[0146] The polynomial equation group model optimization module is used to optimize and render the polynomial equation group model based on the position data of the geometric feature points and the position data of the reference feature points to obtain the optimal polynomial equation group model.
[0147] The image geometry correction module is used to perform multiple polynomial iterations on the position data of the pixels in the image to be corrected based on the optimal polynomial equation group model and the set iteration termination conditions, and to resample the image to be corrected with the iteration results to obtain the correction result of the image to be corrected.
[0148] The functions of each module in the system refer to the relevant description in the above method embodiment, which will not be repeated here.
[0149] In addition, an embodiment of the present invention further provides a camera device with image geometric correction, which includes:
[0150] The shooting unit is used for shooting images.
[0151] The storage unit is connected to the shooting unit and is used to store images.
[0152] The image processing unit is connected to the storage unit and is used to perform the following method steps on the distorted image:
[0153] S1. According to the acquired distortion type of the image to be corrected, a polynomial equation group model for correcting the geometric information of the image is constructed.
[0154] S2. Extracting geometric feature points from the image to be corrected according to the highest degree of the polynomial equation group model, wherein each geometric feature point corresponds one-to-one to a reference feature point in a preset reference image.
[0155] S3. Based on the position data of the geometric feature points and the position data of the reference feature points, the polynomial equation group model is optimized and rendered for verification to obtain an optimal polynomial equation group model.
[0156] S4. Based on the optimal polynomial equation group model and the set iteration termination condition, multiple polynomial iterations are performed on the position data of the pixels in the image to be corrected, and the image to be corrected is resampled with the iteration result to obtain the correction result of the image to be corrected.
[0157] In summary, the present invention proposes a method, system and device for image geometric correction based on high-order polynomials, the method comprising: first, obtaining an optimal polynomial equation group model with multiple polynomials through a small number of geometric feature points, and then performing pixel iterative correction by executing multiple polynomials, specifically using the pixel position data of each iteration as input data for the next polynomial iterative calculation, obtaining the final required pixel position data through a progressively approximated iteration method, and finally resampling all corrected pixels once to obtain a corrected image. The present invention can correct severely distorted original images, and also overcomes the technical problem of large system resource occupation due to multiple resampling when using high-order polynomials for image correction in existing correction methods.
[0158] At the same time, the position data of the geometric feature points in the present invention are only used to optimize the polynomial equation group model, so that when correcting multiple images with the same type of distortion, it is only necessary to perform the geometric correction steps of the present invention on a typical instance, and other images can directly reuse the optimal polynomial equation group model of the typical instance, thereby eliminating the need for selecting the geometric feature point position data and performing step-by-step correction of other images of the same type, thereby simplifying the geometric correction steps.
[0159] In addition, the position data of the geometric feature points in the present invention do not directly parameterize the geometric correction of the image, so that when the position data of the geometric feature points are abnormal and the correction effect is not ideal, the correction step with the problem can be corrected separately, and the abnormal polynomial equation model can be replaced to correct the abnormal data without affecting other correction steps. There is no need to recalculate all correction steps, thereby reducing the correction cost of the abnormal geometric feature point data.
[0160] Since the system / device described in the above embodiments of the present invention is a system / device used to implement the method of the above embodiments of the present invention, a person skilled in the art can understand the specific structure and deformation of the system / device based on the method described in the above embodiments of the present invention, and thus will not be described in detail here. All systems / devices used in the method of the above embodiments of the present invention belong to the scope of protection of the present invention.
[0161] It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0162] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions.
[0163] It should be noted that in the description of the present invention, the word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The present invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. The use of the words first, second, third, etc., is only for convenience of expression and does not indicate any order. These words may be understood as part of the name of the component.
[0164] In addition, it should be noted that, in the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0165] Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments after obtaining the basic inventive concepts.
[0166] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the invention.
Claims
1. A method for image geometric correction based on high-order polynomials, characterized in that: include: According to the acquired distortion type of the image to be corrected, a polynomial equation group model for correcting the geometric information of the image is constructed; According to the highest degree of the polynomial equation group model, combined with the minimum sampling number of geometric feature points, the formula is obtained to obtain the minimum number of geometric feature points to be extracted, and based on the minimum number of extractions, geometric feature points are extracted from the image to be corrected, and each geometric feature point corresponds to a reference feature point in a preset reference image. The formula for obtaining the minimum sampling number of geometric feature points is: L min =(N+1)*(N+2) / 2 Where, L min represents the minimum number of sampling geometric feature points, and N represents the highest degree of the polynomial equation model; Based on the position data of the geometric feature points and the position data of the reference feature points, the polynomial equation group model is optimized and rendered for verification to obtain the optimal polynomial equation group model; The position data of the pixels in the image to be corrected are obtained; the number of polynomials in the optimal polynomial equation group model is set as the iteration termination condition; according to the iteration termination condition, the position data of the pixels are subjected to multiple polynomial iterations through the optimal polynomial equation group model to obtain the corrected position data of the pixels; the image is resampled according to the corrected position data of each pixel to obtain the correction result of the image to be corrected.
2. The method according to claim 1, characterized in that According to the distortion type of the image to be corrected, a polynomial equation group model for correcting the geometric information of the image is constructed, including: Performing a pre-detection including straight line detection and / or grid detection on the acquired image to be corrected to obtain the distortion type of the image to be corrected; When the distortion type of the image to be corrected is linear distortion, a first-order polynomial equation model is constructed for image geometric correction; When the distortion type of the image to be corrected is nonlinear distortion, a high-order polynomial equation group model is constructed for image geometric correction.
3. The method according to claim 1, characterized in that According to the highest degree of the polynomial equation group model, the formula is obtained in combination with the minimum number of sampling of geometric feature points to obtain the minimum number of geometric feature points to be extracted, and geometric feature points are extracted from the image to be corrected based on the minimum number of extractions. Each geometric feature point corresponds to a preset reference feature point in the reference image, including: Get the highest degree of the polynomial equation system model; According to the highest degree of the polynomial equation group model, the formula is obtained in combination with the minimum sampling number of geometric feature points to determine the minimum number of geometric feature points to be extracted from the image to be corrected; According to the minimum number of geometric feature points to be extracted and the sampling rules of geometric feature points, geometric feature points are extracted from the image to be corrected; Among them, the sampling rules of geometric feature points include: Each geometric feature point has a one-to-one corresponding reference feature point in the preset reference image; The geometric feature points are evenly distributed within the image range of the image to be corrected; The geometric feature points cover every distorted position of the image to be corrected.
4. The method according to claim 1, characterized in that Based on the position data of the geometric feature points and the position data of the reference feature points, the polynomial equation group model is optimized and rendered for verification, and the optimal polynomial equation group model is obtained, including: Obtaining position data of geometric feature points and position data of reference feature points; Based on the position data of the geometric feature points and the position data of the reference feature points, the coefficients in the polynomial equation group model are optimized and updated to obtain an optimized polynomial equation group model; Rendering the image to be corrected according to the optimized polynomial equation group model to obtain a rendered image after correction of the image to be corrected; Compare the rendered image with the reference image to determine whether the comparison result is within the set error threshold range; When the comparison result is within the set error threshold range, the optimized polynomial equation group model is determined to be the optimal polynomial equation group model.
5. The method according to claim 1, characterized in that After resampling the image according to the correction position data of each pixel to obtain the correction result of the image to be corrected, the method further includes: Determine whether the calibration result meets the set accuracy value; When the calibration result does not meet the set accuracy value, it is determined whether the position data of the geometric feature point and / or the reference feature point is the set abnormal data; If the position data of the geometric feature points and / or the reference feature points are not the set abnormal data, the correction result is used as the initial iteration data, and multiple polynomial iterations are performed through the optimal polynomial equation group model to obtain the correction result that meets the set accuracy value; If the position data of the geometric feature points and / or the reference feature points are set abnormal data, the geometric feature points and / or the reference feature points are resampled, and the coefficients of the polynomial equation group model are corrected according to the resampling results; According to the modified polynomial equation group model and the set iteration termination condition, the position data of the pixels in the image to be corrected are processed by multiple polynomial iterations, and the image to be corrected is resampled with the iteration result to obtain the correction result of the image to be corrected.
6. The method according to any one of claims 1 to 5, characterized in that: The optimal polynomial equations model can perform geometric correction on distorted images with the same distortion type as the image to be corrected: Acquire a distorted image having the same distortion type as the image to be corrected, and extract position data of pixels in the distorted image; The number of polynomials in the optimal polynomial equation system model is set as the iteration termination condition; According to the iteration termination condition, the position data of the pixel in the distorted image is subjected to multiple polynomial iterations through the optimal polynomial equation group model to obtain the corrected position data of the pixel; Image resampling is performed according to the correction position data of each pixel in the distorted image to obtain a correction result in the distorted image.
7. An image geometric correction system based on high-order polynomials, characterized in that: include: A polynomial equation group model building module is used to build a polynomial equation group model for correcting the geometric information of the image according to the acquired distortion type of the image to be corrected; The geometric feature point extraction module is used to obtain a formula based on the highest degree of the polynomial equation group model and the minimum number of geometric feature point samplings to obtain the minimum number of geometric feature points to be extracted, and to extract geometric feature points from the image to be corrected based on the minimum number of extractions, each geometric feature point corresponding to a reference feature point in a preset reference image; wherein the formula for obtaining the minimum number of geometric feature point samplings is: L min =(N+1)*(N+2) / 2 Where, L min represents the minimum number of sampling geometric feature points, and N represents the highest degree of the polynomial equation model; A polynomial equation group model optimization module is used to optimize and render the polynomial equation group model based on the position data of the geometric feature points and the position data of the reference feature points to obtain the optimal polynomial equation group model; The image geometry correction module is used to obtain the position data of the pixels in the image to be corrected; set the number of polynomials in the optimal polynomial equation group model as the iteration termination condition; according to the iteration termination condition, perform multiple polynomial iterations on the position data of the pixels through the optimal polynomial equation group model to obtain the corrected position data of the pixels; perform image resampling based on the corrected position data of each pixel to obtain the correction result of the image to be corrected.
8. A camera device with image geometric correction, characterized in that: include: A shooting unit, used for shooting images; A storage unit, connected to the shooting unit, for storing images; An image processing unit is connected to the storage unit and is used to perform the steps of an image geometric correction method based on a high-order polynomial as described in any one of claims 1 to 6 on the distorted image.
Citation Information
Patent Citations
Fisheye image distortion correction method based on reverse polynomial model
CN104182961A