Fisheye image correction method applied to vehicle-mounted splicing system and storage medium

By identifying the black border edges in fisheye images and performing curve fitting mapping correction, the problem of edge field of view loss in vehicle-mounted fisheye lens images is solved, achieving full field of view preservation and black border removal, thus improving the monitoring effect of the vehicle-mounted splicing system.

CN116309090BActive Publication Date: 2026-05-05SHENZHEN MAXVISION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN MAXVISION TECH
Filing Date
2022-09-09
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing image correction methods for vehicle-mounted fisheye lenses result in loss of edge field of view and blind spots in monitoring. Furthermore, the traditional circular unfolding method is not suitable for the installation angle of vehicle-mounted fisheye lenses, resulting in black areas in the lower half of the field of view.

Method used

By determining the black border edge within the fisheye image, curve fitting is performed, and the fitted curve is mapped and corrected to the image boundary to obtain the correction mapping relationship. This relationship is then used to perform mapping correction on the fisheye image, preserving the entire field of view and removing the black border.

Benefits of technology

It effectively preserves the entire field of view, and the corrected image conforms to human eye observation habits. Black borders are removed, avoiding loss of field of view and blind spots in monitoring, thus improving the field of view utilization rate of the vehicle splicing system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116309090B_ABST
    Figure CN116309090B_ABST
Patent Text Reader

Abstract

This application discloses a fisheye image correction method applied to an in-vehicle stitching system. The method includes acquiring a fisheye image F using an in-vehicle fisheye lens; determining the edges of black borders within the fisheye image F; performing curve fitting on the pixels at the edges of the black borders; mapping the fitted curve to the image boundary of the fisheye image F to obtain a correction mapping relationship; and acquiring a fisheye image T to be corrected using the in-vehicle fisheye lens, and performing mapping correction on the corrected fisheye image T using the correction mapping relationship. This application also provides a computer-readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing, and more specifically, to a fisheye image correction method and storage medium for use in vehicle stitching systems. Background Technology

[0002] When performing vehicle surround view stitching, vehicle cameras usually use fisheye lenses. However, due to the excessively large field of view of fisheye lenses, image distortion is inevitable. The distortion is often most obvious at the edges of the image. Typically, the image captured by a fisheye lens is a spherical image with a black border around its edges. To adapt to the driver's human eye observation habits, distortion correction of the fisheye image is necessary.

[0003] Existing correction methods often focus on the central portion, which not only causes greater distortion at the edges but also results in the loss of some edge views. This can lead to blind spots during subsequent panoramic stitching. Furthermore, some existing correction methods use a circular unfolding approach. However, since the primary monitoring direction of a vehicle-mounted fisheye lens is the ground, with some coverage in front, the installation angle is often downward at 45 degrees. This angle results in a black, non-circular ring in the lower half of the lens's field of view. Therefore, the traditional correction method of finding the center and radius to unfold the image in a circle is not suitable for correcting vehicle-mounted fisheye images. Summary of the Invention

[0004] The technical problem solved by this application is to provide a fisheye image correction method and storage medium for use in vehicle stitching systems that preserves the entire field of view during the correction process.

[0005] To address the aforementioned technical problems, this application provides a fisheye image correction method for use in vehicle-mounted stitching systems, comprising:

[0006] Use a vehicle-mounted fisheye lens to acquire a fisheye image F, and determine the edge of the black border within the fisheye image F;

[0007] Curve fitting is performed on the pixels at the edge of the black border;

[0008] The fitted curve is mapped and corrected to the image boundary of the fisheye image F to obtain the corrected mapping relationship; and...

[0009] A fisheye image T to be corrected is acquired using an onboard fisheye lens, and the corrected fisheye image T is mapped and corrected using a correction mapping relationship.

[0010] In one possible implementation, the steps for determining the edge of the black border within the fisheye image F include:

[0011] Binarize the fisheye image F to obtain a binarized image B. In the binarized image, the pixel value of the foreground region of the fisheye image F is 255, and the pixel value of the distorted black region is 0.

