A fisheye image correction method and system based on an effective area extraction algorithm

By using density-shape analysis and preset thresholds to process the grayscale information of fisheye images, the problem of fisheye image radius acquisition error was solved, and highly accurate fisheye image correction was achieved.

CN116128748BActive Publication Date: 2026-03-31INTELLIGENT INTER CONNECTION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-19
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In existing fisheye image correction methods, the error in obtaining the fisheye image radius is relatively large, resulting in errors in the extracted fisheye image. This is especially true when the device is transparent, as the scanning line stops in the bright area, leading to incorrect radius calculation.

Method used

The grayscale information of the fisheye image is processed using density-shape analysis and a preset threshold to obtain the set of coordinates of bright pixels. The radius and cropping size of the fisheye image are obtained by comparing the coordinates point by point, and the image is then corrected.

Benefits of technology

It achieves accurate acquisition of fisheye image radius and size, improves the accuracy of fisheye image correction, and is applicable to real-world test images from different devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116128748B_ABST
    Figure CN116128748B_ABST
Patent Text Reader

Abstract

The application discloses a fisheye image correction method and system based on an effective area extraction algorithm, and relates to the field of image processing.The method comprises the following steps: processing the gray information of each pixel point of the fisheye image according to a preset density shape analysis method and a preset threshold value to obtain a set of coordinates of bright area pixel points corresponding to the fisheye image; then, comparing each coordinate in the set of coordinates of the bright area pixel points point by point; acquiring the radius of the fisheye image and the size information of the cropped fisheye image according to the maximum longitudinal coordinate, the minimum longitudinal coordinate, the maximum transverse coordinate, the minimum transverse coordinate, the height value and the width value corresponding to the bright area of the bright area pixel points; the accurate radius of the fisheye image can be obtained; finally, performing image correction on the fisheye image based on a geometric model according to the radius of the fisheye image and the size information of the cropped fisheye image, so that the accuracy of the extracted fisheye image is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing, and in particular to a fisheye image correction method and system based on an effective region extraction algorithm. Background Technology

[0002] In intelligent transportation, to expand the camera's field of view and adapt to the image target detection algorithm model, a trinocular camera is typically used for target detection: the forward and backward cameras are ordinary cameras; the downward-facing camera, used to expand the field of view, is a fisheye camera. However, this introduces severe distortion. To improve the accuracy of trinocular camera image stitching, distortion correction must first be performed on the downward-facing fisheye camera to ensure the image information is on the correct pixel coordinates. Then, using this corrected image as the intermediate field of view, overlapping fields of view with the forward and backward cameras are found and stitched together. The basis for fisheye distortion correction is to first extract the effective region of the fisheye image. Generally, fisheye camera images are standard circular images, with all pixels except the fisheye image having a grayscale value of 0. However, in reality, due to device aperture limitations, the obtained camera fisheye image is only partially circular, with the upper and lower arcs truncated. Most importantly, the device also transmits light, and other pixels besides the fisheye image have a certain grayscale value. This causes the fast scanning algorithm to stop prematurely when extracting the effective fisheye region, resulting in an incorrect radius and thus errors in the image acquired by the fisheye camera.

[0003] Currently, to extract the effective region of distorted images, a fast scanning algorithm based on an ideal grayscale fisheye image is used. By setting an image grayscale threshold, it is assumed that the grayscale value of pixels other than the fisheye image is below the threshold, and the scan line will stop at the edge of the fisheye image, thus obtaining the fisheye image radius. However, in reality, due to the transmission phenomenon of devices, the area outside the fisheye image in the image may have long strips or irregular slightly bright areas. If the scan line stops in a bright area, it will be considered that the pixel is the edge of the fisheye image, resulting in an incorrect fisheye image radius, thus leading to errors in the extracted fisheye image. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention provides a fisheye image correction method and system based on an effective region extraction algorithm, which can solve the problems of large errors in obtaining the radius of existing fisheye images and errors in the extracted fisheye images.

[0005] To achieve the above objectives, on the one hand, the present invention provides a fisheye image correction method based on an effective region extraction algorithm, the method comprising:

[0006] Obtain the three primary color information of each pixel in the fisheye image captured by the camera, and convert the three primary color information into grayscale information corresponding to each pixel;

[0007] The grayscale information of each pixel in the fisheye image is processed according to the preset density shape analysis method and preset threshold to obtain the set of coordinates of the bright area pixels corresponding to the fisheye image;

[0008] By comparing the coordinates of each pixel in the set of coordinates of the bright area pixels, the maximum and minimum values ​​of the vertical coordinates, the maximum and minimum values ​​of the horizontal coordinates, and the corresponding height and width values ​​of the bright area pixels are obtained.

