Fisheye image processing method, electronic device, and storage medium

The azimuth image is generated through the color space transformation and gradient calculation of the fisheye image, which solves the problem of unstable accuracy of the imaging area of ​​the fisheye camera in different scenarios and achieves accurate identification of the effective imaging area of ​​the fisheye camera.

WO2024179474A1PCT designated stage expired Publication Date: 2024-09-06SHENZHEN BAICHUAN SECURITY TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/078844
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-28
Filing Date
2024-02-27
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Existing fisheye image processing algorithms are difficult to adapt to different shooting scenarios and exposure parameters, resulting in unstable accuracy of the effective imaging area of ​​the fisheye camera.

Method used

By acquiring the fisheye image and performing color space transformation to generate a grayscale image, calculating the horizontal and vertical derivatives of the grayscale image, generating an azimuth image, and determining the effective imaging area of ​​the fisheye camera based on the azimuth image.

Benefits of technology

This method can adapt to the grayscale change trend of the fisheye camera in different shooting scenarios and ensure the accuracy and stability of the effective imaging area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024078844_06092024_PF_FP
    Figure CN2024078844_06092024_PF_FP
Patent Text Reader

Abstract

A fisheye image processing method, an electronic device (100), and a storage medium (300). The method comprises: (011) acquiring a fisheye image; (012) generating a grayscale image according to the fisheye image; (013) generating a first gradient image in a horizontal direction and a second gradient image in a vertical direction; (014) generating an azimuth image according to the first gradient image and the second gradient image; and (015) determining an effective imaging area according to the azimuth image.
Need to check novelty before this filing date? Find Prior Art

Description

Fisheye image processing method, electronic device and storage medium

[0001] Priority information

[0002] This application claims priority and benefits of the patent application with patent application number "202310229365.0" filed with the State Intellectual Property Office of China on February 28, 2023, and the entire text of which is incorporated herein by reference. Technical Field

[0003] The present application relates to the technical field of fisheye image processing, and more specifically, to a fisheye image processing method, an electronic device, and a computer-readable storage medium. Background Art

[0004] When determining the effective imaging area of ​​a fisheye image, the differences in different shooting scenes (lighting conditions and camera exposure parameters) lead to large differences in fisheye images. The current algorithm for preprocessing fisheye images is difficult to adapt to different scenes and different exposure parameters, resulting in unstable accuracy in the subsequent determination of the effective imaging area based on the preprocessed image.

[0005] Summary of the Invention

[0006] Embodiments of the present application provide a fisheye image processing method, an electronic device, and a computer-readable storage medium.

[0007] The fisheye image processing method of the embodiment of the present application includes acquiring a fisheye image taken by a fisheye camera; performing color space transformation on the fisheye image to generate a grayscale image; calculating the horizontal derivative of each pixel in the grayscale image to generate a first gradient image, and calculating the vertical derivative of each pixel in the grayscale image to generate a second gradient image; calculating the azimuth angle corresponding to each first pixel in the first gradient image and the second pixel in the second gradient image at the same position as the first pixel, and normalizing the azimuth angles to generate an azimuth image based on the normalized azimuth angles; and determining the effective imaging area of ​​the fisheye camera based on the azimuth image.

[0008] In some embodiments, determining the effective imaging area of ​​the fisheye camera based on the azimuth image includes determining a plurality of angular offsets within a preset interval based on a preset step size; adding the angular offset to each of the azimuth angles in the azimuth image to generate an offset image corresponding to each angular offset; binarizing each of the offset images to generate a binarized image corresponding to each of the offset images; and determining the effective imaging area based on the plurality of binarized images.

[0009] In some embodiments, the adding of the angular offset to each of the azimuth angles in the azimuth image to generate an offset image corresponding to each of the angular offsets includes adding the angular offset to each of the azimuth angles in the azimuth image; and reducing the angular offset by the preset threshold value when the value of the azimuth angle after adding the angular offset is greater than or equal to a preset threshold value; and generating the offset image corresponding to each of the angular offsets based on the azimuth image after adding the angular offset.

[0010] In some embodiments, before determining the effective imaging area based on the multiple binarized images, the fisheye image processing method includes performing median filtering on each of the binarized images respectively; determining the effective imaging area based on the multiple binarized images includes: determining the effective imaging area based on the multiple binarized images after median filtering.