[0012] Extract the contour points of the black border within the binarized image B;

[0013] The outline is divided into a left black edge, a right black edge, and a bottom black edge;

[0014] In this system, the top left corner of the fisheye image F is taken as the origin of the image coordinate system. The x-coordinate range of the pixels on the left black edge is [0, W / 2] and the y-coordinate range is [0, H / 2]. The x-coordinate range of the pixels on the right black edge is (W / 2, W] and the y-coordinate range is [0, H / 2]. The x-coordinate range of the pixels on the bottom black edge is (0, W) and the y-coordinate range is (H / 2, H). Here, W is the width of the fisheye image F on the X-axis, and H is the height of the fisheye image on the Y-axis.

[0015] In one possible implementation, the steps for extracting the contour points of the black edge within the binarized image B are as follows: traverse from the image boundary of the binarized image B towards the image center to find the black-white boundary points, and the contour of the black edge is formed by all the black-white boundary points.

[0016] In one possible implementation, curve fitting for the black edges is specifically performed by using OpenCV's polyfit function to perform curve fitting on the pixels of the left black edge, the right black edge, and the bottom black edge to obtain the left black edge curve y1 = SL(x1), the right black edge curve y2 = SR(x2), and the bottom black edge curve y3 = SD(x3).

[0017] Where x1 represents the coordinate of any point on the Y-axis of the left black edge curve y1=SL(x1) and x1∈[0,H / 2], x2 represents the coordinate of any point on the Y-axis of the right black edge curve y2=SR(x2) and x2∈[0,H / 2], and x3 represents the coordinate of any point on the X-axis of the lower black edge curve y3=SD(x3) and x3∈(0,W).

[0018] In one possible implementation, the fisheye image F is divided into a left half, a right half, and a lower half by the straight line y = H / 2 and a straight line formed by two points (W / 2, 0) and (W / 2, H / 2); wherein the step of correcting the fitted curve mapping to the image boundary of the fisheye image F to obtain the corrected mapping relationship includes:

[0019] Obtain the left mapping relation MapL for eliminating the left black edge: Let y = j (j = 0, 1, 2, ..., H), traverse along the Y-axis, and linearly stretch the line segment from pixel (W / 2, j) of the fisheye image F to the edge point (SL(j), j) on the left black edge curve into a line segment between pixel (W / 2, j) of the fisheye image F and the left boundary point (0, j) of the fisheye image F. Then the left mapping relation MapL(i, j) = j * (W / 2) / (W / 2 - SL(j)) (i = 0, 1, ..., W / 2; j = 0, 1, ..., H / 2);