[0009] The radius of the fisheye image and the size information of the cropped fisheye image are obtained based on the maximum and minimum vertical coordinates, maximum and minimum horizontal coordinates, height and width values ​​of the bright area pixels.

[0010] The fisheye image is corrected based on the radius of the fisheye image and the size information of the cropped fisheye image.

[0011] Further, the step of processing the grayscale information of the fisheye image according to a preset density shape analysis method and a preset threshold to obtain the coordinate set of the bright area pixels corresponding to the fisheye image includes:

[0012] Pixels with gray values ​​greater than a preset threshold are extracted from the image and stored in the set of coordinates of bright area pixels;

[0013] A pixel sliding window is constructed using the coordinates of pixels with gray values ​​greater than a preset threshold as the center point. Pixels in the pixel sliding window that have gray values ​​greater than the preset threshold but are not in the set of pixel center coordinates of the sliding window or the set of pixel coordinates of the bright area are stored in the set of pixel coordinates of the bright area.

[0014] The pixel coordinates of the set of center coordinates of the sliding window pixels are used as the center points to construct the pixel sliding window, and the pixels in the pixel sliding window that are greater than a preset threshold and are not in the set of center coordinates of the sliding window pixels or the set of bright area pixel coordinates are stored in the set of bright area pixel coordinates.

[0015] When the set of center coordinates of the sliding window pixels is empty, the set of coordinates of the bright area pixels is output.

[0016] Further, the step of obtaining the fisheye image radius and the cropped fisheye image size information based on the maximum and minimum vertical coordinates, maximum and minimum horizontal coordinates, height and width values ​​corresponding to the bright area pixels includes:

[0017] Determine whether the quotient of the height and width values ​​corresponding to the bright area is greater than a preset aspect ratio threshold for the two strip-shaped areas;

[0018] If not, compare the height value corresponding to the bright area with the number of rows in the image and compare the width value corresponding to the bright area with the number of columns in the image;

[0019] If the comparison result meets the preset conditions, the fisheye image radius and the cropped fisheye image size information are obtained based on the maximum and minimum vertical coordinates, maximum and minimum horizontal coordinates of the bright area pixels.

[0020] Furthermore, the method also includes:

[0021] If the comparison result does not meet the preset conditions, then the area is confirmed to be a near-circular light-transmitting area;

[0022] The set of coordinates of bright pixels corresponding to the fisheye image is obtained by scanning column by column again from the maximum value of the horizontal coordinate.

[0023] Further, the step of correcting the fisheye image based on the fisheye image radius and the cropped fisheye image size information includes:

[0024] The corrected image height of the fisheye image is obtained based on the corrected vertical pixel coordinates, horizontal pixel coordinates, vertical pixel coordinates of the image center, and horizontal pixel coordinates of the image center. The center of the cropped fisheye image is the corrected image center.

[0025] Based on the image height of the corrected fisheye image, obtain the pixel coordinates of each corrected pixel in the distorted image;

[0026] The image information primary color values ​​corresponding to the pixel coordinates in the distorted image are assigned to the image information primary color values ​​at the pixel coordinates in the corrected image.

[0027] On the other hand, the present invention provides a fisheye image correction system based on an effective region extraction algorithm, the system comprising:

[0028] The acquisition unit is used to acquire the three primary color information of each pixel in the fisheye image captured by the camera, and convert the three primary color information into grayscale information corresponding to each pixel.

[0029] The processing unit is used to process the grayscale information of each pixel in the fisheye image according to a preset density shape analysis method and a preset threshold, so as to obtain the set of coordinates of the bright area pixels corresponding to the fisheye image.

[0030] The comparison unit is used to compare each coordinate in the coordinate set of the bright area pixels point by point to obtain the maximum value of the vertical coordinate, the minimum value of the vertical coordinate, the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the height value and the width value corresponding to the bright area pixels.

[0031] The acquisition unit is also used to acquire the fisheye image radius and the cropped fisheye image size information based on the maximum and minimum vertical coordinates, maximum and minimum horizontal coordinates, height and width values ​​corresponding to the bright area pixels;

[0032] The correction unit is used to correct the fisheye image based on the radius of the fisheye image and the size information of the cropped fisheye image.

