Distorted Image Correction Method and Its Localization Method
Through the four-point positioning method and plane rectangular coordinate system, the center and radius of the fish eye image are accurately positioned, and the problems of accurate positioning and real-time high-definition correction of fish eye image correction in the prior art are solved, and the rapid and accurate correction of multi-way fish eye images are achieved.
Patent Information
- Application Number
- CN202110870949.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2015-12-11
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2035-12-11
AI Technical Summary
The existing fisheye image correction methods cannot accurately locate the center and radius of the image, and cannot achieve real-time high-definition correction. The scope of application is limited and cannot meet the real-time correction needs of consumers.
The four-point positioning method is used to determine the position and contour of the distorted image. By superimposing and linearly compressing the image, the center and radius of the circle are accurately positioned using the plane rectangular coordinate system, and the correction of the multi-way fisheye image is achieved through correction factors.
Accurate positioning and rapid correction of fisheye images are realized, suitable for real-time high-definition correction of multiple fisheye images, improving the accuracy and efficiency of correction.
Smart Images

Figure CN114331860B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to image correction technology in the field of photography and videography, and more specifically to a distortion image correction method and its positioning method. Background Art
[0002] Photography and videography play a very important role in modern people's daily life and work, and have become an indispensable part of people's life and work.
[0003] People are already accustomed to using electronic devices with photography and videography functions to record every detail of their lives. People like and need such a tool to record some memorable moments, periods of time, and scenes in life, such as the growth of children, the gatherings of relatives and friends, and beautiful scenery.
[0004] With the increasing diversification of people's needs for photography and videography technology, various photography and videography lenses are used and loved by people. For example, in order to enable photography and videography equipment to have a wider field of view, "distortion images" have emerged. Distortion images have the characteristics of short focal length and large field of view, and have a wide market demand in omnidirectional vision systems.
[0005] Distortion images can achieve an ultra-large viewing angle close to or greater than 180°. Therefore, using distortion images can capture a larger range of scenes. Thus, distortion images have great potential application value. For example, applying distortion images to the video surveillance systems in some public places and adopting a ceiling-mounted installation method can record the scenes of the entire area. In this way, people do not need to install multiple surveillance cameras in different areas, saving space, resources, and usage costs. Another example is that people always encounter this situation in their daily lives. Clearly, they feel that the scenery in front of them is very beautiful, but they can't record it with the photography and videography equipment in their hands. This is largely because the viewing angle ability of the photography and videography equipment cannot reach the range that the human eye can see.
[0006] Although distorted images have the advantage of a large field of view, which can reach or even exceed the range that the human eye can see, this ultra-large viewing angle of distorted images is achieved by sacrificing the original form of the subject. In other words, the image captured using distorted images is distorted. The outline of the fisheye image is a circular structure. Distorted images can create a very strong perspective effect when shot close to the subject, emphasizing the contrast between the near and far objects, making the captured images have a shocking appeal, and therefore are loved by photography enthusiasts. However, in addition to enhancing artistic appeal, this distorted image is mostly not needed by people. For example, surveillance cameras that can be seen everywhere in life today are set up in some necessary places to help people restrain their daily behavior. Some surveillance records may even become effective evidence for fact finding. However, this deformed image often affects the identification of some details.
[0007] Even though distorted images can give people artistic appeal, many consumers still hope that these distorted images can be restored to their original appearance. Whether used for commemoration or for comparison with distorted images, it has very important significance and application value. Therefore, the correction technology of distorted images has attracted much attention from R&D personnel.
[0008] The premise of fisheye image correction is the contour extraction of fisheye images. Currently, the commonly used fisheye image contour extraction methods include area statistics method, scanning line approximation method, and region growing method. These methods have their own advantages and disadvantages, but they also have some shortcomings. They cannot completely and accurately locate the center coordinates and radius of the fisheye image, and their scope of application is also limited.
[0009] In the distortion correction of fisheye images, the current methods can be mainly summarized as 3D correction and 2D correction. The main methods in this field include correction methods based on spherical perspective projection models, correction methods based on quadratic surface perspective models, fisheye image distortion correction methods based on circle segmentation, fisheye image plane correction methods based on geometric properties, etc. All of the above methods have their own advantages and disadvantages. In terms of computational complexity and correction effect, none of them fully meets the real-time correction requirements of high-definition video, and there is still a certain distance in practical application.
[0010] Real-time correction of fisheye images is of great significance for consumers to obtain corrected images in a timely manner. In particular, it is of great significance for the correction of fisheye video images. Currently, there is an urgent need for a real-time and efficient correction method for high-definition fisheye videos. Summary of the invention
[0011] The main purpose of the present invention is to provide a distorted image correction method and a positioning method thereof, wherein the positioning method can accurately locate the center and radius of a fisheye image.
[0012] Another object of the present invention is to provide a method for correcting a distorted image, which has the characteristics of fast correction speed and good correction effect.
[0013] Another object of the present invention is to provide a method for correcting a distorted image, which can be used to correct a fish-eye image.
[0014] Another object of the present invention is to provide a method for correcting a distorted image, which is suitable for real-time correction of a fish-eye image.
[0015] Another object of the present invention is to provide a method for correcting a distorted image, which can be used to correct a multi-channel fish-eye image.
[0016] Another object of the present invention is to provide a method for correcting a distorted image, which fully considers the characteristics of the circular structure presented by the contour of the fish-eye image and makes full use of the correlation between multi-channel fish-eye video images, and is suitable for real-time correction of multi-channel high-definition fish-eye images on an embedded device.
[0017] Through the following description, other advantages and features of the present invention will become apparent and can be realized by the means and combinations particularly pointed out in the claims.
[0018] In accordance with one aspect of the present invention, the present invention provides a method for correcting a distorted image for use in correcting a fish-eye image, wherein the method for correcting a distorted image comprises the following steps:
[0019] (1) Determining correction parameters; and
[0020] (2) Determining a correction algorithm according to the correction parameters;
[0021] Wherein step (1) comprises the following steps:
[0022] (11) Determining the positions and contours of multi-channel distorted images; and
[0023] (12) Determining a correction factor for the distorted image;
[0024] Wherein in step (11), the four-point positioning method is used to accurately position the positions and contours of the distorted images to ensure the accuracy and effectiveness of the method for correcting the distorted images.
[0025] According to one embodiment, step (11) comprises the following steps:
[0026] (113) Superimposing the distorted images to obtain a superimposed image;
[0027] (114) Linearly compressing the superimposed image to obtain a normalized image; and
[0028] (115) Determine the position and contour of the distorted image according to the pixel values of the normalized image at various positions.
[0029] According to one embodiment, before step (113), step (11) includes the following steps:
[0030] (112) Filter the distorted image to filter out the noise in the distorted image.
[0031] According to one embodiment, step (114) includes the following steps:
[0032] (1141) Obtain the maximum pixel value P of the superimposed image max and the minimum pixel value P min ; and
[0033] (1142) Linearly compress the superimposed image I max according to the maximum pixel value P min and the minimum pixel value P of the superimposed image; S The linear compression is performed using the following formula:
[0034] wherein, p
[0035]
[0036] is the pixel value of the normalized image after linear compression at the coordinate point (x, y), and P x,y is the pixel value at the coordinate point (x, y) on the superimposed image. x,y
[0037] According to one embodiment, step (114) includes the following steps:
[0038] (1141) Obtain the maximum pixel value P of the superimposed image max and the minimum pixel value P min ; and
[0039] (1142) Linearly compress the superimposed image I max according to the maximum pixel value P min and the minimum pixel value P of the superimposed image; S The linear compression is performed using the following formula:
[0040] wherein, p
[0041]
[0042] is the pixel value of the normalized image after linear compression at the coordinate point (x, y), and P x,y is the pixel value at the coordinate point (x, y) on the superimposed image. x,y
[0043] According to one embodiment, step (115) includes the following steps:
[0044] (1151) Set a threshold value T h ;
[0045] (1152) Record the points on the normalized image where the pixel is greater than or equal to the threshold value T h ;
[0046] (1153) Determine the position and contour of the distorted image according to the points on the normalized image where the pixel is greater than or equal to the threshold value determined in step (1152).
[0047] According to one embodiment, step (115) includes the following steps:
[0048] (1151) Set a threshold value T h ;
[0049] (1152) Record the points on the normalized image where the pixel is greater than or equal to the threshold value T h ;
[0050] (1153) Determine the position and contour of the distorted image according to the points on the normalized image where the pixel is greater than or equal to the threshold value determined in step (1152).
[0051] According to one embodiment, the threshold value T h can be obtained by the following formula:
[0052]
[0053] where p x,y is the pixel value of the normalized image at the coordinate point (x, y), W is the image width of the normalized image, and H is the image height of the normalized image.
[0054] According to one embodiment, the threshold value T h can be obtained by the following formula:
[0055]
[0056] where p x,y is the pixel value of the normalized image at the coordinate point (x, y), W is the image width of the normalized image, and H is the image height of the normalized image.
[0057] According to one embodiment, step (1152) includes the following steps:
[0058] (11521) Scan the normalized image from four directions; and
[0059] (11522) Record the first point greater than or equal to the threshold T encountered during the scanning in the above four directions respectively. h .
[0060] According to one embodiment, step (1152) includes the following steps:
[0061] (11521) Scan the normalized image in four directions; and
[0062] (11522) Record the first point greater than or equal to the threshold T encountered during the scanning in the above four directions respectively. h .
[0063] According to one embodiment, step (1) further includes a step:
[0064] (13) Establish a rectangular coordinate system;
[0065] Wherein step (1152) further includes the following steps:
[0066] (11523) Accurately locate the center position and imaging radius of the distorted image according to the coordinate values of the first point greater than or equal to the threshold T encountered during the scanning in the four directions in step (11522) in the rectangular coordinate system; h .
[0067] Wherein the four directions include row by row from top to bottom, row by row from bottom to top, column by column from left to right, and column by column from right to left. The first point greater than or equal to the threshold T encountered during the scanning row by row from top to bottom, row by row from bottom to top, column by column from left to right, and column by column from right to left respectively is marked as h .
[0068] Wherein step (1152) further includes the following steps:
[0069] (11524) Calculate the vertical distance and horizontal distance of two groups of corresponding coordinates respectively, and the calculation method is as follows:
[0070] d1 = |y1 - y2|
[0071] d2 = |x3 - x4|
[0072] (11525) Determine the imaging diameter d3 of the distorted image as the larger value of d1 and d2, so that the imaging radius R of the distorted image = d3 / 2; and
[0073] (11536) Determine the center position of the distorted image, wherein the center coordinates are (xc , y c ), wherein,
[0074]
[0075]
[0076] According to one embodiment, step (1) further includes the following steps:
[0077] (14) Determine the coordinate points (x il , y i ) of the contour points of the distorted image in the plane rectangular coordinate system; and
[0078] (15) Determine the horizontal distance l from the contour point of the distorted image to the image center ik ;
[0079] Wherein
[0080] Where x il is the horizontal coordinate of the contour point of the i-th distorted image, y i is the vertical coordinate of the contour point of the i-th distorted image, and wherein l ik is the horizontal distance from the contour point of the i-th distorted image with the vertical coordinate y k to the image center.
[0081] According to one embodiment, step (12) includes the following steps:
[0082] (121) Detect the corner points of multiple paths of the distorted images;
[0083] (122) Detect the corner points of the superimposed image; and
[0084] (123) Determine the correction factor α of each path of image according to the corner points of each path of the distorted image and the corner points of the superimposed image i .
[0085] Wherein, the coordinate marks of the corner points of multiple paths of the distorted images detected in step (121) in the plane rectangular coordinate system are (x ik , y ik ), where i represents the number of the video path and k represents the corner point number in the video.
[0086] According to one embodiment, step (123) includes the following steps:
[0087] (1231) Accumulate the abscissa values of the corner points of each path of the distorted images in the plane rectangular coordinate system respectively to obtain the accumulated abscissa value X of the corner points of each path of the distorted images i ;
[0088] (1232) Accumulate the abscissas of the corner points of the superimposed image in the plane rectangular coordinate system to obtain the accumulated value X of the abscissas of the corner points of the superimposed image M ;
[0089] (1233) Set the correction factor α of the superimposed image M ; and
[0090] (1234) Calculate the correction factor α of each distorted image i , where α i = α M ·X i / X M .
[0091] According to one embodiment, the numerical range of the correction factor α of the superimposed image M is between 0.7 and 1.3
[0092] According to one embodiment, step (2) further includes the following steps:
[0093] (21) According to the correction parameters obtained in step (1), determine the distortion correction formula as follows:
[0094]
[0095] According to one embodiment, before step (112), step (11) further includes the following steps:
[0096] (111) Collect the checkerboard distorted images of multiple lenses
[0097] According to one embodiment, the distorted image correction method further includes the following steps:
[0098] (3) Correct the multiple distorted images according to the correction algorithm
[0099] According to one embodiment, step (3) further includes the following steps:
[0100] (31) Generate a distortion correction table according to the distortion correction formula in step (21)
[0101] According to one embodiment, step (3) further includes the following steps:
[0102] (32) Apply the correction table to the multiple high-definition distorted images under the embedded system to realize the real-time correction of the distorted images
[0103] According to another aspect of the present invention, the present invention further provides a method for locating a distorted image for locating a fish-eye image, wherein the method for locating a distorted image includes the following steps:
[0104] (113) Superimpose multiple distorted images to obtain a superimposed image;
[0105] (114) Linearly compress the superimposed image to obtain a normalized image; and
[0106] (115) Determine the position and contour of the distorted image according to the pixel values of the normalized image at each position.
[0107] According to an embodiment, before step (113), the method for locating a distorted image further includes the following steps:
[0108] (112) Filter the distorted image to filter out the noise of the distorted image.
[0109] According to an embodiment, step (114) includes the following steps:
[0110] (1141) Obtain the maximum pixel value P of the superimposed image max and the minimum pixel value P min ; and
[0111] (1142) Linearly compress the superimposed image I max according to the maximum pixel value P of the superimposed image min and the minimum pixel value P; S wherein the linear compression is performed using the following formula:
[0112] wherein, p
[0113]
[0114] is the pixel value of the normalized image after linear compression at the coordinate point (x, y), and P x,y is the pixel value of the superimposed image at the coordinate point (x, y). x,y max
[0115] According to an embodiment, step (114) includes the following steps:
[0116] (1141) Obtain the maximum pixel value P of the superimposed image max and the minimum pixel value P min ; and
[0117] (1142) Linearly compress the superimposed image I max according to the maximum pixel value P of the superimposed image min and the minimum pixel value P; SPerform linear compression;
[0118] Among them, the linear compression is carried out by the following formula:
[0119]
[0120] Among them, p x,y is the pixel value of the normalized image after linear compression at the coordinate point (x, y), and P x,y is the pixel value at the coordinate point (x, y) on the superimposed image.
[0121] According to an embodiment, step (115) includes the following steps:
[0122] (1151) Set the threshold T h ;
[0123] (1152) Record the points on the normalized image where the pixels are greater than or equal to the threshold T h ;
[0124] (1153) Determine the position and contour of the distorted image according to the points on the normalized image where the pixels are greater than or equal to the threshold determined in step (1152).
[0125] According to an embodiment, step (115) includes the following steps:
[0126] (1151) Set the threshold T h ;
[0127] (1152) Record the points on the normalized image where the pixels are greater than or equal to the threshold T h ;
[0128] (1153) Determine the position and contour of the distorted image according to the points on the normalized image where the pixels are greater than or equal to the threshold determined in step (1152).
[0129] According to an embodiment, the threshold T h can be obtained by the following formula:
[0130]
[0131] Among them, p x,y is the pixel value of the normalized image at the coordinate point (x, y), W is the image width of the normalized image, and H is the image height of the normalized image.
[0132] According to an embodiment, the threshold T h can be obtained by the following formula:
[0133]
[0134] where p x,y is the pixel value of the normalized image at the coordinate point (x, y), W is the image width of the normalized image, and H is the image height of the normalized image.
[0135] According to one embodiment, step (1152) includes the following steps:
[0136] (11521) Scan the normalized image from four directions; and
[0137] (11522) Record respectively the first point greater than or equal to the threshold T h encountered during the scanning in the above four directions.
[0138] According to one embodiment, step (1152) includes the following steps:
[0139] (11521) Scan the normalized image from four directions; and
[0140] (11522) Record respectively the first point greater than or equal to the threshold T h encountered during the scanning in the above four directions.
[0141] According to one embodiment, the distorted image positioning method further includes a step:
[0142] (13) Establish a plane rectangular coordinate system;
[0143] where step (1152) further includes the following steps:
[0144] (11523) Accurately locate the center position and imaging radius of the distorted image according to the coordinate values of the first point greater than or equal to the threshold T h encountered during the scanning in the four directions in step (11522) in the plane rectangular coordinate system;
[0145] where the four directions include row by row from top to bottom, row by row from bottom to top, column by column from left to right, and column by column from right to left, and the first point greater than or equal to the threshold T h encountered during the scanning respectively row by row from top to bottom, row by row from bottom to top, column by column from left to right, and column by column from right to left is respectively marked as
[0146] where step (1152) further includes the following steps:
[0147] (11524) Calculate respectively the vertical distance and horizontal distance of two groups of corresponding coordinates, and the calculation method is as shown below:
[0148] d1 = |y1 - y2|
[0149] d2 = |x3 - x4|
[0150] (11525) Determine the imaging diameter d3 of the distorted image as the larger value of d1 and d2, so that the imaging radius R of the distorted image = d3 / 2; and
[0151] (11536) Determine the center position of the distorted image, where the center coordinates are (x c , y c ), where
[0152]
[0153]
[0154] According to one embodiment, the distorted image positioning method further includes the following steps:
[0155] (14) Determine the coordinate points (x il , y i ) of the contour points of the distorted image in the plane rectangular coordinate system; and
[0156] (15) Determine the horizontal distance l from the contour points of the distorted image to the image center ik ;
[0157] where
[0158] where x il is the horizontal coordinate of the contour points of the i-th path of the distorted image, y i is the vertical coordinate of the contour points of the i-th path of the distorted image, where l ik is the horizontal distance from the contour points of the i-th path of the distorted image with the vertical coordinate of y k to the image center.
[0159] According to one embodiment, before step (112), the distorted image positioning method further includes the following steps:
[0160] (111) Collect the checkerboard distorted images of multiple lenses.
[0161] Through the understanding of the subsequent description and the drawings, the further objects and advantages of the present invention will be fully embodied.
[0162] These and other objects, features and advantages of the present invention are fully embodied through the following detailed description, drawings and claims. Brief Description of the Drawings
[0163] Figure 1 Schematic diagram of a filtering template used in a distortion image correction method according to a preferred embodiment of the present invention.
[0164] Figure 2 Schematic diagram of the distortion image correction method according to the above preferred embodiment of the present invention.
[0165] Figure 3 Illustrates a step of determining the contour of a distorted image in the distortion image correction method according to the above preferred embodiment of the present invention.
[0166] Figure 4 Illustrates a step of determining a correction factor in the distortion image correction method according to the above preferred embodiment of the present invention.
[0167] Figure 5 Schematic diagram of the distortion image correction method according to the above preferred embodiment of the present invention. Detailed implementation manners
[0168] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments in the following description are only examples, and those skilled in the art can think of other obvious variations. The basic principles defined in the following description of the present invention can be applied to other implementation schemes, variant schemes, improvement schemes, equivalent schemes, and other technical schemes that do not depart from the spirit and scope of the present invention.
[0169] Among the accompanying drawings Figures 1 to 4 Illustrates a distortion image correction method according to a preferred embodiment of the present invention. This distortion image correction method can be applied to the distortion correction of fish-eye images, but is not limited to the distortion correction of fish-eye images. Those skilled in the art should be able to understand that the correction of any distorted image that conforms to the circular distortion of the fish-eye image contour is applicable to this distortion image correction method. This preferred embodiment takes the distortion image correction of multi-channel distorted images as an example to introduce the distortion image correction method of the present invention in detail.
[0170] As shown in the accompanying drawings Figure 2 The distortion image correction method includes the following steps:
[0171] (1) Determine correction parameters;
[0172] (2) Determine a correction algorithm according to the correction parameters; and
[0173] (3) Perform real-time correction on the multi-channel distorted images according to the correction algorithm.
[0174] Among them, the correction parameters in step (1) are determined according to the distorted image. Specifically, step (1) includes the following steps:
[0175] (11) Determine the contour of each path of the distorted image; and
[0176] (12) Determine the correction factor α of each path of the distorted image i .
[0177] More specifically, step (11) includes the following steps:
[0178] (111) Collect the checkerboard distorted images of multiple paths of lenses;
[0179] (112) Filter the distorted images to filter out the noise on each path of the distorted images, so as to prevent the noise from affecting the correction of the distorted images;
[0180] (113) Superimpose the distorted images filtered by step (112) to obtain a superimposed image I S ;
[0181] (114) Linearly compress the superimposed image I S to obtain a normalized image I M ; and
[0182] (115) According to the pixel values p of the normalized image I M at each position x,y , accurately locate the position and contour of the distorted image.
[0183] Among them, the distorted images collected through step (111) have some noise due to the influence of some factors, which will interfere with the determination of the contour of the distorted images. Therefore, it is necessary to filter the distorted images to reduce the influence of the noise on the determination of the contour of the distorted images. The filtering template used is as Figure 1 shown.
[0184] Those skilled in the art should be able to understand that for distorted images without noise or with noise so small that it is not enough to affect the correction of the distorted images, there is no need to perform correction. That is to say, if the distorted images collected through step (111) have no noise or the noise is so small that it is not enough to affect the correction of the distorted graphics, then step (112) is not necessary. In this way, in step (113), the distorted images can be directly superimposed. That is to say, step (113) becomes superimposing the distorted images to obtain a superimposed image I S .
[0185] In order to more accurately locate the distorted images of each path, in this step (113), the distorted images are superimposed to offset the errors in determining the positions of the distorted images of each path. In other words, if the distorted images of each path are located separately, errors caused by various environmental factors or human factors will inevitably occur. These errors will not only lead to inaccurate positioning of the distorted images, but also may cause misalignment between the distorted images of each path due to different respective errors, thus further resulting in the inability to guarantee the quality of the corrected image. Therefore, uniformly locating the distorted images of each path through the image superimposition method is beneficial to guarantee the quality of the image after correction.
[0186] Among them, step (114) includes the following steps:
[0187] (1141) Obtain the maximum pixel value P S of the superimposed image I max and the minimum pixel value P min ; and
[0188] (1142) Linearly compress the superimposed image I S according to the maximum pixel value P max and the minimum pixel value P min of the superimposed image I S ;
[0189] Among them, the linear compression is carried out using formula 1:
[0190]
[0191] where p x,y is the pixel value of the normalized image I M after linear compression at the coordinate point (x, y), and P x,y is the pixel value of the superimposed image I S at the coordinate point (x, y).
[0192] In addition, it is worth mentioning that this preferred embodiment utilizes the characteristics that the middle part of the image captured by the distorted image is not deformed and the surrounding contour is circularly curved and distorted. First, the center of the circle where the surrounding contour of the circularly distorted image is located is positioned, and then the contour of the fish-eye image is accurately positioned. This center positioning method is both convenient and accurate, making this distorted image correction method simple and efficient.
[0193] Specifically, this step (115) includes the following steps:
[0194] (1151) Set a threshold value T h ;
[0195] (1152) Record the normalized image I MPoints where the upper pixel is greater than or equal to the threshold T h ;
[0196] (1153) Determine the position and contour of the distorted image according to the normalized image I determined in step (1152) M Points where the upper pixel is greater than or equal to the threshold T h to determine the position and contour of the distorted image
[0197] Furthermore, the method used in step (115) to determine the position and contour of the distorted image is the four-point positioning method. Specifically, step (1152) includes the following steps:
[0198] (11521) Scan the normalized image I M from four directions; and
[0199] (11522) Record respectively the first points greater than or equal to the threshold T h encountered during the scanning in the above four directions
[0200] More specifically, the four directions are row by row from top to bottom, row by row from bottom to top, column by column from left to right, and column by column from right to left
[0201] where the threshold T h is obtained by the following formula 2:
[0202]
[0203] where p x,y is the pixel value of the normalized image I M at the coordinate point (x, y), W is the image width of the normalized image, and H is the image height of the normalized image
[0204] To make the distorted image correction method faster, more accurate, and more effective, step (1) of the distorted image correction method further includes a step:
[0205] (13) Establish a plane rectangular coordinate system
[0206] It is worth mentioning that there is no difference in the order among step (11), step (12), and step (13), and the order among the three can be interchanged without limitation
[0207] The plane rectangular coordinate system established in step (13) enables each point on the image in the distorted image correction method to be determined by specific coordinate values, thereby helping to determine the relative position relationship related to the distorted image correction method in this coordinate system
[0208] On the other hand, since each point in the rectangular coordinate system can be calibrated by specific numerical values, it is convenient to accurately determine geometric figures by using the specific mathematical relationships of geometric figures. In this preferred embodiment of the present invention, since the contour of the fish-eye image presents a circular structure, this preferred embodiment uses the mathematical relationship of the circle to accurately locate the contour of the fish-eye image, thereby making the correction of the distorted image more accurate. On the other hand, it is convenient for mathematical calculations.
[0209] As Figure 2 shown, in the plane where the superimposed image I S is located, a rectangular coordinate system is established, where the rectangular coordinate system is composed of a mutually perpendicular X-axis and a Y-axis, where the X-axis and the Y-axis intersect at an origin O, and the coordinates of the coordinate points in the coordinate system are marked as (x, y).
[0210] It is worth mentioning that the rectangular coordinate system is established for the convenience of calculation and calibration, and has no substantial limiting effect on the present invention. That is to say, no matter where the coordinate system is established in the plane where the superimposed image I S is located, it does not affect the correction effect of the distorted image correction method on the distorted image. That is to say, each coordinate point (x, y) only plays a relative marking role, and the specific numerical values of x and y do not have absolute meanings.
[0211] Correspondingly, the step (1152) includes the following steps:
[0212] (11523) Accurately locate the center position and imaging radius of the distorted image according to the coordinate values of the first point greater than or equal to the threshold T h encountered during the scanning in the four directions in step (11522) in the rectangular coordinate system.
[0213] Specifically, during the scanning row by row from top to bottom, row by row from bottom to top, column by column from left to right, and column by column from right to left, the pixel points that meet the requirements are respectively marked as
[0214] The vertical distance and horizontal distance of two groups of corresponding coordinates are respectively calculated, and the calculation methods are shown in Formula 3 and Formula 4:
[0215] d1 = |y1 - y2| Formula 3
[0216] d2 = |x3 - x4| Formula 4
[0217] Select the larger value of d1 and d2 as the imaging diameter d3 of the distorted image, then the imaging radius R of the distorted image is obtained, and the center coordinates are (x c , y c ). R, xc , y c are respectively calculated through Formula 5, Formula 6, and Formula 7:
[0218] R = d3 / 2 Formula 5
[0219]
[0220]
[0221] This step (1) further includes the steps:
[0222] (14) determining the coordinate points (x il , y i ) of the contour points of the distorted image in the plane rectangular coordinate system; and
[0223] (15) determining the horizontal distance l from the contour points of the distorted image to the image center ik .
[0224] Wherein the contour of the distorted image refers to the surrounding contour of the distorted image. Among them, the coordinate values of the coordinate points of the contour points of the distorted image in the plane rectangular coordinate system in step (14) are determined by the following formula:
[0225]
[0226] Where x il is the horizontal coordinate of the contour point of the i-th path of the distorted image, and y i is the vertical coordinate of the contour point of the i-th path of the distorted image.
[0227] In step (15), the horizontal distance l from the contour points of the distorted image to the image center ik is determined by the following formula:
[0228]
[0229] Where l ik is the horizontal distance from the contour point with the vertical coordinate of y k of the i-th path of the distorted image to the image center.
[0230] It is worth mentioning that, according to the distorted image correction method of this preferred embodiment of the present invention, in step (15), the horizontal distance l from the contour points of the distorted image to the image center ik is calculated by means of the plane rectangular coordinate system and using the existing mathematical relationship formula of the geometric image contour, so that l ikThe numerical value is precise, thus ensuring the accuracy and precision of the distorted image correction method. However, those skilled in the art should be able to understand that this is merely an example of the present invention and not a limitation.
[0231] This step (12) includes the following steps:
[0232] (121) Detect the corner points of multiple paths of the distorted images;
[0233] (122) Detect the corner points of the superimposed image I S ; and
[0234] (123) Determine the correction factor α of each path of the image according to the corner points of each path of the distorted image and the corner points of the superimposed image I S . i .
[0235] Specifically, the coordinates of the corner points of multiple paths of the distorted images detected in step (121) in the plane rectangular coordinate system are marked as (x ik , y ik ), where i represents the number of the video path and k represents the corner point number in the video.
[0236] Step (123) includes the following steps:
[0237] (1231) Accumulate the abscissa values of the corner points of each path of the distorted images in the plane rectangular coordinate system to obtain the accumulated abscissa value X of the corner points of each path of the distorted images i ;
[0238] (1232) Accumulate the abscissa of the corner points of the superimposed image I S in the plane rectangular coordinate system to obtain the accumulated abscissa value X of the corner points of the superimposed image I S ; M ;
[0239] (1233) Set the correction factor α of the superimposed image I S (the range is between 0.7 and 1.3); and M (1234) Calculate the correction factor α of each path of the distorted images according to X
[0240] , X i , and α M , where α M = α i ·X i / X M . i M .
[0241] Among them, the formula for accumulating the abscissa values of the corner points of each path of distorted images in the plane rectangular coordinate system in step (1231) is shown in Formula 10:
[0242]
[0243] where x ik represents the abscissa size of the k-th corner point in the i-th checkerboard distorted image, and K represents the total number of corner points in each path of the distorted images.
[0244] It is worth mentioning that there is no distinction in the order between steps (121) and (122), and their order can be interchanged. Those skilled in the art should be able to understand that steps (121) and (122) can also be carried out simultaneously. That is to say, according to this preferred embodiment of the present invention, there is no difference in the order between steps (121) and (122).
[0245] Step (2) further includes the following steps:
[0246] (21) Determine the distortion correction formula according to the calibration parameters obtained in step (1):
[0247]
[0248] where a i is the radius of the major axis of the i-th fisheye video image; b i = 1, 2, 3,..., Z; Z is the radius of the width of the distorted image, x il is the horizontal coordinate of the contour of the i-th distorted image, x c is the horizontal coordinate of the center of the distorted image, l i is the distance from the horizontal coordinate of the contour of the i-th distorted image to the horizontal coordinate of the center of the distorted image, and α i is the correction factor of the i-th distorted image, reflecting the magnitude of the correction amplitude.
[0249] Step (3) further includes the following steps:
[0250] (31) Generate a distortion correction table according to Formula 11; and
[0251] (32) Apply the correction table to multiple paths of high-definition distorted images under the embedded system to achieve real-time correction of the distorted images.
[0252] It should be noted that the Arabic numerals 1, 2, 3, 4, 5, etc. used in the numbering in the steps of the distortion image correction method in the present invention are only for marking purposes and do not distinguish the order. Those skilled in the art should be able to understand that without violating the logical order of each step itself, the steps in the distortion image correction method have no order distinction. Of course, those skilled in the art should be able to understand that in the case where some subsequent steps require the previous steps as a prerequisite, these steps have a distinction in the order. For those steps that are not mutually prerequisite, as long as the purpose of the present invention can be achieved, their order can be interchanged.
[0253] To describe the present invention in more detail, taking the correction of fish-eye video images as an example, the distortion image correction method will be further described in detail below.
[0254] The distortion image correction method collects checkerboard images of multiple distorted images, performs low-pass filtering operations on these checkerboard images to filter out high-frequency noise on the images and eliminate related influences. The filtering template used is as Figure 1 shown.
[0255] Overlay the preprocessed multiple fish-eye images to obtain an overlay image I S . Traverse the overlay image I S to obtain the maximum value P max and the minimum value P min . Through P max and P min , linearly compress the overlay image I S to obtain a normalized image I M , and the pixel value range of the I M image is between 0 and 255. The linear compression is performed using Equation 1.
[0256] Set the threshold T h as the mean value of the overlay image, and its calculation method is shown in Equation 2.
[0257] Perform a pixel-by-pixel scan of the normalized image I M in four directions. When scanning in each direction, record the coordinate positions of the first pixel point greater than or equal to the threshold T h . The four scanning directions are row by row from top to bottom, row by row from bottom to top, column by column from left to right, and column by column from right to left. The pixel points that meet the requirements found during the scanning process are respectively marked as
[0258] respectively calculate the vertical distance and horizontal distance of two groups of corresponding coordinates, and their calculation methods are shown in Equation 3 and Equation 4.
[0259] Select the larger value between d1 and d2 as the imaging diameter d3 of the fisheye image, then obtain the imaging radius R of the fisheye image, and the center coordinates are (x c , y c ). R, x c , y c are calculated through Formula 5, Formula 6, and Formula 7 respectively.
[0260] Obtain the coordinates (x il , y i ) of the contour points of each fisheye video image through Formula 8.
[0261] Obtain the horizontal distance l ik from the contour points of each fisheye video image to the center of the image through Formula 9.
[0262] Detect the corner points (x ik , y ik ) in each checkerboard image through the corner detection algorithm, where i represents the number of the video and k represents the corner point number in the video.
[0263] Accumulate the abscissas of the corner points of each fisheye video to obtain the accumulated value of the abscissas of the corner points of each fisheye video.
[0264] Detect the corner points of the superimposed image I S , and accumulate the abscissas of all corner points to obtain X M .
[0265] Set the correction factor α M (the range is between 07 and 13) of the superimposed image, then the correction factors α i of other videos can be obtained, α M = α i ·X M / X
[0266] Comprehensively obtain the distortion correction formula 11 of each fisheye video through the various parameters obtained previously.
[0267] Using Formula 11, a distortion correction table corresponding to each pixel can be generated for each fisheye video, meeting the real-time correction requirements of multiple high-definition fisheye videos under the embedded system.
[0268] Those skilled in the art should understand that the embodiments of the present invention described above and shown in the accompanying drawings are only examples and do not limit the present invention. The object of the present invention has been fully and effectively achieved. The function and structural principle of the present invention have been shown and described in the embodiments, and the embodiments of the present invention can have any deformation or modification without departing from the said principle.
Claims
1. A distortion image correction method for correcting a fish-eye image, characterized in that, The distortion image correction method includes the following steps: (a) Superimpose multiple distorted images to obtain a superimposed image; (b) Linearly compress the superimposed image to obtain a normalized image; (c) Determine the position and contour of the distorted image according to the pixel values of the normalized image at various positions; (d) Detect the corner points of multiple distorted images; (e) Detect the corner points of the superimposed image; (f) Determine the correction factors of each distorted image according to the corner points of each distorted image and the corner points of the superimposed image; and (g) Determine the correction parameters according to the correction factors, and then determine the correction algorithm, where the step (c) further includes the steps: (c.1) Set the threshold value T h ; (c.2) Record the points on the normalized image where the pixels are greater than or equal to the threshold T h ; and (c.3) Determine the position and contour of the distorted image based on the points on the normalized image where the pixels are greater than or equal to the threshold T h ; wherein the threshold value T h can be obtained by the following formula: where p x,y is the pixel value of the normalized image at the coordinate point (x, y), W is the image width of the normalized image, and H is the image height of the normalized image, where the step (c.2) further includes the steps: (c.2.1) Scan the normalized image in four directions; (c.2.2) Record the first point greater than or equal to the threshold T encountered during the scanning process in the above four directions respectively h ; (c.2.3)Precisely locate the center position and imaging radius of the distorted image according to the coordinate values of the first point greater than or equal to the threshold T encountered during the scanning process in the four directions h in a two-dimensional rectangular coordinate system; Wherein the four directions include row by row from top to bottom, row by row from bottom to top, column by column from left to right, and column by column from right to left. Among them, the first point greater than or equal to the threshold T encountered during the scanning process row by row from top to bottom, row by row from bottom to top, column by column from left to right, and column by column from right to left respectively h is respectively marked as (c.2.4) Calculate the vertical distance and horizontal distance of two sets of corresponding coordinates respectively, where the calculation method is as follows: d1 = |y1 - y2| d2 = |x3 - x4| (c.2.5) Determine the imaging diameter d3 of the distorted image as the larger value of d1 and d2, so that the imaging radius R of the distorted image = d3 / 2; and (c.2.6) Determine the center position of the distorted image, where the center coordinates are (x c , y c ), where Wherein the step (f) further includes the steps of: (f.1) Accumulate the abscissa values of the corner points of each of the distorted images in the plane rectangular coordinate system respectively to obtain the accumulated abscissa value X of the corner points of each of the distorted images i ; (f.2)Accumulate the abscissas of the corner points of the superimposed image in the plane rectangular coordinate system to obtain the accumulated value X of the abscissas of the corner points of the superimposed image M ; (f.3) Set the correction factor α of the superimposed image M ; and (f.4) Calculate the correction factor α of each distorted image i , where α i = α M · X i / X M , where the correction factor α M of the superimposed image ranges in value between 0.7 and 1.
3.
2. The distortion image correction method according to claim 1, wherein before the step (a), the distortion image correction method further includes the step: (h) Filter the noise of the distorted image.
3. The distortion image correction method according to claim 1, wherein the step (b) further includes the steps: (b.1) Obtain the maximum pixel value P of the superimposed image max and the minimum pixel value P min ; and (b.2) According to the maximum pixel value P of the superimposed image max and the minimum pixel value P min perform linear compression on the superimposed image I S ; wherein the linear compression is performed using the following formula: where p x,y is the pixel value of the normalized image after linear compression at the coordinate point (x, y), and P x,y is the pixel value at the coordinate point (x, y) on the superimposed image.
4. The distortion image correction method according to claim 1, wherein in the step (g), the distortion correction formula is determined according to the correction parameters as follows: where a i is the radius of the major axis of the fisheye video image of the i-th path; b i = 1, 2, 3, …, Z, where Z is the radius of the width of the distorted image; x il is the horizontal coordinate of the contour of the i-th path of the distorted image, and x c is the horizontal coordinate of the center of the distorted image, l i is the distance from the horizontal coordinate of the contour of the i-th path of the distorted image to the horizontal coordinate of the center of the distorted image, and α i is the correction factor of the i-th path of the distorted image, reflecting the magnitude of the correction amplitude.
5. The distortion image correction method according to claim 2, wherein before the step (h), the distortion image correction method further includes the step: (i) Collect the checkerboard distortion images of multiple lenses.
6. The distortion image correction method according to claim 4, further includes the step: (j) Correct multiple distorted images according to the correction algorithm, where the step (j) further includes the steps: (j.1) Generate a distortion correction table according to the distortion correction formula in the step (g); and (j.2) Apply the correction table to multiple high-definition distorted images under an embedded system to achieve real-time correction of the distorted images.
Citation Information
Patent Citations
Distortion image correction method and positioning method thereof
CN106875341A