[0020] Obtain the right mapping relation MapR for eliminating the right black edge: Let y = j ((j = 0, 1, 2, ..., H) traverse along the Y-axis direction, and linearly stretch the line segment from pixel (W / 2, j) of the fisheye image F to the edge point (SR(j), j) on the right black edge curve into a line segment between pixel (W / 2, j) of the fisheye image F and the right boundary point (W, j) of the fisheye image F. Then the left mapping relation MapR(i, j) = (jW / 2)*(W / 2) / (SR(j)-W / 2)+W / 2 (i = 0, 1, ..., W / 2; j = 0, 1, ..., H / 2);

[0021] Obtain the downmapping relationship MapD for eliminating the lower black edge: Let x = i (i = 0, 1, 2, ..., W), traverse along the X-axis, and linearly stretch the line segment between the pixel point (i, 0) of the fisheye image F and the edge point (i, SD(i)) on the lower black edge curve to the line segment between the pixel point (i, 0) of the fisheye image F and the lower boundary point (i, H) of the fisheye image F. Then the downmapping relationship MapD(i, j) = j * (H / SD(i)) (i = 0, 1, ..., W; j = 0, 1, ..., H).

[0022] In one possible implementation, the fisheye image T is mapped using a correction mapping relationship. This involves mapping the fisheye image T three times using a left mapping relationship MapL, a right mapping relationship MapR, and a down mapping relationship MapD to form the corrected image R.

[0023] In one possible implementation, after mapping correction of the corrected fisheye image T, the fisheye image correction method further includes interpolating the blank points in the corrected image R formed by mapping correction.

[0024] In one possible implementation, the steps for binarizing the fisheye image F to obtain the binarized image R are as follows: if F(x0,y0)≥T, B(x0,y0)=255, otherwise, B(x0,y0)=0; where F(x0,y0) is the pixel value of the fisheye image F at any pixel point (x0,y0), F(x0,y0) is the pixel value of the binarized image at pixel point (x0,y0), and T is the binarization threshold.

[0025] In one possible implementation, T takes the value 20.

[0026] This application also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the fisheye image correction method applied to an in-vehicle stitching system.

[0027] In the fisheye image correction method, the edges of the black borders caused by distortion within the fisheye image are determined. Curve fitting is then performed on the pixels belonging to the edges of the black borders. The fitted curves are then mapped and corrected to the image boundary of the fisheye image F to obtain a correction mapping relationship. Subsequent fisheye images T can be directly corrected using this correction mapping relationship. Because the black borders of the distorted image are corrected to the image boundary during the correction mapping process, the entire field of view of the original image is preserved. Furthermore, the corrected image obtained by this fisheye image correction method removes the black borders, transforming the distorted image into a rectangular image that conforms to human visual perception. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is an overall flowchart of the fisheye image correction method applied to an in-vehicle stitching system according to an embodiment of this application;

[0030] Figure 2 The fisheye image captured by the vehicle-mounted fisheye lens in this embodiment of the application;

[0031] Figure 3 Examples of embodiments of this application Figure 1 The execution steps of steps S200, S300 and S400 in the overall flowchart are shown in the flowchart.

[0032] Figure 4 This is a schematic diagram illustrating the division of a fisheye image into a left half image, a right half image, and a lower half image according to an embodiment of this application.

[0033] Figure 5 This is a schematic diagram showing the result of extracting the contour points of the black border in the binarized image B according to an embodiment of this application;

[0034] Figure 6 This is a schematic diagram showing the result of correcting a fisheye image according to an embodiment of this application. Detailed Implementation

[0035] To make the technical problems, technical solutions, and beneficial effects to be solved by this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this application.

[0036] It should be noted that when a component is referred to as being "fixed to" or "set on" another component, it can be directly on or indirectly on that other component. When a component is referred to as being "connected to" another component, it can be directly connected to or indirectly connected to that other component.

[0037] It should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.

[0038] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0039] The fisheye image correction method and computer storage medium applied to the vehicle-mounted stitching system of this application will now be described in detail with reference to the accompanying drawings.

[0040] Please refer to Figure 1 The fisheye image correction method provided in this application is applied to an in-vehicle stitching system. Typically, in an in-vehicle stitching system, multiple wide-angle fisheye lenses are positioned around the vehicle body to capture images. These images are then stitched together to form a panoramic view to assist the driver. In in-vehicle stitching systems, the lens mounting angle is often downwards at 45 degrees. This angle results in a black ring in the lower half of the lens's field of view, causing the distorted black edge of the captured fisheye image to be non-circular. The fisheye image correction method applied to an in-vehicle stitching system includes the following steps:

[0041] Step S100: Acquire a fisheye image F using a vehicle-mounted fisheye lens, determine the edge of the black border within the fisheye image F, and the acquired fisheye image is as follows. Figure 2 As shown;

[0042] Step S200: Perform curve fitting on the pixels at the edge of the black border;

[0043] Step S300: Map the fitted curve to the image boundary of the fisheye image F to obtain the correction mapping relationship;

[0044] Step S400: Use the vehicle-mounted fisheye lens to acquire the fisheye image T to be corrected, and use the correction mapping relationship to perform mapping correction on the corrected fisheye image T.