[0033] Further, the processing unit is specifically configured to: obtain pixels with grayscale values ​​greater than a preset threshold from the image and store them in a set of bright area pixel coordinates; construct a pixel sliding window using the coordinates of pixels with grayscale values ​​greater than the preset threshold as center points, and store pixels in the pixel sliding window that have grayscale values ​​greater than the preset threshold but are not in the set of center coordinates of the sliding window pixels or the set of bright area pixel coordinates in the set of bright area pixel coordinates; construct pixel sliding windows using the pixel coordinates of the set of center coordinates of the sliding window pixels as center points, and store pixels in the pixel sliding window that have grayscale values ​​greater than the preset threshold but are not in the set of center coordinates of the sliding window pixels or the set of bright area pixel coordinates in the set of bright area pixel coordinates; when the set of center coordinates of the sliding window pixels is empty, output the set of bright area pixel coordinates.

[0034] Furthermore, the acquisition unit is specifically used to determine whether the quotient of the height value and the width value corresponding to the bright area is greater than a preset aspect ratio threshold for the two strip-shaped areas; if not, the height value corresponding to the bright area is compared with the number of rows in the image and the width value corresponding to the bright area is compared with the number of columns in the image; if the comparison result meets the preset conditions, the fisheye image radius and the cropped fisheye image size information are obtained based on the maximum value of the vertical coordinate, the minimum value of the vertical coordinate, the maximum value of the horizontal coordinate, and the minimum value of the horizontal coordinate of the bright area pixels.

[0035] Furthermore, the acquisition unit is specifically used to confirm that the region is a near-circular light-transmitting region if the comparison result does not meet the preset conditions; and to scan column by column again from the maximum value of the horizontal coordinate to obtain the set of bright area pixel coordinates corresponding to the fisheye image.

[0036] Further, the correction unit is specifically used to obtain the corrected image height of the fisheye image based on the corrected vertical pixel coordinates, horizontal pixel coordinates, vertical pixel coordinates of the image center, and horizontal pixel coordinates of the image center, wherein the center of the cropped fisheye image is the corrected image center; to obtain the pixel coordinates of each corrected pixel point in the distorted image based on the corrected image height of the fisheye image; and to assign the image information primary color values ​​corresponding to the pixel coordinates in the distorted image to the image information primary color values ​​at the pixel coordinates in the corrected image.

[0037] This invention provides a fisheye image correction method and system based on an effective region extraction algorithm. Based on density shape analysis, the grayscale information of each pixel in the fisheye image is processed according to a preset density shape analysis method and a preset threshold to obtain a set of coordinates of bright area pixels corresponding to the fisheye image. Then, each coordinate in the set of bright area pixels is compared point by point. The radius of the fisheye image and the size of the cropped fisheye image are obtained based on the maximum and minimum vertical and horizontal coordinates, the height and width values ​​corresponding to the bright area pixels, thus obtaining an accurate fisheye image radius. Finally, the fisheye image is corrected based on a geometric model according to the fisheye image radius and the size of the cropped fisheye image, ensuring the accuracy of the extracted fisheye image. This method is also applicable to extracting the effective fisheye region from various test images on different devices. Attached Figure Description

[0038] Figure 1 This is a flowchart of a fisheye image correction method based on an effective region extraction algorithm provided by the present invention;

[0039] Figure 2 This is a schematic diagram of the structure of a fisheye image correction system based on an effective region extraction algorithm provided by the present invention. Detailed Implementation

[0040] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0041] like Figure 1 As shown in the figure, an embodiment of the present invention provides a fisheye image correction method based on an effective region extraction algorithm, which includes the following steps:

[0042] 101. Obtain the three primary color information of each pixel in the fisheye image captured by the camera, and convert the three primary color information into grayscale information corresponding to each pixel.

[0043] Specifically, for example, i ranges from 1 to the number of rows M in the image, and j ranges from 1 to the number of columns N in the image. The three primary color information of the pixel in the i-th row and j-th column is A(i,j,:) = {R(i,j), G(i,j), B(i,j)}, and the corresponding grayscale information is I(i,j) = 0.59*R(i,j) + 0.11*G(i,j) + 0.3*B(i,j). By performing the above transformation on each pixel, the grayscale value of the entire image can be obtained.

[0044] 102. The grayscale information of each pixel in the fisheye image is processed according to the preset density shape analysis method and preset threshold to obtain the set of coordinates of the bright area pixels corresponding to the fisheye image.

[0045] Specifically, pixels with grayscale values ​​greater than a preset threshold are obtained from the image and stored in a set of bright area pixel coordinates; a pixel sliding window is constructed using the coordinates of pixels with grayscale values ​​greater than the preset threshold as center points, and pixels in the pixel sliding window that have grayscale values ​​greater than the preset threshold but are not in the set of center coordinates of the sliding window pixels or the set of bright area pixel coordinates are stored in the set of bright area pixel coordinates; pixel sliding windows are constructed using the pixel coordinates of the set of center coordinates of the sliding window pixels as center points, and pixels in the pixel sliding window that have grayscale values ​​greater than the preset threshold but are not in the set of center coordinates of the sliding window pixels or the set of bright area pixel coordinates are stored in the set of bright area pixel coordinates; when the set of center coordinates of the sliding window pixels is empty, the set of bright area pixel coordinates is output.