[0011] In some embodiments, determining the effective imaging area based on the multiple binarized images includes accumulating pixel values ​​of pixels at the same position in the multiple binarized images to generate a statistical image; normalizing each pixel in the statistical image; binarizing the normalized statistical image; median filtering the binarized statistical image; and determining the effective imaging area based on the median filtered statistical image.

[0012] In some embodiments, the accumulating pixel values ​​of multiple pixels at the same position in the binary images to generate a statistical image includes separately accumulating the pixel values ​​of multiple pixels at the same position in the binary images to generate multiple accumulated pixel values; determining the accumulated number of pixels of the preset pixel value corresponding to the accumulated pixel value based on the quotient of the accumulated pixel value and the preset pixel value; and generating the statistical image based on the accumulated number.

[0013] In some embodiments, determining the effective imaging area based on the statistical image after median filtering includes scanning the statistical image after median filtering line by line to obtain boundary pixels in each line whose pixel values ​​are preset pixel values; and determining the effective imaging area based on the image coordinates of all the boundary pixels.

[0014] The electronic device of an embodiment of the present application includes one or more processors, a memory and one or more programs, wherein one or more of the programs are stored in the memory and executed by one or more of the processors, and the program includes instructions for executing the fisheye image processing method of any of the above embodiments.

[0015] The computer-readable storage medium of an embodiment of the present application includes a computer program. When the computer program is executed by a processor, the processor executes the fisheye image processing method of any of the above embodiments.

[0016] The fisheye image processing method, electronic device, and computer-readable storage medium of the embodiments of the present application obtain a single-channel grayscale image of the fisheye image after color space conversion, and then generate a first gradient image and a second gradient image based on the horizontal and vertical derivatives of the grayscale image, respectively. Thus, the azimuth angle corresponding to each first pixel in the gradient image and the second pixel in the second gradient image at the same position as the first pixel are determined, thereby generating an azimuth image based on the azimuth angle corresponding to each first pixel. Finally, the effective imaging area is determined based on the azimuth image. For a fisheye camera, since the grayscale change trend between different image areas of the fisheye image captured in different shooting scenes is constant, such as the grayscale change trend from the four corners to the center of the fisheye camera is constant, the azimuth image determined based on the first gradient image and the second gradient image can adapt to different shooting scenes, thereby ensuring the accuracy of the effective imaging area determined based on the azimuth image.

[0017] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0019] FIG1 is a schematic flow chart of a fisheye image processing method according to certain embodiments of the present application;

[0020] FIG2 is a schematic diagram of a scene of a fisheye image processing method according to certain embodiments of the present application;

[0021] FIG3 is a schematic diagram of an azimuth image of a fisheye image processing method according to certain embodiments of the present application;

[0022] FIG4 is a flow chart of a fisheye image processing method according to certain embodiments of the present application;

[0023] FIG5 is a schematic diagram of a binarized image with an angle offset of 0 according to a fisheye image processing method according to certain embodiments of the present application;

[0024] FIG6 is a schematic diagram of a binarized image with an angle offset of 60° according to a fisheye image processing method according to certain embodiments of the present application;

[0025] FIG7 is a schematic diagram of a binarized image with an angle offset of 120° according to a fisheye image processing method according to certain embodiments of the present application;

[0026] FIG8 is a schematic diagram of a binarized image with an angle offset of 180 degrees according to a fisheye image processing method according to certain embodiments of the present application;

[0027] FIG9 is a flow chart of a fisheye image processing method according to certain embodiments of the present application;

[0028] FIG10 is a schematic diagram of a statistical image of a fisheye image processing method according to certain embodiments of the present application;

[0029] FIG11 is a flow chart of a fisheye image processing method according to certain embodiments of the present application;

[0030] FIG12 is a schematic plan view of an electronic device according to some embodiments of the present application;

[0031] FIG13 is a schematic diagram illustrating a connection state between a non-volatile computer-readable storage medium and a processor according to certain embodiments of the present application. DETAILED DESCRIPTION

[0032] The embodiments of the present application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and should not be understood as limiting the embodiments of the present application.