[0045] In the fisheye image correction method, the edges of the black borders caused by distortion within the fisheye image are determined. Curve fitting is then performed on the pixels belonging to the edges of the black borders. The fitted curves are then mapped and corrected to the image boundary of the fisheye image F to obtain a correction mapping relationship. Subsequent fisheye images T can be directly corrected using this correction mapping relationship. Because the black borders of the distorted image are corrected to the image boundary during the correction mapping process, the entire field of view of the original image is preserved. Furthermore, the corrected image obtained by this fisheye image correction method removes the black borders, transforming the distorted image into a rectangular image that conforms to human visual perception.

[0046] It is worth noting that, due to the installation of the aforementioned vehicle-mounted fisheye lens, the distorted black borders in the fisheye image are not regular circles. The fisheye image correction method avoids focusing on the center position enclosed by the black borders and directly corrects the distorted area. Since the distorted area and situation are consistent during the acquisition process of the installed fisheye lens, the fisheye image correction method only needs to obtain the correction mapping relationship for a single fisheye image. Subsequent fisheye images can be corrected using this correction mapping relationship, saving time and improving efficiency.

[0047] In this embodiment, the black edge refers to the edge generated by distortion within the fisheye image, that is, the boundary between the black area and the foreground area in the fisheye image.

[0048] Please refer to Figure 3 In this embodiment, the step of determining the edge of the black border within the fisheye image F in step S200 includes:

[0049] Step S210: Binarize the fisheye image F to obtain a binarized image B. In the binarized image, the pixel value of the foreground region of the fisheye image F is 255, and the pixel value of the distorted black region is 0. Understandably, the foreground region refers to the area outside the black region in the fisheye image, and the background region is the black region in the fisheye image.

[0050] Step S220: Extract the contour points of the black border within the binarized image B.

[0051] Step S230: Divide the outline into a left black edge, a right black edge, and a bottom black edge.

[0052] In this system, the top left corner of the fisheye image F is taken as the origin of the image coordinate system. The x-coordinate range of the pixels on the left black edge is [0, W / 2] and the y-coordinate range is [0, H / 2]. The x-coordinate range of the pixels on the right black edge is (W / 2, W] and the y-coordinate range is [0, H / 2]. The x-coordinate range of the pixels on the bottom black edge is (0, W) and the y-coordinate range is (H / 2, H). Here, W is the width of the fisheye image F on the X-axis, and H is the height of the fisheye image on the Y-axis.

[0053] In this embodiment, step S210, which involves binarizing the fisheye image F to obtain the binarized image R, is as follows: if F(x0,y0)≥T, B(x0,y0)=255; otherwise, B(x0,y0)=0. Here, F(x0,y0) is the pixel value at any pixel point (x0,y0) in the fisheye image F, F(x0,y0) is the pixel value at pixel point (x0,y0) in the binarized image, and T is the binarization threshold. In this embodiment, T is set to 20, but it is not limited to this. In practical applications, the threshold T can be adjusted so that the black areas of the fisheye image are 0 as much as possible, and other areas are 255.

[0054] It is worth noting that in the image coordinate system, the outline is divided into a left black edge, a right black edge, and a bottom black edge by the line y = H / 2 and a line formed by the two points (W / 2, 0) and (W / 2, H / 2). The line y = H / 2 is... Figure 4 L1 in the equation is a straight line formed by two points (W / 2, 0) and (W / 2, H / 2). Figure 4 Line L2 in the middle.

[0055] In this embodiment, the step of extracting the contour points of the black edge in the binarized image B in step S220 is as follows: Traverse from the image boundary of the binarized image B towards the image center to find the black-and-white boundary points; the contour of the black edge is formed by all the black-and-white boundary points. The extracted contour is as follows: Figure 5 As shown.

[0056] In this embodiment, in step S230, the curve fitting of the black edge is specifically performed by using the polyfit function of OpenCV to perform curve fitting on the pixels of the left black edge, the pixels of the right black edge, and the pixels of the bottom black edge to obtain the left black edge curve y1=SL(x1), the right black edge curve y2=SR(x2), and the bottom black edge curve y3=SD(x3).