[0046] For example, (2a) First, scan column by column from the left side of the image to find pixels with gray values ​​greater than the threshold T, then stop scanning and add the coordinates (i, j) of the pixel to the set of coordinates of bright area pixels, PixPos_Light. (2b) Use the coordinates (i, j) of the pixel as the center point of the 3*3 pixel sliding window, and obtain the other 8 pixels. Threshold the gray values ​​of these 8 pixels respectively. For the coordinates of pixels that exceed the threshold T, first check if the set PixPos_Light exists. If it does not exist, add it to the set. If it exists, do not process the coordinates of the pixel. At the same time, check if the coordinates of the pixel are in the set WinPos_center of the sliding window pixel center coordinates. If they do not exist, add them to the set. If they exist, do not process the coordinates of the pixel. (2c) From the set WinPos_center obtained in (2b), select the coordinates (k, l) of the pixel as the center point of the new 3*3 pixel sliding window, and then perform the processing in step (2b). After the processing is completed, delete the point from the set WinPos_center. (2d) Perform operations (2a) to (2c) sequentially on the sets PixPos_Light and WinPos_center until the set WinPos_center is empty. At this point, the set PixPos_Light is the final set of coordinates of the bright area pixels.

[0047] 103. Compare the coordinates of each point in the coordinate set of the bright area pixels to obtain the maximum and minimum vertical coordinates, maximum and minimum horizontal coordinates, height and width values ​​of the bright area pixels.

[0048] Specifically, by comparing the coordinates point by point, the maximum and minimum vertical coordinate values ​​i_max and i_min of the pixels in the bright area are found, and the height H of the bright area can be obtained as H = i_max - i_min. Similarly, the maximum and minimum horizontal coordinate values ​​j_max and j_min of the pixels in the bright area are found, and the width W of the bright area can be obtained as W = j_max - j_min. Judgment condition 1: H / W > Kstrip, where Kstrip is an empirical value for the aspect ratio of the strip-shaped bright area: If condition 1 is met, the bright area is considered to be a strip-shaped region, not a fisheye image, so it is rescanned starting from the maximum horizontal coordinate value j_max and scanning column by column, and steps 102 and 103 are re-executed; if condition 1 is not met, the bright area is considered to be non-strip-shaped, but a square-like region. To eliminate the influence of some circular translucent areas, further judgment condition 2 is performed: Judgment condition 2: W > N / 2, the number of columns in the image is N, H > M / 2, the number of rows in the image is M: the width and height of the bright area must both be greater than half of the corresponding dimension of the image: If condition 2 is met, it is considered that... Since it's a fisheye image, proceed to step 104. At this point, step 103 outputs the radius R = max(i_max - i_min, j_max - j_min) / 2. Additionally, the original fisheye image is cropped based on i_max, i_min, j_max, and j_min: with the pixel (i_min, j_min) as the top-left pixel, the width is j_max - j_min, and the height is i_max - i_min, resulting in the cropped fisheye image. If step 2 is not satisfied, it is considered a near-circular translucent area, so a rescan is performed starting from the maximum horizontal coordinate j_max and scanning column by column, re-executing steps 102 and 103.

[0049] 104. Obtain the fisheye image radius and the cropped fisheye image size information based on the maximum and minimum vertical coordinates, maximum and minimum horizontal coordinates, height and width values ​​corresponding to the bright area pixels.

[0050] Specifically, it is determined whether the quotient of the height and width values ​​corresponding to the bright area is greater than a preset aspect ratio threshold for the two strip-shaped areas; if not, the height value corresponding to the bright area is compared with the number of rows in the image and the width value corresponding to the bright area is compared with the number of columns in the image; if the comparison result meets the preset conditions, the radius of the fisheye image and the size information of the cropped fisheye image are obtained based on the maximum and minimum vertical coordinates, maximum and minimum horizontal coordinates of the pixels in the bright area. If the comparison result does not meet the preset conditions, the area is confirmed to be a near-circular translucent area; the set of coordinates of the bright area pixels corresponding to the fisheye image is obtained again by scanning column by column from the maximum horizontal coordinate.

[0051] 105. Correct the fisheye image based on the radius of the fisheye image and the size information of the cropped fisheye image.