[0033] Fisheye cameras have gained widespread application due to their wide-angle viewing angles. However, many image analysis scenarios, such as autonomous driving and intelligent surveillance, have strict requirements for input image distortion. Specific anti-distortion correction algorithms must be used to restore the original image. The effective imaging area is typically accurately calibrated before shipment. However, in applications such as autonomous driving and 3D reconstruction, many post-production calibration scenarios still require replacement of damaged cameras, such as in vehicle collisions or displacement of unmanned delivery vehicles after long-distance transport. Without standardized testing environments, determining the effective imaging area requires the use of images captured by fisheye cameras in real-world scenarios. This variability in captured fisheye images can lead to significant variations in the captured scene. Current algorithms for pre-processing fisheye images struggle to adapt to varying scenarios and exposure parameters, resulting in inaccurate determination of the effective imaging area based on pre-processed images.

[0034] Referring to FIG. 1 , an embodiment of the present application provides a fisheye image processing method, which includes:

[0035] Step 011: Obtain a fisheye image taken by a fisheye camera;

[0036] The fisheye camera can be a fisheye camera. It is understood that the fisheye camera can also be other types of cameras, such as a wide-angle camera, a telephoto camera, etc. This application uses the fisheye camera as an example for explanation. As shown in Figure 2, the effective imaging area of ​​the fisheye camera is generally circular, and the final output fisheye image is generally rectangular. In addition to the effective imaging area, the fisheye image also includes on-screen display (OSD) content (such as "20XX-XX-XX") in Figure 2. The on-screen display content is related to the actual application scenario of the fisheye camera.

[0037] Since the four corners of the fisheye image are areas without scene information, the four corners of the fisheye image are always black, while the image in the effective imaging area contains the brightness information of the actual scene. Therefore, regardless of the shooting scene, the grayscale change trend from the four corners to the effective imaging area remains unchanged, that is, the grayscale increases from the four corners to the effective imaging area.

[0038] Among them, the fisheye image is an image captured by a fisheye camera and has not been processed. The fisheye image can be an image captured by any shooting scene or any shooting parameters (such as exposure parameters), and this application does not impose any restrictions on this.

[0039] In order to achieve calibration of the effective normal area of ​​the fisheye camera, it is necessary to first obtain the fisheye image taken by the fisheye camera to preprocess the fisheye image.

[0040] Step 012: Perform color space transformation on the fisheye image to generate a grayscale image;

[0041] Among them, the fisheye image is generally a visible light image (such as a red, green, and blue (RGB) three-channel image), and the color space transformation can be performed on the fisheye image through the HSV (Hue, Saturation, Value) color model, so as to calculate the hue (H), saturation (S) and lightness (V) of each pixel according to the three-channel pixel value of each pixel (i.e., R channel pixel value, G channel pixel value and B channel pixel value), and then generate a grayscale image according to the lightness of each pixel.

[0042] Step 013: Calculate the derivative of each pixel in the grayscale image in the horizontal direction to generate a first gradient image, and calculate the derivative of each pixel in the grayscale image in the vertical direction to generate a second gradient image;

[0043] Specifically, after obtaining a grayscale image, as discussed above, the grayscale variation trend from the four corners of the fisheye camera to the effective imaging area remains constant, that is, the grayscale gradient remains constant. Therefore, the grayscale in different directions of the grayscale image can be calculated to obtain multiple gradient images. Specifically, the Canny operator can be used to obtain gradient images.

[0044] Generally, according to the arrangement of pixels, the horizontal gradient and the vertical gradient of the fisheye image are calculated respectively, thereby obtaining a first gradient image and a second gradient image with vertical gradient directions.

[0045] Optionally, when determining the first gradient image, the derivative of each pixel of the grayscale image in the horizontal direction may be calculated separately, thereby obtaining the gradient of the grayscale image in the horizontal direction to generate the first gradient image; when determining the second gradient image, the derivative of each pixel of the grayscale image in the vertical direction may be calculated separately, thereby obtaining the gradient of the grayscale image in the vertical direction to generate the second gradient image.

[0046] Step 014: Calculating the azimuth angle corresponding to each first pixel in the first gradient image and the second pixel in the second gradient image at the same position as the first pixel, and performing normalization processing on the azimuth angles to generate an azimuth image based on the normalized azimuth angles;

[0047] Specifically, after the first gradient image and the second gradient image are determined, the azimuth image can be generated according to the first gradient image and the second gradient image.

[0048] The first gradient image includes multiple first pixels, the second gradient image includes multiple second pixels, and the azimuth image includes multiple third pixels. The pixel value of the third pixel is the azimuth. The first pixels, the second pixels, and the third pixels correspond one-to-one, and the positions of the one-to-one corresponding first pixels, second pixels, and third pixels are the same.