[0057] Where x1 represents the coordinate of any point on the Y-axis of the left black edge curve y1=SL(x1) and x1∈[0,H / 2], x2 represents the coordinate of any point on the Y-axis of the right black edge curve y2=SR(x2) and x2∈[0,H / 2], and x3 represents the coordinate of any point on the X-axis of the lower black edge curve y3=SD(x3) and x3∈[0,W].

[0058] It is worth noting that when establishing an image coordinate system, it is common practice to use the horizontal axis as the X-axis and the vertical axis as the Y-axis. However, in the fisheye image correction method, during the subsequent correction process, the left black edge curve is stretched to the left to the left edge of the image and the right black edge curve is stretched to the right to the right edge of the image. To facilitate the subsequent calculation process, when solving the left black edge curve y1 = SL(x1), the Y-axis coordinate of the left black edge pixel is taken as the independent variable x1 of the curve y1 = SL(x1), and the X-axis coordinate of the left black edge pixel is taken as the dependent variable y1 of the curve y1 = SL(x1). Therefore, x1 ∈ [0, H / 2]. When solving the right black edge curve y2 = SR(x2), the Y-axis coordinate of the right black edge pixel is taken as the independent variable x2 of the curve y2 = SR(x2), and the X-axis coordinate of the right black edge pixel is taken as the dependent variable y2 of the curve y2 = SR(x2). Therefore, x2 ∈ [0, H / 2]. The lower black edge curve is stretched down to the lower boundary of the image. When solving the lower black edge curve y3=SR(x3), the coordinates of the pixels of the lower black edge on the X-axis are used as the independent variable x3 of the curve y3=SD(x3), and the coordinates of the pixels of the lower black edge on the Y-axis are used as the dependent variable y3 of the curve y3=SD(x3). Therefore, x3∈[0,W].

[0059] In this embodiment, the fisheye image F is also divided into a left half, a right half, and a lower half using the straight line y = H / 2 and a straight line formed by two points (W / 2, 0) and (W / 2, H / 2). Figure 4 As shown, Figure 4 In this context, SLeft, SRight, and SDown represent the left half, right half, and bottom half of the image, respectively.

[0060] In step S400, the step of mapping the fitted curve to the image boundary of the fisheye image F to obtain the correction mapping relationship includes:

[0061] Step S410: Obtain the left mapping relationship MapL for eliminating the left black edge: Let y = j (j = 0, 1, 2, ..., H), traverse along the Y-axis direction, linearly stretch the line segment from pixel (W / 2, j) of the fisheye image F to the edge point (SL(j), j) on the left black edge curve into a line segment between pixel (W / 2, j) of the fisheye image F and the left boundary point (0, j) of the fisheye image F, and simultaneously stretch the left black edge curve to the left boundary x (y = j) = 0 of the fisheye image F. Then, based on the aforementioned stretching relationship, establish the left mapping relationship MapL(i, j) = j * (W / 2) / (W / 2 - SL(j)) (i = 0, 1, ... W / 2; j = 0, 1, ... H / 2). It can be understood that since the left mapping relationship MapL mainly utilizes the mapping relationship established during the stretching process of the left half of the image, if the left mapping relationship MapL is used for correction, only the left half of the image is stretched and corrected.