[0052] Specifically, based on the corrected vertical pixel coordinates, horizontal pixel coordinates, vertical pixel coordinates of the image center, and horizontal pixel coordinates of the image center, the corrected image height of the fisheye image is obtained, where the center of the cropped fisheye image is the corrected image center; based on the corrected image height of the fisheye image, the pixel coordinates of each corrected pixel point in the distorted image are obtained; and the image information primary color values ​​corresponding to the pixel coordinates in the distorted image are assigned to the image information primary color values ​​at the pixel coordinates in the corrected image.

[0053] For example, first calculate the image height of the fisheye image after correction. u represents the vertical pixel coordinates after distortion correction, v represents the horizontal pixel coordinates after distortion correction, x0 represents the vertical pixel coordinates of the corrected image center, and y0 represents the horizontal pixel coordinates of the corrected image center. The center of the cropped fisheye image is the center of the corrected image. The fisheye lens long-distance imaging model is then used as the isometric projection imaging model within the dissimilar imaging model. The imaging formula is as follows: the image height h of the fisheye distortion image = f * ω, where the object-side focal length of the lens is... Object half field of view Next, using the image height h of the fisheye distortion image, the pixel coordinates (x', y') of the corrected pixel in the distortion image are calculated: To round up

[0054] Finally, the RGB values ​​of the image information at pixel coordinates (x', y') in the distorted image are assigned to the RGB values ​​of the image information at pixel coordinates (u, v) in the corrected image, thus completing the fisheye image distortion correction.

[0055] This invention provides a fisheye image correction method based on an effective region extraction algorithm. Based on density shape analysis, the grayscale information of each pixel in the fisheye image is processed according to a preset density shape analysis method and a preset threshold to obtain a set of coordinates of bright area pixels corresponding to the fisheye image. Then, each coordinate in the set of bright area pixels is compared point by point. The radius of the fisheye image and the size of the cropped fisheye image are obtained based on the maximum and minimum vertical and horizontal coordinates, the height and width values ​​corresponding to the bright area pixels, thus obtaining an accurate fisheye image radius. Finally, the fisheye image is corrected based on a geometric model according to the fisheye image radius and the size of the cropped fisheye image, ensuring the accuracy of the extracted fisheye image. This method is also applicable to extracting the effective fisheye region from various test images on different devices.

[0056] To implement the method provided in the embodiments of the present invention, the embodiments of the present invention provide a fisheye image correction system based on an effective region extraction algorithm, such as... Figure 2 As shown, the system includes: an acquisition unit 21, a processing unit 22, a comparison unit 23, and a correction unit 24;

[0057] The acquisition unit 21 is used to acquire the three primary color information of each pixel in the fisheye image captured by the camera, and convert the three primary color information into grayscale information corresponding to each pixel.

[0058] The processing unit 22 is used to process the grayscale information of each pixel in the fisheye image according to a preset density shape analysis method and a preset threshold, so as to obtain the set of coordinates of the bright area pixels corresponding to the fisheye image.

[0059] The comparison unit 23 is used to perform point-by-point coordinate comparison on each coordinate in the coordinate set of the bright area pixels to obtain the maximum value of the vertical coordinate, the minimum value of the vertical coordinate, the maximum value of the horizontal coordinate, the minimum value of the horizontal coordinate, the height value and the width value corresponding to the bright area pixels.

[0060] The acquisition unit 21 is further configured to acquire the fisheye image radius and the cropped fisheye image size information based on the maximum and minimum vertical coordinates, maximum and minimum horizontal coordinates, height and width values ​​corresponding to the bright area pixels.

[0061] The correction unit 24 is used to correct the fisheye image based on the radius of the fisheye image and the size information of the cropped fisheye image.

[0062] Further, the processing unit 22 is specifically configured to: obtain pixels with grayscale values ​​greater than a preset threshold from the image and store them in a set of bright area pixel coordinates; construct a pixel sliding window using the coordinates of pixels with grayscale values ​​greater than the preset threshold as center points, and store pixels in the pixel sliding window that have grayscale values ​​greater than the preset threshold but are not in the set of center coordinates of the sliding window pixels or the set of bright area pixel coordinates in the set of bright area pixel coordinates; construct pixel sliding windows using the pixel coordinates of the set of center coordinates of the sliding window pixels as center points, and store pixels in the pixel sliding window that have grayscale values ​​greater than the preset threshold but are not in the set of center coordinates of the sliding window pixels or the set of bright area pixel coordinates in the set of bright area pixel coordinates; when the set of center coordinates of the sliding window pixels is empty, output the set of bright area pixel coordinates.