[0049] The third pixel at the same position in the azimuth image can be determined based on the first pixel and the second pixel at the same position. For example, the azimuth corresponding to the first pixel, that is, the pixel value of the third pixel corresponding to each first pixel, is calculated based on the pixel value of the first pixel and the second pixel at the same position, and the inverse tangent function, so that the azimuth image is generated based on the pixel value of each third pixel. The azimuth is in the interval [0, 360 degrees]. Image processing is generally performed based on an 8-bit data structure. Therefore, the azimuth image needs to be normalized so that all azimuths are normalized to a preset azimuth interval, such as the preset azimuth interval can be [0, 255]. It can be understood that the preset azimuth interval can also be other ranges, and the preset azimuth interval can be determined based on the number of bits of image processing, which is not limited here. The azimuth is used to indicate the direction of grayscale gradient change of each third pixel.

[0050] In this way, an azimuth image is generated by using the first gradient image and the second gradient image to represent the variation trend of pixels, thereby facilitating subsequent determination of the effective imaging area of ​​the fisheye camera based on the azimuth image.

[0051] Please refer to FIG. 3 , which shows an azimuth image generated according to the first gradient image and the second gradient image, wherein the pixel values ​​of different third pixels represent the azimuth angles of the pixels.

[0052] Step 015: Determine the effective imaging area of ​​the fisheye camera based on the azimuth image.

[0053] Specifically, after determining the azimuth image, the azimuth image can be tested to determine the effective imaging area, such as by performing edge detection on the azimuth image. As shown in Figure 3, the outline of the circular effective imaging area is clearly visible, thereby determining the effective imaging area. Because the grayscale variation trend from the four corners to the center of the fisheye camera remains unchanged in different shooting scenes, the azimuth image determined based on the gradient image can adapt to different shooting scenes, thereby ensuring the accuracy of the effective imaging area determined based on the azimuth image.

[0054] The fisheye image processing method of the embodiment of the present application obtains a single-channel grayscale image of the fisheye image after color space conversion, and then generates a first gradient image and a second gradient image based on the horizontal and vertical derivatives of the grayscale image, respectively. Thus, the azimuth angle corresponding to each first pixel is determined based on any first pixel in the gradient image and the second pixel in the second gradient image that is located at the same position as the first pixel, thereby generating an azimuth image based on the azimuth angle corresponding to each first pixel. Finally, the effective imaging area is determined based on the azimuth image. For a fisheye camera, since the grayscale change trend between different image areas of the fisheye image taken in different shooting scenes is constant, such as the grayscale change trend from the four corners to the center of the fisheye camera is constant, the azimuth image determined based on the first gradient image and the second gradient image can adapt to different shooting scenes, thereby ensuring the accuracy of the effective imaging area determined based on the azimuth image.

[0055] Referring to FIG. 4 , in some embodiments, step 015 : determining the effective imaging area of ​​the fisheye camera based on the azimuth image includes:

[0056] Step 0151: Determine multiple angle offsets within a preset interval based on a preset step size;

[0057] Step 0152: adding an angle offset to each azimuth angle in the azimuth angle image to generate an offset image corresponding to each angle offset;

[0058] Step 0153: performing binarization processing on each offset image to generate a binarized image corresponding to each offset image;

[0059] Step 0154: Determine an effective imaging area based on multiple binary images.

[0060] Specifically, after the azimuth image is determined, it is necessary to shift the azimuth image based on different angular offsets, so as to highlight the third pixel located near the edge of the effective imaging area under different angular offsets.

[0061] Therefore, multiple angle offsets can be determined within a preset interval (e.g., the preset interval is [0, 360]), such as angular offsets of 0, 30, 50, 80, 110, etc., so that the multiple angle offsets are distributed as much as possible throughout the preset interval. Furthermore, multiple angle offsets can be determined within the preset interval based on a preset step size. For example, if the preset interval is [0, 360], if the preset step size is 10, 30, 50, 60, etc., multiple angle offsets can be obtained. For example, taking a preset step size of 30 as an example, 13 angle offsets can be obtained, such as 0, 30, 60, 90, ..., 360, respectively, thereby covering the entire preset interval. In this case, after the multiple angle offsets are arranged in order from small to large, the difference between any two adjacent angle offsets is the same and is the preset step size. This ensures that the multiple angle offsets are evenly distributed throughout the preset interval, which is beneficial for improving the accuracy of the offset image after subsequent angle offset processing.

