A panoramic system brightness adjustment method
By selecting the overlapping area between the reference image and the image to be stitched in the panoramic system, and by using an optimized homography matrix and brightness adjustment algorithm, the problem of uneven panoramic images caused by differences in camera brightness was solved, thus improving the imaging quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FORYOU GENERAL ELECTRONICS
- Filing Date
- 2021-07-27
- Publication Date
- 2026-05-22
AI Technical Summary
Under different lighting conditions, the brightness of each camera varies greatly, which affects the brightness balance of the panoramic stitched image and leads to a decrease in image quality.
By acquiring the overlapping areas of images from various cameras, selecting a reference image and the image to be stitched, and using an optimized homography matrix for stitching, adjustments are made when the brightness is uneven, including adjustments to exposure time and gain. A bilinear interpolation algorithm and gamma correction parameters are used for brightness correction.
It achieves uniform brightness in panoramic stitched images, thus improving image quality.
Smart Images

Figure CN115689877B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of panoramic system technology, and in particular to a method for adjusting the brightness of a panoramic system. Background Technology
[0002] With the continuous advancement of automotive electronics and computer vision technologies, more and more high-tech intelligent configurations are being widely applied to automobiles, and products assisting drivers in vehicle control are becoming increasingly sophisticated. Previously, reversing radar, a common automotive electronic component, used ultrasonic ranging to determine the distance between objects near the rear of the vehicle and the vehicle body, then alerted the driver via display or audio devices. In contrast, in-vehicle panoramic imaging systems utilize cameras positioned around the vehicle to capture images from various directions, then stitch these images together based on the camera's own parameters and installation parameters to obtain a 360-degree panoramic image of the vehicle's surroundings, greatly facilitating the driver's monitoring of the area around the vehicle.
[0003] However, under different lighting conditions, and due to the different installation positions of the cameras, the amount of light entering each camera varies, resulting in significant differences in the brightness of each camera, which affects the brightness balance of the stitched image.
[0004] Therefore, existing technologies need further improvement. Summary of the Invention
[0005] This invention provides a method for adjusting the brightness of a panoramic system, aiming to overcome the shortcomings of the prior art, achieve uniform brightness in panoramic stitched images, and improve imaging quality.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0007] This invention provides a method for adjusting the brightness of a panoramic system, comprising:
[0008] Step 1: Acquire images from each camera;
[0009] Step 2: Determine the overlapping areas of the images from each camera;
[0010] Step 3: In each overlapping area, select the first image as the reference image for the panoramic image, and use the second image as the image to be stitched together;
[0011] Step 4: Obtain the initial homography matrix between the reference image and the image to be stitched;
[0012] Step 5: Correct the initial homography matrix to obtain the optimized homography matrix;
[0013] Step 6: Based on the optimized homography matrix, the reference image and the image to be stitched are stitched together using a bilinear interpolation algorithm to obtain a panoramic stitched image;
[0014] Step 7: Determine whether the brightness uniformity of the panoramic stitched image meets the preset value. If yes, complete the panoramic image stitching; otherwise, adjust the brightness of the panoramic stitched image.
[0015] Specifically, step 1 includes:
[0016] Step 101: Configure a preset image output format for the camera system in the panoramic system, and send the preset image output format to the image processor in the panoramic system;
[0017] Step 102: The image processor sets the image receiving configuration parameters according to the preset image output format, and sends the configuration parameters to the camera system;
[0018] Step 103: The camera system receives the configuration parameters and determines whether the configuration parameters match the preset image output format. If they match, the image data transmission is started and the process proceeds to the next step; otherwise, the process returns to step 101.
[0019] Step 104: The image processor receives the image data and processes it according to the configuration parameters.
[0020] Specifically, step 5 includes:
[0021] Step 501: Calculate the normalized cross-correlation objective function value corresponding to the initial homography matrix, and determine whether the normalized cross-correlation objective function value is greater than a preset threshold. If it is, no optimization adjustment is needed; otherwise, proceed to the next step.
[0022] Step 502: Starting from the initial point corresponding to the initial homography matrix, initialize the number of searches and set the initial search step size to ;
[0023] Step 503: Search along the horizontal, vertical, and diagonal directions with the current step size;
[0024] Step 504: Calculate the current normalized cross-correlation objective function value corresponding to the current homography matrix, and determine whether the current normalized cross-correlation objective function value is greater than a preset threshold. If it is, use the current homography matrix as the optimized homography matrix; otherwise, proceed to the next step.
[0025] Step 505: Increment the search count by a preset value, modify the current search step size according to a preset formula, and return to step 503.
[0026] Specifically, the preset formula is: αc'=(s+1)αc, where αc represents the current search step size, αc' represents the modified search step size, and s represents the current search number.
[0027] Specifically, step 7 includes:
[0028] Step 7A1: Set the brightness difference range;
[0029] Step 7A2: Obtain the first average brightness and the second average brightness in each overlapping region, wherein the first average brightness is the average brightness of the current frame of the first image, and the second average brightness is the average brightness of the current frame of the second image;
[0030] Step 7A3: Calculate the absolute value of the brightness difference based on the first average brightness value and the second average brightness value, wherein the absolute value of the brightness difference is the absolute value of the difference between the first average brightness value and the second average brightness value;
[0031] Step 7A4: Determine whether the absolute values of the brightness differences are all within the range of the brightness differences. If yes, determine that the brightness uniformity of the panoramic stitched image meets the preset value. Otherwise, determine that the brightness uniformity of the panoramic stitched image does not meet the preset value and proceed to the next step.
[0032] Step 7A5: Select the two camera images corresponding to the minimum absolute value of brightness difference as the reference value for brightness adjustment, and adjust the brightness of each camera image according to the reference value. The minimum absolute value of brightness difference is the smallest among the absolute values of brightness difference.
[0033] Specifically, step 7A5 includes:
[0034] Step A501: Determine whether the absolute value of the minimum brightness difference is within the range of the brightness difference. If yes, keep the first brightness value unchanged; otherwise, adjust the first brightness value according to the first preset algorithm. The first brightness value is the brightness value of the two camera images corresponding to the absolute value of the minimum brightness difference.
[0035] Step A502: Adjust the second brightness value according to the second preset algorithm based on the absolute value of the minimum brightness difference. The second brightness value is the brightness value of the two camera images in the diagonally overlapping area of the overlapping area to which the absolute value of the minimum brightness difference belongs.
[0036] Step A503: Based on the preset relationship between ambient light brightness and image brightness, obtain the first relationship formula for each camera in the previous frame of the panoramic stitching image;
[0037] Step A504: Based on the adjusted first brightness, the adjusted second brightness, and the preset relationship between ambient light brightness and image brightness, obtain the second relationship formula for each camera;
[0038] Step A505: Determine the exposure time and gain product of the next frame image from the camera based on the first and second relational expressions.
[0039] Specifically, the first preset algorithm is: Y1(j)'=Y1(j)+△Yj / 2, where Y1(j)' is the adjusted first brightness value, and Y1(j) represents the first brightness value before adjustment;
[0040] The second preset algorithm is: Y2(j)'=Y2(j)+△Yp+△Yj / 2, where Y2(j)' is the adjusted second brightness value, Y2(j) represents the second brightness value before adjustment, and △Yp represents the absolute value of the brightness difference corresponding to the diagonal overlapping area.
[0041] Specifically, step 7 includes:
[0042] Step 7B1: Rasterize the panoramic stitched image to obtain several grid units;
[0043] Step 7B2: Calculate the average brightness of all pixels in each grid cell and store it in the brightness array;
[0044] Step 7B3: Extract the first feature block and store it in the first array; extract the second feature block and store it in the second array.
[0045] Step 7B4: Obtain the first average brightness and the second average brightness, where the first average brightness is the average brightness of the first feature block and the second average brightness is the average brightness of the second feature block.
[0046] Step 7B5: Obtain the relationship between the first average brightness, the second average brightness and the regression coefficients through a logarithmic regression model;
[0047] Step 7B6: Calculate the gamma correction parameter based on the regression coefficients;
[0048] Step 7B7: Perform brightness correction on the first feature block and the second feature block according to the gamma correction parameters and a preset correction algorithm.
[0049] Specifically, step 7B6 includes: when the regression coefficient β≥0, the gamma correction parameter γ=1-β; when the regression coefficient β<0, the gamma correction parameter γ=1 / (1+β).
[0050] Specifically, the preset correction algorithm is: Out=In γ , where Out represents the corrected brightness value and In represents the brightness value to be corrected.
[0051] The beneficial effects of this invention are as follows: This invention obtains the overlapping areas of images from various cameras, selects one image as the reference image for the panoramic image, and the other image as the image to be stitched. The optimized homography matrix between the reference image and the image to be stitched is then used to stitch the images together to obtain a panoramic stitched image. When the brightness uniformity of the panoramic stitched image does not meet the preset value, the brightness of the panoramic stitched image is adjusted, thereby achieving uniform brightness in the panoramic stitched image and improving the imaging quality. Attached Figure Description
[0052] Figure 1 This is a flowchart illustrating the panoramic system brightness adjustment method of the present invention;
[0053] Figure 2 This is a schematic diagram of the panoramic system image stitching of the present invention. Detailed Implementation
[0054] The embodiments of the present invention are described in detail below with reference to the accompanying drawings. The drawings are for reference and illustration only and do not constitute a limitation on the scope of protection of the present invention.
[0055] Example 1
[0056] The panoramic system in this embodiment includes four cameras (front, rear, left, and right) and an image processor. The image processor is used to process and stitch together the images captured by the four cameras to obtain a panoramic image.
[0057] like Figure 1 As shown, this embodiment provides a method for adjusting the brightness of a panoramic system, including:
[0058] Step 1: Acquire images from each camera.
[0059] In practice, the images captured by each camera are sent to the image processor in the panoramic system for processing.
[0060] Step 2: Determine the overlapping areas of the images from each camera.
[0061] In this embodiment, the overlapping region is denoted as Zq. The overlapping region Zq contains two overlapping camera images, denoted as the first image F(q1) and the second image F(q2), respectively, where q=1,2,3,…k, and k represents the number of overlapping regions. In this embodiment, k=4.
[0062] like Figure 2 As shown, the panoramic system image in this embodiment includes overlapping regions Z1, Z2, Z3, and Z4 in a clockwise order.
[0063] In this embodiment, the direction of the front of the vehicle is considered forward, the direction of the rear of the vehicle is considered rear, the direction of the left rearview mirror is considered left, and the direction of the right rearview mirror is considered right.
[0064] The overlapping area Z1 represents the overlapping area of the field of view of the rear camera and the left camera, which consists of the left field of view image F(11) of the rear camera and the rear field of view image F(12) of the left camera.
[0065] The overlapping area Z2 represents the overlapping area of the fields of view of the left camera and the front camera, which consists of the front field of view image F(21) of the left camera and the left field of view image F(22) of the front camera.
[0066] The overlapping area Z3 represents the overlapping area of the field of view of the front camera and the right camera, which consists of the right field of view image F(31) of the front camera and the front field of view image F(32) of the right camera.
[0067] The overlapping area Z4 represents the overlapping area of the field of view of the right camera and the rear camera, which consists of the rear field of view image F(41) of the right camera and the right field of view image F(42) of the rear camera.
[0068] Step 3: Within each overlapping region Zq, select the first image F(q1) as the reference image for the panoramic image, and use the second image F(q2) as the image to be stitched together.
[0069] It is easy to understand that the second image F(q2) can also be selected as the reference image for the panoramic image, and the first image F(q1) can be used as the image to be stitched.
[0070] Step 4: Obtain the initial homography matrix H between the reference image and the image to be stitched.
[0071] In this embodiment, the positions of each camera in the panoramic system are fixed, so the initial homography matrix H can be obtained through calibration.
[0072] Step 5: Correct the initial homography matrix H to obtain the optimized homography matrix H'.
[0073] During driving, the vehicle's vibrations can cause changes in the camera's position, resulting in noticeable seams in the images stitched together using the initial homography matrix. This affects the quality of the stitched images, so corrections and optimizations are needed based on the vehicle's vibrations.
[0074] Step 6: Based on the optimized homography matrix H', the reference image and the image to be stitched are stitched together using a bilinear interpolation algorithm to obtain a panoramic stitched image.
[0075] Since the coordinates of an image may be decimals after image transformation, interpolation algorithms are needed to determine which position to assign the pixel to. Bilinear interpolation uses the gray levels of the four neighboring pixels of the pixel to be identified to perform linear interpolation in two directions, ultimately making the image appear smoother.
[0076] Step 7: Determine whether the brightness uniformity of the panoramic stitched image meets the preset value. If yes, complete the panoramic image stitching; otherwise, adjust the brightness of the panoramic stitched image.
[0077] For panoramic stitched images under the same lighting conditions, their brightness should be uniform. Therefore, it is necessary to detect the brightness uniformity of the panoramic stitched image to determine whether the brightness needs to be adjusted.
[0078] Example 2
[0079] This embodiment provides a specific implementation method for step 1 in embodiment 1, including:
[0080] Step 101: Configure a preset image output format for the camera system in the panoramic system, and send the preset image output format to the image processor in the panoramic system.
[0081] The preset image output format is MIPI.
[0082] Step 102: The image processor sets the image receiving configuration parameters according to the preset image output format and sends the configuration parameters to the camera system.
[0083] In this embodiment, if the preset image output format is MIPI, the configuration parameters include: MIPI device attribute parameters (e.g., packet size, line synchronization, number of frame synchronization pixels, etc.), data output type (e.g., RGB16, RGB24 or YUV420, etc.), MIPI mode (e.g., CSI, DSI, CMD, etc.), MIPI channel (LANE) configuration, etc.
[0084] Step 103: The camera system receives the configuration parameters and determines whether the configuration parameters match the preset image output format. If they match, the image data transmission is started and the process proceeds to the next step; otherwise, it returns to step 101.
[0085] Step 104: The image processor receives the image data and processes it according to the configuration parameters.
[0086] Example 3
[0087] This embodiment provides a specific implementation method for step 5 in embodiment 1, including:
[0088] Step 501: Calculate the normalized cross-correlation objective function value F(H) corresponding to the initial homography matrix H, and determine whether the normalized cross-correlation objective function value F(H) is greater than the preset threshold T. If yes, no optimization adjustment is needed; otherwise, proceed to the next step.
[0089] Step 502: Starting from the initial point corresponding to the initial homography matrix H, initialize the search count s and set the initial search step size to α0.
[0090] Initialize the search count s, i.e., set s=0.
[0091] Step 503: Search along the horizontal, vertical, and diagonal directions with the current step size.
[0092] Step 504: Calculate the current normalized cross-correlation objective function value F(Hc) corresponding to the current homography matrix Hc, and determine whether the current normalized cross-correlation objective function value F(Hc) is greater than a preset threshold T. If yes, use the current homography matrix Hc as the optimized homography matrix H'; otherwise, proceed to the next step.
[0093] Step 505: Increment the search count s by a preset value, modify the current search step size according to a preset formula, and return to step 503.
[0094] In this embodiment, the preset value is 1.
[0095] The preset formula is: αc'=(s+1)αc, where αc represents the current search step size, αc' represents the modified search step size, and s represents the current search number.
[0096] For example, when s=0, αc=α0; when s=1, αc'=(1+1)αc=2α0; when s=2, αc'=(2+1)αc=3*2α0=6α0.
[0097] Example 4
[0098] This embodiment provides a specific implementation method for step 7 in embodiment 1, including:
[0099] Step 7A1: Set the brightness difference range [△Ymin, △Ymax].
[0100] Step 7A2: Obtain the first average brightness Y(q1) and the second average brightness Y(q2) within each overlapping region Zq. The first average brightness is the average brightness of the current frame of the first image F(q1), and the second average brightness is the average brightness of the current frame of the second image F(q2).
[0101] Specifically, the steps include the following:
[0102] Step A201: Obtain the first RGB value and the second RGB value within each overlapping region Zq. The first RGB value is the RGB value of each pixel in the current frame of the first image F(q1), and the second RGB value is the RGB value of each pixel in the current frame of the second image F(q2).
[0103] The first RGB value is denoted as R(q1). n G(q1) n B(q1) n The second RGB value is denoted as R(q2). n G(q2) n B(q2) n , where n represents the pixel number.
[0104] Step A202: Calculate the brightness value Y(q1) of the first pixel based on the first RGB value and the second RGB value. n The brightness value of the second pixel, Y(q2). n The brightness value of the first pixel is Y(q1). n Let F(q1) be the brightness value of each pixel in the current frame of the first image, and Y(q2) be the brightness value of the second pixel. n Let F(q2) be the brightness value of each pixel in the current frame of the second image.
[0105] It is easy to see that Y(q1) n =0.299*R(q1) n +0.587*G(q1) n +0.114*B(q1) n ;
[0106] Y(q2) n =0.299*R(q2) n +0.587*G(q2) n +0.114*B(q2) n .
[0107] Step A203: Calculate the first average brightness value Y(q1) and the second average brightness value Y(q2).
[0108] In this embodiment, the average brightness of the current frame is the arithmetic mean of the brightness values of each pixel in the current frame.
[0109] Step 7A3: Calculate the absolute value of the brightness difference ΔYq based on the first average brightness value Y(q1) and the second average brightness value Y(q2). The absolute value of the brightness difference is the absolute value of the difference between the first average brightness value Y(q1) and the second average brightness value Y(q2).
[0110] That is: the absolute value of the brightness difference △Yq=|Y(q1)-Y(q2)|.
[0111] Step 7A4: Determine whether the absolute value of the brightness difference ΔYq is within the brightness difference range [ΔYmin, ΔYmax]. If yes, determine that the brightness uniformity of the panoramic stitched image meets the preset value; otherwise, determine that the brightness uniformity of the panoramic stitched image does not meet the preset value and proceed to the next step.
[0112] Step 7A5: Select the two camera images corresponding to the minimum absolute value of brightness difference △Yj as the reference value for brightness adjustment, and adjust the brightness of each camera image according to the reference value. The minimum absolute value of brightness difference △Yj is the smallest among the absolute values of brightness difference △Yq.
[0113] In this embodiment, j = 1, 2, 3…k.
[0114] In this embodiment, step 7A5 includes:
[0115] Step A501: Determine whether the absolute value of the minimum brightness difference △Yj is within the brightness difference range [△Ymin, △Ymax]. If yes, keep the first brightness value unchanged; otherwise, adjust the first brightness value according to the first preset algorithm. The first brightness value is the brightness value of the two camera images corresponding to the absolute value of the minimum brightness difference △Yj.
[0116] In this embodiment, the first preset algorithm is: Y1(j)'=Y1(j)+△Yj / 2, where Y1(j)' is the adjusted first brightness value, and Y1(j) represents the original first brightness value.
[0117] Obviously, Y1(j) contains the brightness values Y(j1) and Y(j2) before the two cameras are adjusted, and Y1(j)' also contains the brightness values Y(j1)' and Y(j2)' after the two cameras are adjusted.
[0118] For example, if △Y1 is the smallest in the absolute value of the minimum brightness difference △Yj, that is, the brightness difference between the rear camera and the left camera within the overlapping area Z1 is the smallest, and if △Y1 is within the brightness difference range, the brightness values of the rear camera and the left camera images do not need to be adjusted; conversely, if △Y1 is outside the brightness difference range, the brightness values of the rear camera and the left camera images need to be adjusted according to the first preset algorithm.
[0119] The adjusted brightness value of the rear camera image is Y(11)'=Y(11)+△Y1 / 2;
[0120] The adjusted brightness value of the left camera image is Y(12)'=Y(12)+△Y1 / 2.
[0121] Step A502: Adjust the second brightness value according to the minimum brightness difference absolute value △Yj using the second preset algorithm. The second brightness value is the brightness value of the two camera images in the diagonally overlapping area of the overlapping area to which the minimum brightness difference absolute value △Yj belongs.
[0122] The second preset algorithm is: Y2(j)'=Y2(j)+△Yp+△Yj / 2, where Y2(j)' is the adjusted second brightness value, Y2(j) represents the second brightness value before adjustment, and △Yp represents the absolute value of the brightness difference corresponding to the diagonal overlapping area.
[0123] For example, when △Y1 is the smallest among the absolute values of the minimum brightness difference △Yj, the diagonal overlapping area is overlapping area Z3, and the corresponding camera images are the front camera image and the right camera image. Therefore, the brightness adjustment value for the front camera and right camera images is △Y3 + △Yj / 2, that is:
[0124] Y(31)'=Y(31)+△Y3+△Y1 / 2,
[0125] Y(32)'=Y(32)++△Y3+△Y1 / 2.
[0126] Step A503: Based on the preset relationship between ambient light brightness and image brightness, obtain the first relationship formula of each camera in the previous frame of the panoramic stitching image.
[0127] In this embodiment, the relationship between the preset ambient light brightness and the image brightness is: L=Y / (T*G), where L represents the ambient light brightness, Y represents the image brightness, T represents the exposure time, and G represents the exposure gain.
[0128] For example, for the rear camera C1, the first relationship is: L=Y(11) / [T0(11)*G0(11)].
[0129] Step A504: Based on the adjusted first brightness, the adjusted second brightness, and the preset relationship between ambient light brightness and image brightness, obtain the second relationship formula for each camera.
[0130] For example, for the rear camera C1, the second relationship is: L=(Y(11)+△Y1 / 2) / [T1(11)*G1(11)].
[0131] Step A505: Determine the exposure time and gain product of the next frame image from the camera based on the first and second relational expressions.
[0132] For example, for the rear camera C1, by combining the first and second relational expressions, the exposure time and gain product T1(11)*G1(11) of the next frame image of the rear camera C1 can be obtained:
[0133] T1(11)*G1(11)={Y(11) / [(T0(11)*G0(11)]} / (Y(11)+△Y1 / 2).
[0134] Example 5
[0135] This embodiment provides another specific implementation method for step 7 in embodiment 1, including:
[0136] Step 7B1: Rasterize the panoramic stitched image to obtain a number of (m*n) grid units;
[0137] In practice, the image can be rasterized into a×a pixels. The value of a can be set to an optimal value based on the actual processing speed and effect. In this embodiment, a=5.
[0138] Step 7B2: Calculate the average brightness Y of all pixels in each of the grid cells. ij (i=1,2…m,j=1,2…n), and store them in the brightness array ill[m,n].
[0139] In this embodiment, Y ij =0.2989R ij +0.5866G ij +0.1145B ij , where R ij G ij B ij These represent the R, G, and B values of the pixel with index ij, respectively.
[0140] Step 7B3: Extract the first feature block and store it in the first array; extract the second feature block and store it in the second array.
[0141] In this embodiment, step 7B3 includes: traversing the brightness array ill[m,n], if the average brightness Y of the current grid cell... ij When the brightness exceeds a first brightness threshold (e.g., 200), determine the average brightness Y of the previous grid cell. (i-1)j and the average brightness Y of the next grid cell (i+1)j If the first brightness threshold is met, the current grid cell, the previous grid cell, and the next grid cell are merged to obtain the first feature block and stored in the first array; otherwise, the next grid cell is determined.
[0142] If the average brightness Y of the current grid cell ij When the brightness is less than the second brightness threshold (e.g., 100), determine the average brightness Y of the previous grid cell. (i-1)j and the average brightness Y of the next grid cell (i+1)jIf all values are less than the second brightness threshold, then the current grid cell, the previous grid cell, and the next grid cell are merged to obtain the second feature block and stored in the second array; otherwise, the next grid cell is determined.
[0143] Step 7B4: Obtain the first average brightness and the second average brightness, wherein the first average brightness is the average brightness of the first feature block and the second average brightness is the average brightness of the second feature block.
[0144] Step 7B5: Obtain the relationship between the first average brightness, the second average brightness and the regression coefficient β through a logarithmic regression model.
[0145] Obtaining the relationship between the first average brightness, the second average brightness and the regression coefficient β using a logarithmic regression model is an existing technique and will not be elaborated upon here.
[0146] Step 7B6: Calculate the gamma correction parameter based on the regression coefficient β.
[0147] In this embodiment, step 7B6 includes: when β≥0, the gamma correction parameter γ=1-β; when β<0, the gamma correction parameter γ=1 / (1+β).
[0148] Step 7B7: Perform brightness correction on the first feature block and the second feature block according to the gamma correction parameters and a preset correction algorithm.
[0149] In this embodiment, the preset correction algorithm is: Out=In γ , where Out represents the corrected brightness value and In represents the brightness value to be corrected.
[0150] The above-disclosed embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Therefore, any equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.
Claims
1. A method for adjusting the brightness of a panoramic system, characterized in that, include: Step 1: Acquire images from each camera; Step 2: Determine the overlapping areas of the images from each camera; Step 3: In each overlapping area, select the first image as the reference image for the panoramic image, and use the second image as the image to be stitched together; Step 4: Obtain the initial homography matrix between the reference image and the image to be stitched; Step 5: Correct the initial homography matrix to obtain the optimized homography matrix; Step 6: Based on the optimized homography matrix, the reference image and the image to be stitched are stitched together using a bilinear interpolation algorithm to obtain a panoramic stitched image; Step 7: Determine whether the brightness uniformity of the panoramic stitched image meets the preset value. If yes, complete the panoramic image stitching; otherwise, adjust the brightness of the panoramic stitched image. Step 5 includes: Step 501: Calculate the normalized cross-correlation objective function value corresponding to the initial homography matrix, and determine whether the normalized cross-correlation objective function value is greater than a preset threshold. If it is, no optimization adjustment is needed; otherwise, proceed to the next step. Step 502: Starting from the initial point corresponding to the initial homography matrix, initialize the number of searches and set the initial search step size; Step 503: Search along the horizontal, vertical, and diagonal directions with the current step size; Step 504: Calculate the current normalized cross-correlation objective function value corresponding to the current homography matrix, and determine whether the current normalized cross-correlation objective function value is greater than a preset threshold. If it is, use the current homography matrix as the optimized homography matrix; otherwise, proceed to the next step. Step 505: Increment the search count by a preset value, modify the current search step size according to a preset formula, and return to step 503.
2. The panoramic system brightness adjustment method according to claim 1, characterized in that, Step 1 includes: Step 101: Configure a preset image output format for the camera system in the panoramic system, and send the preset image output format to the image processor in the panoramic system; Step 102: The image processor sets the image receiving configuration parameters according to the preset image output format, and sends the configuration parameters to the camera system; Step 103: The camera system receives the configuration parameters and determines whether the configuration parameters match the preset image output format. If they match, the image data transmission is started and the process proceeds to the next step; otherwise, the process returns to step 101. Step 104: The image processor receives the image data and processes it according to the configuration parameters.
3. The panoramic system brightness adjustment method according to claim 1, characterized in that, The preset formula is: αc'=(s+1)αc, where αc represents the current search step size, αc' represents the modified search step size, and s represents the current search number.
4. The panoramic system brightness adjustment method according to claim 1, characterized in that, Step 7 includes: Step 7A1: Set the brightness difference range; Step 7A2: Obtain the first average brightness and the second average brightness in each overlapping region, wherein the first average brightness is the average brightness of the current frame of the first image, and the second average brightness is the average brightness of the current frame of the second image; Step 7A3: Calculate the absolute value of the brightness difference based on the first average brightness value and the second average brightness value, wherein the absolute value of the brightness difference is the absolute value of the difference between the first average brightness value and the second average brightness value; Step 7A4: Determine whether the absolute values of the brightness differences are all within the range of the brightness differences. If yes, determine that the brightness uniformity of the panoramic stitched image meets the preset value. Otherwise, determine that the brightness uniformity of the panoramic stitched image does not meet the preset value and proceed to the next step. Step 7A5: Select the two camera images corresponding to the minimum absolute value of brightness difference as the reference value for brightness adjustment, and adjust the brightness of each camera image according to the reference value. The minimum absolute value of brightness difference is the smallest among the absolute values of brightness difference.
5. The panoramic system brightness adjustment method according to claim 4, characterized in that, Step 7A5 includes: Step A501: Determine whether the absolute value of the minimum brightness difference is within the range of the brightness difference. If yes, keep the first brightness value unchanged; otherwise, adjust the first brightness value according to the first preset algorithm. The first brightness value is the brightness value of the two camera images corresponding to the absolute value of the minimum brightness difference. Step A502: Adjust the second brightness value according to the second preset algorithm based on the absolute value of the minimum brightness difference. The second brightness value is the brightness value of the two camera images in the diagonally overlapping area of the overlapping area to which the absolute value of the minimum brightness difference belongs. Step A503: Based on the preset relationship between ambient light brightness and image brightness, obtain the first relationship formula for each camera in the previous frame of the panoramic stitching image; Step A504: Based on the adjusted first brightness, the adjusted second brightness, and the preset relationship between ambient light brightness and image brightness, obtain the second relationship formula for each camera; Step A505: Determine the exposure time and gain product of the next frame image from the camera based on the first and second relational expressions.
6. The panoramic system brightness adjustment method according to claim 5, characterized in that, The first preset algorithm is: Y1(j)'=Y1(j)+△Yj / 2, where Y1(j)' is the first brightness value after adjustment, Y1(j) represents the first brightness value before adjustment, and △Yj represents the absolute value of the minimum brightness difference; The second preset algorithm is: Y2(j)'=Y2(j)+△Yp+△Yj / 2, where Y2(j)' is the adjusted second brightness value, Y2(j) represents the second brightness value before adjustment, and △Yp represents the absolute value of the brightness difference corresponding to the diagonal overlapping area.
7. The panoramic system brightness adjustment method according to claim 1, characterized in that, Step 7 includes: Step 7B1: Rasterize the panoramic stitched image to obtain several grid units; Step 7B2: Calculate the average brightness of all pixels in each grid cell and store it in the brightness array; Step 7B3: Extract the first feature block and store it in the first array; extract the second feature block and store it in the second array. Step 7B4: Obtain the first average brightness and the second average brightness, where the first average brightness is the average brightness of the first feature block and the second average brightness is the average brightness of the second feature block. Step 7B5: Obtain the relationship between the first average brightness, the second average brightness and the regression coefficients through a logarithmic regression model; Step 7B6: Calculate the gamma correction parameter based on the regression coefficients; Step 7B7: Perform brightness correction on the first feature block and the second feature block according to the gamma correction parameters and a preset correction algorithm.
8. The panoramic system brightness adjustment method according to claim 7, characterized in that, Step 7B6 includes: when the regression coefficient β≥0, the gamma correction parameter γ=1-β; when the regression coefficient β<0, the gamma correction parameter γ=1 / (1+β).
9. The panoramic system brightness adjustment method according to claim 8, characterized in that, The preset correction algorithm is: Out=In γ , where Out represents the corrected brightness value and In represents the brightness value to be corrected.