[0063] Furthermore, the acquisition unit 21 is specifically used to determine whether the quotient of the height value and the width value corresponding to the bright area is greater than a preset aspect ratio threshold for the two strip-shaped areas; if not, the height value corresponding to the bright area is compared with the number of rows in the image and the width value corresponding to the bright area is compared with the number of columns in the image; if the comparison result meets the preset conditions, the fisheye image radius and the cropped fisheye image size information are obtained based on the maximum value of the vertical coordinate, the minimum value of the vertical coordinate, the maximum value of the horizontal coordinate, and the minimum value of the horizontal coordinate of the bright area pixel.

[0064] Furthermore, the acquisition unit 21 is specifically used to confirm that the region is a near-circular light-transmitting region if the comparison result does not meet the preset conditions; and to scan column by column again from the maximum value of the horizontal coordinate to obtain the set of bright area pixel coordinates corresponding to the fisheye image.

[0065] Further, the correction unit 24 is specifically used to obtain the corrected image height of the fisheye image based on the corrected vertical pixel coordinates, horizontal pixel coordinates, vertical pixel coordinates of the image center, and horizontal pixel coordinates of the image center, wherein the center of the cropped fisheye image is the corrected image center; to obtain the pixel coordinates of each corrected pixel point in the distorted image based on the corrected image height of the fisheye image; and to assign the image information primary color values ​​corresponding to the pixel coordinates in the distorted image to the image information primary color values ​​at the pixel coordinates in the corrected image.

[0066] This invention provides a fisheye image correction system based on an effective region extraction algorithm. Based on density shape analysis, the system processes the grayscale information of each pixel in the fisheye image according to a preset density shape analysis method and a preset threshold to obtain a set of coordinates of bright area pixels corresponding to the fisheye image. Then, it compares each coordinate in the set of bright area pixels point by point. Based on the maximum and minimum vertical coordinates, maximum and minimum horizontal coordinates, and the height and width values ​​corresponding to the bright areas, it obtains the radius of the fisheye image and the size information of the cropped fisheye image, thus obtaining an accurate fisheye image radius. Finally, based on the fisheye image radius and the size information of the cropped fisheye image, it performs image correction on the fisheye image based on a geometric model, ensuring the accuracy of the extracted fisheye image. Furthermore, it is applicable to extracting the effective fisheye region from various test images on different devices.

[0067] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process may be rearranged without departing from the scope of this disclosure. The appended method claims provide elements of various steps in an exemplary order and are not intended to limit the scope to the specific order or hierarchy described.

[0068] In the above detailed description, various features are combined together in a single embodiment to simplify this disclosure. This approach to disclosure should not be construed as reflecting an intention that embodiments of the claimed subject matter require more features than are explicitly stated in each claim. Rather, as reflected in the appended claims, the invention is presented with fewer features than all of the features of the single disclosed embodiment. Therefore, the appended claims are hereby explicitly incorporated into the detailed description, wherein each claim stands alone as a preferred embodiment of the invention.

[0069] The disclosed embodiments have been described above to enable any person skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be applied to other embodiments without departing from the spirit and scope of this disclosure. Therefore, this disclosure is not limited to the embodiments given herein, but is consistent with the broadest scope of the principles and novel features disclosed in this application.

[0070] The foregoing description includes examples of one or more embodiments. It is certainly impossible to describe all possible combinations of components or methods in order to describe the above embodiments, but those skilled in the art will recognize that further combinations and arrangements of the various embodiments are possible. Therefore, the embodiments described herein are intended to cover all such changes, modifications, and variations that fall within the scope of the appended claims. Furthermore, the term "comprising" as used in the specification or claims is interpreted in a manner similar to the term "including," as interpreted when used as a conjunction in the claims. Additionally, the use of any term "or" in the specification of the claims is intended to mean "non-exclusive or."

[0071] Those skilled in the art will also understand that the various illustrative logical blocks, units, and steps listed in the embodiments of the present invention can be implemented by electronic hardware, computer software, or a combination of both. To clearly demonstrate the interchangeability of hardware and software, the functions of the various illustrative components, units, and steps described above have been generally described. Whether such functionality is implemented through hardware or software depends on the specific application and the overall system design requirements. Those skilled in the art can implement the described functions using various methods for each specific application, but such implementation should not be construed as exceeding the scope of protection of the embodiments of the present invention.

[0072] The various illustrative logic blocks or units described in the embodiments of this invention can be implemented or operate the described functions using a general-purpose processor, digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array or other programmable logic system, discrete gate or transistor logic, discrete hardware components, or any combination thereof. The general-purpose processor can be a microprocessor; alternatively, it can be any conventional processor, controller, microcontroller, or state machine. The processor can also be implemented using a combination of computing systems, such as a digital signal processor and a microprocessor, multiple microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration.