[0062] Then, the azimuth image is processed according to each angular offset, thereby generating an offset image corresponding to each angular offset. For example, the offset image can be determined according to the following formula: I2(x, y) = I1(x, y) + α, where I2 is the offset image, I1 is the azimuth image, (x, y) is the image coordinate, (x, y) is within the image coordinate range of the azimuth image, I2(x, y) represents the fourth pixel with image coordinates (x, y), I1(x, y) represents the third pixel with image coordinates (x, y), and α is the angular offset. Specifically, the pixel value of each third pixel in the azimuth image can be added to the angular offset to obtain the pixel value of the fourth pixel corresponding to each third pixel, thereby generating an offset image corresponding to the angular offset based on the pixel values ​​of the multiple fourth pixels. In this way, an offset image corresponding to each angular offset can be obtained, i.e., a total of 13 offset images.

[0063] In addition, the pixel value of the fourth pixel obtained by adding the angle offset to the pixel value of the third pixel may be greater than or equal to a preset threshold (such as the preset threshold is 256), which does not meet the data requirements of image processing and therefore needs to be processed. For the fourth pixel with a pixel value greater than 255, the pixel value of the fourth pixel is replaced according to the difference between the pixel value of the fourth pixel and the preset threshold, thereby ensuring that the pixel values ​​of all fourth pixels are less than or equal to 255. Therefore, for the fourth pixel with a pixel value greater than 255, the pixel value of the fourth pixel is subtracted from the preset threshold (such as 256). It can be understood that for angles exceeding 360, the angles obtained by subtracting 360 are actually the same, such as 30 degrees and 390 degrees. Therefore, after the pixel value of the fourth pixel with a pixel value greater than 255 is subtracted from 256, the corresponding azimuth angle is actually unchanged and will not affect the accuracy of the azimuth angle.

[0064] In order to facilitate data processing, improve data processing efficiency, and make the features of the effective imaging area more obvious, each offset image can be binarized to obtain multiple binary images. When the pixel value of the fourth pixel of the offset image is in the interval [0, 255], 200 can be used as the threshold, so that pixels with pixel values ​​greater than 200 are assigned a value of 255, and pixels with pixel values ​​less than or equal to 200 are assigned a value of 0, thereby forming a black and white binary image. After binarizing the 13 offset images respectively, 13 binary images can be obtained.

[0065] Please refer to Figures 5 to 8, which are binarized images with angle offsets of 0, 60, 120, and 180 degrees, respectively. For the sake of simplicity, not all 13 binarized images are shown here; only the binarized images with some of the angle offsets are shown. It can be understood that because the offset images angularly offset the azimuth images, different areas appear white after binarization. For example, for azimuth images corresponding to different shooting scenes, the edge of the effective imaging area in the lower left corner is close to 360 degrees in azimuth. Therefore, after binarization of the 0-degree offset image, only the edge of the effective imaging area in the lower left corner appears white, forming a white arc. Similarly, after performing the angle offset, images of the edge of the effective imaging area corresponding to different angle offsets can be obtained. Thus, after obtaining images of the edge of all effective imaging areas within a preset range (i.e., within 0 to 360 degrees), the effective imaging area can be determined based on the multiple binarized images corresponding to the multiple offset images.

[0066] Optionally, each binarized image can be subjected to median filtering to obtain a filtered binarized image, thereby reducing the impact of discrete noise pixels on the subsequent determination of the effective imaging area. The effective imaging area can then be accurately determined based on multiple binarized images after median filtering.

[0067] Referring to FIG. 9 , in certain embodiments, step 0154 : determining an effective imaging area based on a plurality of binarized images, includes:

[0068] Step 01541: Accumulating pixel values ​​of pixels at the same position in multiple binary images to generate a statistical image;

[0069] Step 01542: normalize each pixel in the statistical image;

[0070] Step 01543: performing binarization processing on the normalized statistical image;

[0071] Step 01544: performing median filtering on the binarized statistical image; and

[0072] Step 01545: Determine the effective imaging area based on the statistical image after median filtering.