[0062] Step S420: Obtain the right mapping relationship MapR for eliminating the right black edge: Let y = j ((j = 0, 1, 2, ..., H) traverse along the Y-axis direction, linearly stretch the line segment from pixel (W / 2, j) of the fisheye image F to the edge point (SR(j), j) on the right black edge curve into a line segment between pixel (W / 2, j) of the fisheye image F and the right boundary point (W, j) of the fisheye image F, and simultaneously stretch the right black edge curve to the right boundary x(y) of the fisheye image F. If ...

[0063] Step S430: Obtain the downmapping relationship MapD for eliminating the lower black edge: Let x = i (i = 0, 1, 2, ..., W), traverse along the X-axis direction, linearly stretch the line segment between the pixel point (i, 0) of the fisheye image F and the edge point (i, SD(i)) on the lower black edge curve to the line segment between the pixel point (i, 0) of the fisheye image F and the lower boundary point (i, H) of the fisheye image F, and stretch the lower black edge curve to the lower boundary y(x = j) = H of the fisheye image F. Then, based on the aforementioned stretching relationship, establish the downmapping relationship MapD(i, j) = j * (H / SD(i)) (i = 0, 1, ..., W; j = 0, 1, ..., H). It can be understood that since the downmapping relationship MapD mainly utilizes the mapping relationship established during the stretching process of the lower part of the image, if it is a right mapping relationship MapD, only the lower part of the image is stretched and corrected during the correction process.

[0064] In the above steps, W is the width of the fisheye image F on the X-axis, and H is the height of the fisheye image on the Y-axis. (i,j) are the coordinates of any pixel in the image in the above mapping relationship.

[0065] In this embodiment, in step S400, the fisheye image T is mapped and corrected using the correction mapping relationship. This involves using the left mapping relationship MapL, the right mapping relationship MapR, and the lower mapping relationship MapD to map the fisheye image T three times to form the corrected image R. It is worth noting that since the fisheye lens is already installed on the vehicle, the distortion positions of images acquired by the same vehicle-mounted fisheye lens are the same. Therefore, the correction mapping relationships obtained in steps S1 to S3 can be directly used for mapping correction. Furthermore, although the left mapping relationship MapL corrects the entire fisheye image, it only stretches the left half of the image. Similarly, although the right mapping relationship MapR corrects the entire fisheye image, it only stretches the right half of the image. Similarly, although the lower mapping relationship MapD corrects the entire fisheye image, it only stretches the lower half of the image. Therefore, the order in which the left mapping relationship MapL, the right mapping relationship MapR, and the lower mapping relationship MapD are used is not restricted when mapping and correcting the fisheye image using the three mapping relationships. The result of fisheye correction using the above fisheye image correction method is as follows: Figure 6 As shown.

[0066] In the above steps, after mapping correction of the corrected fisheye image T, the fisheye image correction method further includes interpolating the blank points in the corrected image R formed by mapping correction. Before correction, the image has a black outer ring. However, after correction stretching, the black outline within the fisheye image is stretched to the image boundary. Simultaneously, the pixels in the left half of the image shift to the left, the pixels in the right half shift to the right, and the pixels in the lower half shift downwards, resulting in blank points. Interpolation is performed on the pixel values ​​of these blank points to fill them. In one embodiment, the interpolation is performed using the `remap` function from the OpenCV library.

[0067] This application embodiment also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the fisheye image correction method applied to an in-vehicle stitching system.

[0068] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A fisheye image correction method applied to an in-vehicle stitching system, characterized in that, include: Using a vehicle-mounted fisheye lens to acquire a fisheye image F, determine the edge of the black border within the fisheye image F; including: Binarize the fisheye image F to obtain a binarized image B. In the binarized image, the pixel value of the foreground region of the fisheye image F is 255, and the pixel value of the distorted black region is 0. Extract the contour points of the black border within the binarized image B; The outline is divided into a left black edge, a right black edge, and a bottom black edge; In this system, the top left corner of the fisheye image F is taken as the origin of the image coordinate system. The x-coordinate range of the pixels on the left black edge is [0, W / 2] and the y-coordinate range is [0, H / 2]. The x-coordinate range of the pixels on the right black edge is (W / 2, W] and the y-coordinate range is [0, H / 2]. The x-coordinate range of the pixels on the bottom black edge is (0, W) and the y-coordinate range is (H / 2, H). Here, W is the width of the fisheye image F on the X-axis, and H is the height of the fisheye image on the Y-axis. Curve fitting is performed on the pixels at the edges of the black border; specifically, the polyfit function of OpenCV is used to perform curve fitting on the pixels at the left black edge, the right black edge, and the bottom black edge to obtain the left black edge curve y1=SL(x1), the right black edge curve y2=SR(x2), and the bottom black edge curve y3=SD(x3). Where x1 represents the coordinate of any point on the Y-axis of the left black edge curve y1=SL(x1) and x1∈[0,H / 2], x2 represents the coordinate of any point on the Y-axis of the right black edge curve y2=SR(x2) and x2∈[0,H / 2], and x3 represents the coordinate of any point on the X-axis of the lower black edge curve y3=SD(x3) and x3∈(0,W); The fisheye image F is divided into a left half, a right half, and a lower half by the line y = H / 2 and a line formed by two points (W / 2, 0) and (W / 2, H / 2); the step of mapping the fitted curve to the image boundary of the fisheye image F to obtain the corrected mapping relationship includes: Obtain the left mapping relation MapL for eliminating the left black edge: Let y=j (j=0,1,2,…,H), traverse along the Y-axis, and linearly stretch the line segment from pixel (W / 2,j) of the fisheye image F to the edge point (SL (j), j) on the left black edge curve into a line segment between pixel (W / 2,j) of the fisheye image F and the left boundary point (0,j) of the fisheye image F. Then the left mapping relation MapL(i,j)=j*(W / 2) / (W / 2-SL (j)) (i=0,1,…W / 2; j=0,1,…H / 2); Obtain the right mapping relation MapR for eliminating the right black edge: Let y=j ((j=0,1,2,…,H) traverse along the Y-axis direction, and linearly stretch the line segment from pixel (W / 2,j) of the fisheye image F to the edge point (SR (j), j) on the right black edge curve into a line segment between pixel (W / 2,j) of the fisheye image F and the right boundary point (W,j) of the fisheye image F. Then the left mapping relation MapR(i,j)=(j-W / 2)*(W / 2) / (SR (j)-W / 2)+W / 2 (i=0,1,…W / 2; j=0,1,…,H / 2); Obtain the downmapping relationship MapD for eliminating the lower black edge: Let x=i (i=0,1,2,…,W), traverse along the X-axis, and linearly stretch the line segment between the pixel point (i,0) of the fisheye image F and the edge point (i,SD(i)) on the lower black edge curve to the line segment between the pixel point (i,0) of the fisheye image F and the lower boundary point (i,H) of the fisheye image F. Then the downmapping relationship MapD(i,j) = j*(H / SD(i)) (i=0,1,…W; j=0,1,…H); The fitted curve is mapped and corrected to the image boundary of the fisheye image F to obtain the correction mapping relationship; and A fisheye image T to be corrected is acquired using an onboard fisheye lens, and the corrected fisheye image T is mapped and corrected using a correction mapping relationship.

2. The fisheye image correction method applied to an in-vehicle stitching system as described in claim 1, characterized in that, The steps to extract the contour points of the black edge in the binarized image B are as follows: traverse from the image boundary of the binarized image B to the image center to find the black-white boundary points, and the contour of the black edge is formed by all the black-white boundary points.

3. The fisheye image correction method applied to an in-vehicle stitching system as described in claim 2, characterized in that, The corrected fisheye image T is mapped using the correction mapping relationship. The correction is performed by mapping the fisheye image T three times using the left mapping relationship MapL, the right mapping relationship MapR, and the down mapping relationship MapD to form the corrected image R.

4. The fisheye image correction method applied to an in-vehicle stitching system as described in claim 3, characterized in that, After performing mapping correction on the corrected fisheye image T, the fisheye image correction method further includes interpolating the blank points in the corrected image R formed by mapping correction.

5. The fisheye image correction method applied to an in-vehicle stitching system as described in claim 1, characterized in that, The steps to binarize a fisheye image F to obtain a binarized image R are as follows: if F(x0,y0)≥T, B(x0,y0)=255, otherwise, B(x0,y0)=0; where F(x0,y0) is the pixel value of the fisheye image F at any pixel point (x0,y0), F(x0,y0) is the pixel value of the binarized image at pixel point (x0,y0), and T is the binarization threshold.

6. The fisheye image correction method applied to an in-vehicle stitching system as described in claim 5, characterized in that, T takes the value 20.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the fisheye image correction method for an in-vehicle stitching system as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Calibration method and device of fish-eye lens

    CN106485754A

  • Fisheye image rapid correction method based on distortion stretching factor

    CN114331826A