[0073] The steps of the methods or algorithms described in the embodiments of this invention can be directly embedded in hardware, a software module executed by a processor, or a combination of both. The software module can be stored in RAM, flash memory, ROM, EPROM, EEPROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from and write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and storage medium can be housed in an ASIC, which can be housed in a user terminal. Optionally, the processor and storage medium can also be housed in different components of the user terminal.

[0074] In one or more exemplary designs, the functions described in the embodiments of the present invention can be implemented in hardware, software, firmware, or any combination of these three. If implemented in software, these functions can be stored on a computer-readable medium or transmitted on a computer-readable medium in the form of one or more instructions or code. Computer-readable media include computer storage media and communication media that facilitate the transfer of computer programs from one place to another. Storage media can be any available media that can be accessed by a general-purpose or special-purpose computer. For example, such computer-readable media can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage systems, or any other medium that can be used to carry or store program code in the form of instructions or data structures and other forms that can be read by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Furthermore, any connection can be suitably defined as a computer-readable medium, for example, if the software is transmitted from a website, server, or other remote resource via a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wirelessly, such as infrared, wireless, and microwave, it is also included in the defined computer-readable medium. The disks and discs mentioned include compressed disks, laser discs, optical discs, DVDs, floppy disks, and Blu-ray discs. Disks typically copy data magnetically, while disks typically copy data optically using lasers. Combinations of the above can also be contained in computer-readable media.

[0075] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A fisheye image correction method based on an active region extraction algorithm, characterized in that, The method comprises: acquiring three primary color information of each pixel point in a fisheye image collected by a camera, and converting the three primary color information into gray scale information corresponding to each pixel point; processing the gray scale information of each pixel point in the fisheye image according to a preset density shape analysis method and a preset threshold to obtain a coordinate set of bright area pixel points corresponding to the fisheye image; performing point-by-point coordinate comparison on each coordinate in the coordinate set of the bright area pixel points to obtain a maximum longitudinal coordinate value, a minimum longitudinal coordinate value, a maximum transverse coordinate value, a minimum transverse coordinate value, a height value and a width value corresponding to the bright area; acquiring a fisheye image radius and size information of a cropped fisheye image according to the maximum longitudinal coordinate value, the minimum longitudinal coordinate value, the maximum transverse coordinate value, the minimum transverse coordinate value, the height value and the width value corresponding to the bright area pixel points; correcting the fisheye image according to the fisheye image radius and the size information of the cropped fisheye image. The step of processing the gray scale information of the fisheye image according to the preset density shape analysis method and the preset threshold to obtain the coordinate set of the bright area pixel points corresponding to the fisheye image comprises: saving pixel points with a gray scale value greater than the preset threshold in the bright area pixel point coordinate set from the image; constructing a pixel point sliding window with the pixel point coordinates with the gray scale value greater than the preset threshold as the center point, and saving pixel points greater than the preset threshold in the pixel point sliding window and not in the sliding window pixel center coordinate set and the bright area pixel point coordinate set in the bright area pixel point coordinate set; constructing a pixel point sliding window with the pixel point coordinates in the sliding window pixel center coordinate set as the center point, and saving pixel points greater than the preset threshold in the pixel point sliding window and not in the sliding window pixel center coordinate set and the bright area pixel point coordinate set in the bright area pixel point coordinate set; when the sliding window pixel center coordinate set is empty, outputting the bright area pixel point coordinate set.

2. The fisheye image correction method based on the effective area extraction algorithm according to claim 1, characterized in that, The step of acquiring the fisheye image radius and the size information of the cropped fisheye image according to the maximum longitudinal coordinate value, the minimum longitudinal coordinate value, the maximum transverse coordinate value, the minimum transverse coordinate value, the height value and the width value corresponding to the bright area pixel points comprises: judging whether the quotient of the height value and the width value corresponding to the bright area is greater than a preset long and short area length-width ratio threshold value; if not, comparing the height value corresponding to the bright area with the number of image rows and comparing the width value corresponding to the bright area with the number of image columns; if the comparison result meets a preset condition, acquiring the fisheye image radius and the size information of the cropped fisheye image according to the maximum longitudinal coordinate value, the minimum longitudinal coordinate value, the maximum transverse coordinate value and the minimum transverse coordinate value of the bright area pixel points.

3. The fisheye image correction method based on the effective area extraction algorithm according to claim 2, characterized in that, The method further comprises: if the comparison result does not meet the preset condition, confirming that the area is a light-transmitting area in a circular shape; again scanning the bright area pixel point coordinate set corresponding to the fisheye image from the maximum transverse coordinate value.