[0073] Specifically, referring to FIG10 , after obtaining a plurality of binarized images corresponding to different angle offsets, it can be clearly seen that the corresponding white pixel area in each binarized image is part of the effective imaging area. Therefore, a statistical image can be generated based on the pixel values ​​of pixels at the same position in a plurality of binarized images (or a plurality of binarized images after median filtering), thereby forming a complete effective imaging area.

[0074] For example, the pixel values ​​of pixels at the same position in multiple binary images are accumulated to determine multiple accumulated pixel values, and then a statistical image is generated based on the accumulated pixel values. It can be understood that if there are pixels with pixel values ​​exceeding 255 in the statistical image, in order to facilitate subsequent image processing, the statistical image can be normalized so that the pixel values ​​of the pixels in the statistical image are within a preset interval (such as [0, 255]). Alternatively, based on the quotient of the accumulated pixel value and the pixel value of the white pixel in the binary image (i.e., the preset pixel value), it is determined how many white pixels each accumulated pixel value is composed of, that is, the accumulated number of white pixels corresponding to each accumulated pixel value is determined. Based on the accumulated number corresponding to each accumulated pixel value, a statistical image can be generated. At this time, the pixel value of each pixel in the statistical image is the number of white pixels at the same position in the multiple binary images. In order to facilitate subsequent image processing, the statistical image can also be normalized so that the pixel values ​​of the pixels in the statistical image are within a preset interval (such as [0, 255]).

[0075] After the statistical image is normalized, the threshold value can be used to binarize the normalized statistical image again to obtain a binarized image corresponding to the statistical image, so that the effective imaging area is presented in the binarized image corresponding to the statistical image. As shown in Figure 10, it can be clearly seen that the outline of the effective imaging area in the binarized image corresponding to the statistical image is already relatively obvious. Therefore, the effective imaging area can be quickly and accurately determined based on the statistical image in the subsequent process.

[0076] Optionally, median filtering may be performed on the statistical image or the binarized image corresponding to the statistical image to eliminate discrete noise pixels in the image and improve the accuracy of subsequent determination of the effective imaging area.

[0077] Referring to FIG. 11 , in certain embodiments, step 01545: determining an effective imaging area based on the statistical image after median filtering includes:

[0078] Step 01546: Scan the statistical image after median filtering line by line to obtain boundary pixels in each line whose pixel values ​​are preset pixel values;

[0079] Step 01547: Determine the effective imaging area based on the coordinates of all boundary pixels.

[0080] Specifically, after determining the statistical image after binarization processing (or the statistical image after median filtering), the effective imaging area can be determined according to the statistical image after binarization processing (or the statistical image after median filtering).

[0081] For example, the statistical image after median filtering is scanned line by line to obtain boundary pixels whose pixel values ​​in each line are preset pixel values ​​(such as 255); if the boundary pixels are the first and last pixels in each row of pixels whose values ​​are preset pixel values ​​(such as 255), that is, the first white pixel and the last white pixel in each row of pixels, all boundary pixels in the statistical image after binarization processing (or the statistical image after median filtering) are obtained, and the effective imaging area can be determined according to the image coordinates of all boundary pixels.

[0082] For example, a nonlinear optimization error equation can be constructed based on the image coordinates of all boundary pixels and preset parameters to be solved. The parameters to be solved include the image coordinates and radius of the center of the effective imaging area. By solving the optimal solution of the nonlinear optimization error equation, the image coordinates and radius of the center of the effective imaging area are obtained, thereby determining the effective imaging area.

[0083] Please refer to Figure 12. The electronic device 100 of an embodiment of the present application includes one or more processors 20, a memory 30 and one or more programs 40, wherein the one or more programs 40 are stored in the memory 30 and executed by the one or more processors 20, and the program 40 includes instructions for executing the fisheye image processing method of any of the above embodiments.

[0084] The electronic device 100 may be a fisheye camera or a backend server device, mobile phone, tablet computer, laptop computer, smartwatch, etc. that communicates with the fisheye camera. As shown in FIG12 , the embodiment of the present application is described using the electronic device 100 being a fisheye camera as an example. It is understood that the specific form of the electronic device 100 is not limited to a fisheye camera. The fisheye camera of the present application can, after acquiring a fisheye image, perform image processing based on the fisheye image to obtain an azimuth image, thereby facilitating calibration of the fisheye camera at any time during use.

[0085] Please refer to Figure 13. The embodiment of the present application also provides a non-volatile computer-readable storage medium 300, on which a computer program 310 is stored. When the computer program 310 is executed by the processor 320, the steps of the fisheye image processing method of any of the above-mentioned embodiments are implemented. For the sake of brevity, they are not repeated here.

[0086] In the description of this specification, the reference terms "certain embodiments", "in an example", "exemplarily", etc. mean that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are mutually inconsistent.

[0087] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.

[0088] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A fisheye image processing method, wherein: The fisheye image processing method comprises: Get the fisheye image taken by the fisheye camera; Performing color space transformation on the fisheye image to generate a grayscale image; Calculating the derivative of each pixel in the grayscale image in the horizontal direction to generate a first gradient image, and calculating the derivative of each pixel in the grayscale image in the vertical direction to generate a second gradient image; Calculating the azimuth angle corresponding to each first pixel according to each first pixel of the first gradient image and the second pixel in the second gradient image at the same position as the first pixel, and normalizing the azimuth angle to generate an azimuth image according to the normalized azimuth angle; An effective imaging area of ​​the fisheye camera is determined according to the azimuth image.

2. The fisheye image processing method according to claim 1, wherein: The step of determining the effective imaging area of ​​the fisheye camera according to the azimuth image comprises: Based on a preset step length, determining a plurality of angle offsets within a preset interval; respectively adding the angle offset to each of the azimuth angles in the azimuth angle image to generate an offset image corresponding to each of the angle offsets; Performing binarization processing on each of the offset images respectively to generate a binarized image corresponding to each of the offset images; The effective imaging area is determined based on the multiple binarized images.

3. The fisheye image processing method according to claim 2, wherein: The step of respectively adding the angle offset to each of the azimuth angles in the azimuth angle image to generate an offset image corresponding to each of the angle offsets comprises: adding the angle offset to each of the azimuth angles in the azimuth angle image respectively; and When the value of the azimuth angle plus the angle offset is greater than or equal to a preset threshold, reducing the value by the preset threshold; The offset image corresponding to the angle offset is generated according to the azimuth image after the angle offset is added.

4. The fisheye image processing method according to claim 2, wherein: Before determining the effective imaging area according to the plurality of binarized images, the fisheye image processing method comprises: Performing median filtering on each of the binarized images respectively; The step of determining the effective imaging area according to the plurality of binarized images comprises: The effective imaging area is determined according to the binarized images after multiple median filtering.

5. The fisheye image processing method according to claim 2, wherein: The step of determining the effective imaging area according to the plurality of binarized images comprises: Accumulating pixel values ​​of pixels at the same position in a plurality of the binary images to generate a statistical image; Normalizing each pixel in the statistical image; Performing binarization processing on the normalized statistical image; Performing median filtering on the binarized statistical image; and The effective imaging area is determined according to the statistical image after median filtering.

6. The fisheye image processing method according to claim 5, wherein: The step of accumulating pixel values ​​of pixels at the same position in a plurality of the binary images to generate a statistical image comprises: Accumulating pixel values ​​of pixels at the same position in a plurality of the binary images respectively to generate a plurality of accumulated pixel values; Determining the accumulated number of pixels of the preset pixel value corresponding to the accumulated pixel value according to the quotient of the accumulated pixel value and the preset pixel value; The statistical image is generated according to the accumulated quantity.

7. The fisheye image processing method according to claim 5, wherein: The determining the effective imaging area according to the statistical image after median filtering includes: Scanning the statistical image after median filtering line by line to obtain boundary pixels whose pixel values ​​in each line are preset pixel values; The effective imaging area is determined according to the image coordinates of all the boundary pixels.

8. An electronic device, wherein: include: One or more processors, memory; and One or more programs, wherein one or more of the programs are stored in the memory and executed by one or more of the processors, and the programs include instructions for executing the fisheye image processing method according to any one of claims 1 to 7.

9. A non-volatile computer-readable storage medium containing a computer program, wherein: When the computer program is executed by a processor, the processor executes the fisheye image processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Rock mass slope stability analyzing method based on video detection

    CN102243323A

  • Effective area extraction method of fisheye image

    CN110610455A

  • Pixel-by-pixel fisheye camera calibration method and system, medium and device

    CN115690228A

  • Fisheye image processing method and device, electronic equipment and storage medium

    CN116385370A

  • Apparatus for imaging and image processing and method thereof

    US6876762B1