4. The fisheye image correction method based on the effective area extraction algorithm according to claim 1, characterized in that, The step of correcting the fisheye image according to the fisheye image radius and the size information of the cropped fisheye image comprises: According to the corrected longitudinal pixel coordinates, the transverse pixel coordinates, the longitudinal pixel coordinates of the image center, and the transverse pixel coordinates of the image center, an image height of the corrected fisheye image is obtained, and the center of the cropped fisheye image is the corrected image center; According to the image height of the corrected fisheye image, pixel coordinates of each corrected pixel point in the distorted image are obtained; Image information three-primary-color values corresponding to the pixel coordinates in the distorted image are assigned to image information three-primary-color values at the pixel coordinates in the corrected image.

5. An fisheye image correction system based on an active region extraction algorithm, characterized in that, The system comprises: An acquisition unit is configured to acquire three-primary-color information of each pixel point in a fisheye image collected by a camera, and convert the three-primary-color information into gray information corresponding to each pixel point; A processing unit is configured to process the gray information of each pixel point in the fisheye image according to a preset density shape analysis method and a preset threshold, and obtain a set of coordinates of bright area pixel points corresponding to the fisheye image; A comparison unit is configured to compare each coordinate in the set of coordinates of the bright area pixel points point by point, and obtain a maximum longitudinal coordinate, a minimum longitudinal coordinate, a maximum transverse coordinate, a minimum transverse coordinate, a height value, and a width value corresponding to the bright area. The acquisition unit is further configured to acquire a fisheye image radius and size information of a cropped fisheye image according to the maximum longitudinal coordinate, the minimum longitudinal coordinate, the maximum transverse coordinate, the minimum transverse coordinate, the height value, and the width value corresponding to the bright area pixel points; A correction unit is configured to correct the fisheye image according to the fisheye image radius and the size information of the cropped fisheye image. The processing unit is specifically configured to save a pixel point with a gray value greater than a preset threshold in the set of coordinates of bright area pixel points, take the coordinate of the pixel point with the gray value greater than the preset threshold as a center point to construct a pixel point sliding window, save a pixel point greater than the preset threshold in the pixel point sliding window and not in the set of coordinates of bright area pixel points or the set of coordinates of sliding window pixel point center coordinates in the set of coordinates of bright area pixel points, take the coordinate of the pixel point in the set of coordinates of sliding window pixel point center coordinates as a center point to construct a pixel point sliding window, save a pixel point greater than the preset threshold in the pixel point sliding window and not in the set of coordinates of bright area pixel points or the set of coordinates of sliding window pixel point center coordinates in the set of coordinates of bright area pixel points, and output the set of coordinates of bright area pixel points when the set of coordinates of sliding window pixel point center coordinates is empty.

6. The fisheye image correction system based on an effective area extraction algorithm according to claim 5, wherein The acquisition unit is specifically further configured to determine whether a quotient of the height value and the width value corresponding to the bright area is greater than a preset long-and-short two-area length-width ratio threshold, compare the height value corresponding to the bright area with a number of rows of the image and compare the width value corresponding to the bright area with a number of columns of the image if the result is negative, and acquire the fisheye image radius and the size information of the cropped fisheye image according to the maximum longitudinal coordinate, the minimum longitudinal coordinate, the maximum transverse coordinate, and the minimum transverse coordinate of the bright area pixel points if the comparison result meets a preset condition. ​ 7. The fisheye image correction system based on the effective area extraction algorithm according to claim 6, characterized in that, the acquisition unit is further used to confirm that the area is a light-transmitting area of a circular shape if the comparison result does not satisfy a preset condition; and the acquisition unit is further used to scan again column by column from the maximum horizontal coordinate to acquire a set of pixel point coordinates of a bright area corresponding to the fisheye image.

8. The fisheye image correction system based on the effective area extraction algorithm according to claim 5, characterized in that, the correction unit is used to acquire an image height of the fisheye image after correction according to the corrected longitudinal pixel coordinate, the corrected horizontal pixel coordinate, the longitudinal pixel coordinate of the image center, and the horizontal pixel coordinate of the image center, wherein the center of the cropped fisheye image is the corrected image center; the correction unit is used to acquire pixel coordinates of each corrected pixel point in a distorted image according to the image height of the fisheye image after correction; and the correction unit is used to assign image information trichromatic values corresponding to the pixel coordinates in the distorted image to image information trichromatic values at the pixel coordinates in the corrected image.

Citation Information

Patent Citations

  • Effective area extraction method of fisheye image

    CN110610455A

  • Fish-eye lens effective area acquisition and image fine correction method

    CN115049535A