An image compensation method, apparatus, electronic device, and storage medium

By acquiring image data and processing parameters from cameras at different locations in the vehicle surround view system, and combining scene analysis to determine compensation coefficients for image parameter compensation, the problem of inconsistent brightness and color caused by differences in camera position and environment is solved, thus improving the display effect of the surround view panoramic image.

CN123123730APending Publication Date: 2026-11-17XG TECHNOLOGIES PTE LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611374280.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-04
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In automotive surround view systems, the differences in the positions of multiple cameras and the shooting environment can lead to inconsistencies in brightness and color in the stitched images, affecting the visual consistency of the images and the user experience.

Method used

By acquiring image data and processing parameters from cameras at different locations, and combining this with image scene analysis to determine compensation coefficients, image parameter compensation is performed to eliminate brightness and color differences between cameras.

Benefits of technology

It effectively eliminates brightness and color differences between different cameras, improves the display effect of panoramic images, and provides more accurate image references.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123730A_ABST
    Figure CN123123730A_ABST
Patent Text Reader

Abstract

This disclosure discloses an image compensation method, apparatus, electronic device, and storage medium. It acquires image data and image processing parameters from a first and second camera at different locations on a vehicle. Based on the image data and image processing parameters, it determines the image scene in which the vehicle is located. Then, based on the image scene, image processing parameters, and image data, it determines a compensation coefficient corresponding to the first image data. Finally, it performs image parameter compensation on the first image data based on the compensation coefficient to obtain the first target image data. This disclosure allows for the automatic determination of the current shooting scene type based on the differences in ISP parameters and image statistical characteristics of the image data collected by four cameras. Differentiated compensation strategies are adopted for different scenes, effectively solving the problem of inconsistent brightness and color caused by different shooting angles of each camera and different ambient light in the vehicle surround view system, thus improving the visual consistency of the surround view panoramic image and the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image compensation technology, and in particular to an image compensation method, apparatus, electronic device and storage medium. Background Technology

[0002] An Around View Monitor (AVM) system uses multiple cameras deployed around a vehicle to simultaneously capture image data from different directions. After parameter adjustment, this image data is transmitted to a central processing platform for image stitching and fusion, generating a panoramic surround view image for driver assistance.

[0003] Because the cameras are positioned differently relative to the vehicle, the colors of the multiple image data differ, and this parameter difference causes color deviation in the stitched surround-view panoramic image. Summary of the Invention

[0004] To address the aforementioned technical problems, this disclosure provides an image compensation method, apparatus, electronic device, and storage medium to resolve the issue of inconsistent brightness and color in stitched images caused by differences in position and shooting environment among multiple cameras in an automotive surround view system.

[0005] The first aspect of this disclosure provides an image compensation method, comprising: acquiring first image data captured by a first camera, first image processing parameters of the first camera, second image data captured by a second camera, and second image processing parameters of a second camera, wherein the first camera and the second camera are set at different positions on a vehicle; determining the image scene in which the vehicle is located based on the first image data, the first image processing parameters, the second image data, and the second image processing parameters; determining a compensation coefficient corresponding to the first image data based on the image scene, the first image processing parameters, the second image processing parameters, the first image data, and the second image data; and performing image parameter compensation on the first image data based on the compensation coefficient to obtain first target image data.

[0006] A second aspect of this disclosure provides an image compensation device, comprising: a central processing module for acquiring first image data captured by a first camera, first image processing parameters of the first camera, second image data captured by a second camera, and second image processing parameters of a second camera, wherein the first camera and the second camera are positioned at different locations on a vehicle; a scene determination module for determining the image scene in which the vehicle is located based on the first image data, the first image processing parameters, the second image data, and the second image processing parameters; a compensation calculation module for determining a compensation coefficient corresponding to the first image data based on the image scene, the first image processing parameters, the second image processing parameters, the first image data, and the second image data; and an image compensation module for performing image parameter compensation on the first image data based on the compensation coefficient to obtain first target image data.

[0007] A third aspect of this disclosure provides a computer-readable storage medium storing a computer program for performing the image compensation method provided in the first aspect of this disclosure.

[0008] A fourth aspect of this disclosure provides an electronic device, comprising: a processor; a memory for storing processor-executable instructions; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the image compensation method provided in the first aspect of this disclosure.

[0009] A fifth aspect of this disclosure provides a computer program product that, when instructions in the computer program product are executed by a processor, performs the image compensation method provided in the first aspect of this disclosure.

[0010] The image compensation method, apparatus, electronic device, and storage medium disclosed in the above embodiments include a method that involves acquiring image data and corresponding image processing parameters collected by cameras at different locations, first determining the current image scene of the vehicle by combining the image data and parameters, then calculating the compensation coefficient for the corresponding image by combining the scene information with the parameters and image data of each camera, and finally performing parameter compensation on the original image according to the compensation coefficient. The disclosed embodiments can effectively eliminate brightness and color differences between different cameras by specifically calculating compensation coefficients based on the actual shooting scene, making the color and brightness of the stitched panoramic image more uniform and consistent, improving the display effect of the panoramic image, and thus providing a more accurate and clear image reference for assisted driving. Attached Figure Description

[0011] Figure 1 This is a system architecture diagram of an image compensation system provided in an exemplary embodiment of this disclosure; Figure 2 This is a schematic flowchart of an exemplary embodiment of the image compensation method provided in this disclosure; Figure 3 This is a flowchart illustrating step S220 provided in an exemplary embodiment of this disclosure; Figure 4 This is a flowchart illustrating step S222 provided in an exemplary embodiment of this disclosure; Figure 5 This is a flowchart illustrating step S224 provided in an exemplary embodiment of this disclosure; Figure 6 This is a schematic flowchart illustrating the determination of the compensation coefficient of the first image scene in step S230, provided in an exemplary embodiment of this disclosure. Figure 7 This is a schematic flowchart illustrating the determination of the compensation coefficient of the second image scene in step S230, provided in an exemplary embodiment of this disclosure. Figure 8 This is a schematic diagram of the LAB color space conversion compensation process in step S240 provided in an exemplary embodiment of this disclosure; Figure 9 This is a schematic flowchart illustrating the determination of the compensation coefficient for the third image scene in step S230, provided in an exemplary embodiment of this disclosure. Figure 10 This is a detailed flowchart illustrating step S902 of the image stitching process provided in an exemplary embodiment of this disclosure; Figure 11 This is a detailed flowchart illustrating step S903 of the image stitching process provided in an exemplary embodiment of this disclosure; Figure 12 This is a detailed flowchart illustrating step S904 of the image stitching process provided in an exemplary embodiment of this disclosure; Figure 13 This is a schematic diagram of an exemplary embodiment of the present disclosure for image fusion based on a fusion mask; Figure 14 This is a schematic diagram of the dynamic range large scene compensation process provided by an exemplary embodiment of this disclosure; Figure 15 This is a structural diagram of an image compensation apparatus provided in an exemplary embodiment of the present disclosure; Figure 16 This is a structural diagram of an electronic device provided as an exemplary embodiment of the present disclosure. Detailed Implementation

[0012] To explain this disclosure, exemplary embodiments of the disclosure will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the disclosure, and not all of them. It should be understood that the disclosure is not limited to exemplary embodiments.

[0013] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of this disclosure.

[0014] Application Overview An Around View Monitor (AVM) is a driver assistance system that uses four fisheye cameras deployed on the front, rear, left, and right sides of a vehicle to simultaneously capture image data of the vehicle's surroundings. The system then projects, transforms, and stitches these four images together to generate a 360-degree panoramic image. This panoramic image visually displays obstacles, lane markings, and road markings around the vehicle to the driver, playing a crucial safety assistance role in driving scenarios such as low-speed parking and navigating narrow lanes.

[0015] However, because the four fisheye cameras are installed in different positions and facing different directions on the vehicle, the scene areas captured by each camera naturally differ in terms of lighting conditions, reflectivity distribution, and color composition. This difference in shooting scenarios causes the image signal processing (ISP) modules of each camera to calculate different exposure and white balance gain parameters for each independent image content when performing automatic exposure (AE) and automatic white balance (AWB) adjustments. When the four independently processed image data are stitched together into a panoramic image, due to significant deviations in the brightness and color tones of each image, users can observe abrupt changes in brightness and color near the stitching seams, severely affecting the visual consistency of the panoramic image and the user's viewing experience.

[0016] Related techniques typically calculate a globally uniform compensation value based solely on the statistical differences in pixels within overlapping image regions. This method is effective when the overlapping region is relatively simple, but its effectiveness significantly decreases in complex scenes where the overlapping region contains rich color variations, complex color temperature transitions, or large areas of solid color. Furthermore, the parallax effect present in the overlapping region also reduces the accuracy of the difference calculation, resulting in a less than ideal final compensation result.

[0017] Exemplary System Figure 1 This is a system architecture diagram of an image compensation system provided in an exemplary embodiment of this disclosure.

[0018] like Figure 1As shown, the image compensation system 100 may include a central processing module 110, an image acquisition module 120, an ISP parameter processing module 130, a scene selection module 140, a compensation calculation module 150, and an AVM rendering module 160.

[0019] The image acquisition module 120 is communicatively connected to four fisheye cameras (hereinafter referred to as cameras) located on the front, rear, left and right sides of the vehicle, respectively, and is used to acquire raw image data output by each camera and image processing parameters generated by the ISP parameter processing module 130 in real time.

[0020] The central processing module 110 can be a computing platform with powerful data processing capabilities, such as a vehicle's cockpit processor or cockpit-driver integrated processor. It can synchronously acquire image data and ISP parameters from all cameras through an internal bus or high-speed communication interface, and ensure strict consistency of data in terms of timestamps.

[0021] The ISP parameter processing module 130 is used to extract key parameters from the acquired ISP parameters and perform preprocessing, including extracting the automatic white balance gain parameter (AWB Gain) and automatic exposure parameter (AE Parameter) of each camera, and calculating the pixel mean, variance and other statistical features of the whole image based on the original image data, as well as the statistical features in the LAB color space.

[0022] The scene selection module 140 is used to comprehensively determine the image scene type of the current vehicle location based on the white balance gain ratio, exposure parameter ratio and image data output by the ISP parameter processing module 130.

[0023] The compensation calculation module 150 is used to calculate the compensation coefficients required for each image data path according to the scene type determined by the scene selection module 140 and the corresponding compensation strategy, including white balance unification coefficient, LAB space adjustment coefficient, and fusion masking weight, etc.

[0024] The AVM rendering module 160 is used to project and transform the compensated four-channel image data and stitch them together to finally output a panoramic image with consistent brightness and color for display devices (such as the central control display screen in a smart cockpit).

[0025] The modules mentioned above communicate with each other via a high-speed data bus to achieve orderly data transmission and control signal delivery, and together complete the entire processing flow from image acquisition to compensation rendering.

[0026] Exemplary methods Figure 2 This is a schematic flowchart of an image compensation method provided in an exemplary embodiment of this disclosure.

[0027] This embodiment can be applied to electronic devices, such as... Figure 2 As shown, the image compensation method provided in this embodiment includes the following steps: S210: Acquire the first image data captured by the first camera, the first image processing parameters of the first camera, the second image data captured by the second camera, and the second image processing parameters of the second camera.

[0028] In this embodiment, the first camera and the second camera are positioned at different locations on the vehicle. In one implementation, the first camera refers to the camera positioned on the front and rear sides of the vehicle, and the second camera refers to the camera positioned on the left and right sides of the vehicle. The first and second cameras can collectively correspond to four cameras (the number of cameras can be increased or decreased appropriately in different scenarios; for example, the first and second cameras may correspond to two cameras, or more than four cameras). Of course, in other possible implementations, the division of the first and second cameras can also adopt other combinations, such as using the front and left sides as the first camera and the rear and right sides as the second camera. The specific division method should not be considered a limitation of this disclosure.

[0029] In some examples, each camera has a built-in ISP module, and during the process of acquiring image data, the built-in ISP module of each camera will simultaneously generate corresponding image processing parameters (ISP parameters).

[0030] In this process, when the first camera acquires the first image data, its ISP module simultaneously generates the first image processing parameters; similarly, when the second camera acquires the second image data, its ISP module simultaneously generates the second image processing parameters. These image processing parameters record key information such as exposure time, analog gain, digital gain, white balance red channel gain, and white balance blue channel gain used by the cameras when processing the raw image data. The central processing module establishes data transmission channels with both the first and second cameras, simultaneously acquiring the corresponding image data and their respective ISP parameters. In some examples, the image data can be ISP-processed YUV format image data or unprocessed RAW format raw image data.

[0031] S220: Determine the image scene in which the vehicle is located based on the first image data, the first image processing parameters, the second image data, and the second image processing parameters.

[0032] After acquiring the image data (first image data and second image data) and corresponding ISP parameters (first image processing parameters and second image processing parameters) from the four cameras, it is necessary to analyze and classify the external optical environment in which the vehicle is located to determine the image scene in which the vehicle is located and to determine the applicable compensation strategy.

[0033] In one implementation, the classification criteria for image scenes may include the relative differences between the ISP parameters of each camera, such as the proportional relationship between white balance gain parameters, which can reflect the degree of difference in the perception of the current ambient light color by each camera. The classification criteria may also include the variance of pixel values ​​in the panoramic image obtained by stitching the first and second image data across the entire image range, which can reflect the richness and complexity of the colors in the current scene.

[0034] By combining the features of these two classification criteria, image scenes can be divided into various types, such as single color temperature scenes, complex scenes with similar color temperatures, complex scenes with large color temperature differences, and scenes with different dynamic ranges. Each scene type corresponds to a different compensation strategy.

[0035] S230: Based on the image scene, the first image processing parameters, the second image processing parameters, the first image data, and the second image data, determine the compensation coefficient corresponding to the first image data.

[0036] After determining the image scene in which the vehicle is located, the compensation calculation module selects the corresponding compensation algorithm based on the scene type corresponding to the image scene, as well as the first image processing parameters, the second image processing parameters, the first image data, and the second image data, and calculates the compensation coefficient corresponding to the first image data through the compensation algorithm.

[0037] It should be noted that since the driver's main viewing angle while driving is a forward view, the first image data captured by the first camera is the main area observed by the driver. The embodiments of this disclosure can calculate compensation coefficients for the first image data, which can reduce the amount of calculation and improve compensation efficiency while ensuring the image quality of the main observation area.

[0038] The calculation method and parameters involved in the compensation coefficient vary depending on the type of image scene. For example, in a single color temperature scene, the compensation coefficient is mainly unified based on the white balance gain value that appears most frequently. In complex scenes with large color temperature differences, a gradient blending strategy is needed to generate the compensation coefficient. In complex scenes with similar color temperatures, the compensation coefficient can be obtained by calculating the average value.

[0039] S240: Based on the compensation coefficient, perform image parameter compensation on the first image data to obtain the first target image data.

[0040] After obtaining the compensation coefficients, the image compensation module applies them to the first image data to compensate for the image parameters of the first image data. In one implementation, the image compensation module adjusts the color value and brightness of each pixel to obtain the first target image data, thereby unifying the brightness and color values ​​of the image data acquired by each camera.

[0041] After compensation, the first target image data is consistent with the image data from other cameras in terms of brightness and color. It can be used as the image input for the AVM rendering module to perform subsequent stitching and fusion processing on the image data to obtain the final panoramic image data.

[0042] Based on the method provided in the above embodiments, a compensation strategy can be selected to calculate the compensation coefficient by combining the differences in the image scene in which the vehicle is located. In this way, the first image data is compensated based on the compensation coefficient, and the resulting first target image data can effectively eliminate the differences in image parameters between the image data acquired by other cameras (second camera), thereby improving the image quality of subsequent vehicle surround view image stitching and display. At the same time, this disclosure can obtain the characteristics of all data generated by the vehicle through the central processing module 110, such as a cockpit processor or a cockpit-driver integrated processor, and obtain image data and image processing parameters from the image acquisition module. Then, the parameter differences of the image data corresponding to the four cameras are calculated based on the image processing parameters, and a compensation value is calculated based on the parameter differences. The fusion weight required for stitching the image is set, and finally, the image is rendered and displayed through the AVM rendering module 160.

[0043] Figure 3 This is a flowchart illustrating step S220 provided in an exemplary embodiment of the present disclosure.

[0044] like Figure 3 As shown above, in the above Figure 2 Based on the illustrated embodiment, step S220 may include the following steps: S221: Determine multiple first gain ratios based on the first image processing parameters and the second image processing parameters.

[0045] In this embodiment, the first image processing parameter and the second image processing parameter respectively include the white balance gain corresponding to each of the different cameras. In this embodiment, multiple first gain ratios can be obtained by calculating the ratio of the white balance gains corresponding to any two different cameras.

[0046] S222: Combine the first image data and the second image data to obtain the panoramic image data.

[0047] To assess the complexity of the scene captured by the first and second cameras, the first and second image data need to be stitched together to form a surround view image data covering the vehicle.

[0048] In one implementation, the stitching process can be accomplished using the pre-configured stitching matrix and fusion weights in the existing AVM system. The purpose is to temporarily generate a panoramic image for subsequent scene analysis, rather than the panoramic image data ultimately used for display.

[0049] S223: Calculate the variance of the first pixel value of the panoramic image data.

[0050] The variance of the first pixel value is used to measure the degree of color change in the stitched panoramic image data across the entire image area. In specific calculations, the overall variance can be calculated for the multi-channel (red, blue, and green channels) pixel values ​​of each pixel in the panoramic image data (such as the Y component in YUV space or the A and B components in LAB space), or the variance of each color channel can be calculated separately and then weighted and summed.

[0051] The larger the variance value, the more dispersed the color distribution in the image and the higher the complexity of the image content; the smaller the variance value, the more uniform the colors in the image and the simpler the image content.

[0052] S224: Determine the image scene where the vehicle is located based on multiple first gain ratios and first pixel value variances.

[0053] In this embodiment of the disclosure, the corresponding image scene can be determined by comparing the first gain ratio and the first pixel value variance with preset thresholds, respectively. The preset first threshold is used to determine whether the white balance gain ratio is within a reasonable consistency range; the preset second threshold is used to determine the complexity of the image.

[0054] The method provided in this disclosure, when determining a vehicle image scene, first calculates multiple first gain ratios based on first and second image processing parameters, then stitches together two image data streams to obtain surround view image data and calculates its first pixel value variance. The image scene is then comprehensively determined by combining the first gain ratios and the first pixel value variance. Compared to determining the scene solely based on differences in white balance parameters or solely based on image content, this method can more accurately classify different scene types, providing a reliable basis for subsequent differentiated compensation processing. This avoids the problem of poor compensation effects due to scene misjudgment and effectively improves the accuracy of multi-camera surround view image consistency compensation.

[0055] Figure 4 This is a flowchart illustrating step S222 provided in an exemplary embodiment of this disclosure.

[0056] like Figure 4 As shown above, in the above Figure 3 Based on the illustrated embodiment, step S222 includes the following steps: S2221: Based on the first image processing parameters, determine the first set of white balance parameters and the second set of white balance parameters.

[0057] In this embodiment of the disclosure, the image processing parameters may include white balance parameters (AWB parameters), wherein the white balance parameters of each camera include at least two gain values: one is the white balance gain (Gain_R) of the red channel, and the other is the white balance gain (Gain_B) of the blue channel, and the gain of the green channel is typically normalized to a reference value of 1.

[0058] To quantify the dispersion of white balance parameters among the cameras, it is necessary to determine the white balance parameters of the first camera and the second camera respectively, so as to facilitate the subsequent calculation of the first gain ratio.

[0059] In some examples, the first camera refers to a pair of cameras deployed on the longitudinal axis of the vehicle, namely a front-view camera and a rear-view camera facing directly in front of and directly behind the vehicle, respectively. Based on this, a first set of white balance parameters and a second set of white balance parameters can be determined from the first image processing parameters, wherein the first set of white balance parameters is the white balance parameter of the first camera on the front side of the vehicle, and the second set of white balance parameters is the white balance parameter of the first camera on the rear side of the vehicle.

[0060] S2222: Based on the second image processing parameters, determine the third set of white balance parameters and the fourth set of white balance parameters.

[0061] Corresponding to the first camera mentioned above, the second camera refers to a pair of cameras deployed on the vehicle's transverse axis, namely a left-view camera and a right-view camera facing the left and right sides of the vehicle respectively, responsible for collecting information on the road and obstacles on both sides of the vehicle.

[0062] Similarly, the white balance parameters corresponding to the left and right cameras are extracted from the second image processing parameters, namely the third set of white balance parameters and the fourth set of white balance parameters.

[0063] These four sets of white balance parameters (front, back, left, and right) together constitute the basic data source for scene classification. In practical applications, because the left and right cameras may face different lighting environments (e.g., one side facing the sun and the other side in shadow), the difference between their white balance parameters is often more significant than the difference between the front and back cameras, resulting in inconsistent colors on the left and right sides of the panoramic image.

[0064] S2223: Determine multiple first gain ratios based on the first set of white balance parameters, the second set of white balance parameters, the third set of white balance parameters, and the fourth set of white balance parameters.

[0065] After obtaining all four sets of white balance parameters, the next step is to extract the corresponding white balance parameters from each set of white balance parameters, using color channels as the unit. Then, the ratios of the white balance parameters from different sets are calculated to obtain multiple first gain ratios.

[0066] Specifically, by performing white balance parameter extraction on the first group of white balance parameters and the second group of white balance parameters respectively, the first white balance parameter (gain1) and the second white balance parameter (gain2) corresponding to each group are obtained. The first white balance parameter is the red channel parameter of the first camera, and the second white balance parameter is the blue channel parameter of the first camera. For example, since the first camera includes a front-view camera and a rear-view camera, the first white balance parameter of the first group is the red channel parameter of the front-view camera (front...). gain1 The second white balance parameter for the first group is the blue channel parameter of the front-view camera. gain2 The first white balance parameter of the second group is the red channel parameter of the rearview camera. gain1 The second white balance parameter in the second group is the blue channel parameter of the rearview camera. gain2 ).

[0067] Correspondingly, by performing white balance parameter extraction on the third and fourth sets of white balance parameters respectively, we can obtain the corresponding third and fourth white balance parameters for each set. The third white balance parameter is the red channel parameter of the second camera, and the fourth white balance parameter is the blue channel parameter of the second camera. For example, since the second camera includes a left-view camera and a right-view camera, the third white balance parameter of the third set is the red channel parameter of the left-view camera. gain1 The fourth white balance parameter in the third group is the blue channel parameter of the left-view camera. gain2 The third white balance parameter in the fourth group is the red channel parameter of the right-view camera. gain1 The fourth white balance parameter in the fourth group is the blue channel parameter of the right-view camera. gain2 ).

[0068] According to embodiments of this disclosure, a plurality of first gain ratios can be calculated using the following formula: ; Using the above formula, the ratios of the first white balance parameter to the third white balance parameter, the ratio of the first white balance parameter to the fourth white balance parameter, the ratio of the second white balance parameter to the third white balance parameter, and the ratio of the second white balance parameter to the fourth white balance parameter can be calculated, thereby obtaining multiple first gain ratios.

[0069] Multiple first gain ratios are calculated by dividing the first and second white balance parameters as numerators and the third and fourth white balance parameters as denominators. Each set of ratios corresponds to the white balance gain difference of the color channels between cameras in different orientations, which can accurately quantify the dispersion of white balance parameters between different cameras and provide accurate data basis for subsequent judgment on whether compensation is needed for the current scene.

[0070] The method provided in this disclosure specifies that the first camera is located at the front and rear sides of the vehicle, and the second camera is located at the left and right sides of the vehicle. It extracts two sets of white balance parameters from the front and rear first cameras and two sets of white balance parameters from the left and right second cameras, respectively. Then, it calculates multiple first gain ratios based on these four sets of white balance parameters. This method can specifically extract white balance parameters according to the actual layout characteristics of the vehicle's cameras, making the calculation of the first gain ratios more consistent with the characteristics of vehicle surround-view image acquisition and improving the accuracy of scene recognition.

[0071] Figure 5 This is a flowchart illustrating step S224 provided in an exemplary embodiment of this disclosure.

[0072] like Figure 5 As shown above, in the above Figure 4 Based on the illustrated embodiment, step S224 may include the following steps: S2241: Obtain the absolute value of the difference between multiple first gain ratios and 1 respectively.

[0073] To determine whether the white balance parameters between the cameras are within an acceptable range of consistency, it is necessary to calculate the deviation of each first gain ratio from the ideal value of 1. Ideally, if all cameras perceive the same ambient light color completely identically, then the white balance gain ratio of any two sets of cameras in the same channel should be equal to 1.

[0074] Therefore, by subtracting 1 from each first gain ratio and taking the absolute value, the deviation of that gain ratio can be obtained. The smaller the deviation, the closer the white balance parameters of the two corresponding camera groups are on that color channel; the larger the deviation, the more significant the difference. By iterating through all eight first gain ratios and calculating the absolute value of the difference for each, a set containing eight deviations can be obtained, which is used for subsequent comparison with a preset threshold.

[0075] S2242: In response to at least one difference absolute value being greater than a preset first threshold and the variance of the first pixel value being less than a preset second threshold, determine the first image scene in which the vehicle is located.

[0076] The first image scene corresponds to a single color temperature scene type. The current image is determined to belong to the first image scene when both of the following conditions are met: 1. The absolute value of the difference between at least one first gain ratio and 1 exceeds a preset first threshold, indicating a significant difference in white balance parameters between the cameras; 2. The variance of the first pixel value is less than a preset second threshold, indicating that the color variation in the stitched panoramic image is small across the entire image area and the image content is relatively simple. The combination of these two conditions indicates that although the white balance parameters of each camera have some shift due to different shooting angles, the current shooting environment itself has relatively uniform lighting color temperature characteristics, such as an open road scene outdoors on a sunny day, a uniformly lit scene in an underground parking lot, or a streetlight scene at night. Therefore, the image scene can be identified as the first image scene.

[0077] S2243: In response to the fact that the absolute value of all differences is less than a preset first threshold and the variance of the first pixel value is greater than a preset second threshold, determine the second image scene in which the vehicle is located.

[0078] The second image scene corresponds to a complex scene with similar color temperature. When the following two conditions are met simultaneously, it is determined that the current scene belongs to the second image scene: 1. All absolute values ​​of the differences are within the first threshold, indicating that the white balance parameters between the cameras are relatively small and the overall consistency is good; 2. The variance of the first pixel value is greater than the preset second threshold, indicating that the current stitched panoramic image itself is rich in content and has a high degree of color change.

[0079] This situation may occur when the automatic white balance algorithms of each camera respond relatively consistently to the current environment, but there are indeed rich color variations in the environment. For example, a car parked next to a flower bed: all four cameras can correctly identify the approximate color temperature of the environment and set similar white balance parameters, but due to the presence of colorful flowers and green leaves in the flower bed, the stitched image still has a large pixel value variance. In this case, the image scene can be determined as the second image scene.

[0080] S2244: In response to at least one difference absolute value being greater than a preset first threshold and the variance of the first pixel value being greater than a preset second threshold, determine the third image scene in which the vehicle is located.

[0081] The third image scene corresponds to a complex scene with large color temperature differences. A scene is considered a third image scene when both of the following conditions are met: 1. At least one absolute value of the difference is greater than the first threshold, indicating a significant difference in white balance parameters between the cameras; 2. The variance of the first pixel value is greater than the second threshold, resulting in rich colors across the entire image range in the stitched panoramic view. The combination of these two conditions indicates a scene with large color temperature differences, such as: tree-lined roads (where green vegetation coexists with various colors like sky blue and road gray, and the proportions of these colors differ between cameras), city street scenes (where reflections from building glass curtain walls, billboards, and vehicle body reflections intertwine), and dusk or dawn (where the sky exhibits a gradual transition between warm and cool tones). In these scenes, the image content itself has high color complexity, and the differences in white balance parameters caused by the different orientations of the cameras are amplified, thus confirming the image scene as a third image scene.

[0082] The method provided in this disclosure calculates the absolute value of the difference between a first gain ratio and 1, and then uses this absolute value and the variance of a first pixel value to classify three different image scenes. By using quantization indicators as the basis for scene classification, image scenes can be determined under different lighting and color deviation levels, thereby solving the problem of image color deviation of different degrees and types and improving the adaptability of image compensation.

[0083] Figure 6 This is a schematic flowchart illustrating the determination of the compensation coefficient of the first image scene in step S230, provided by an exemplary embodiment of this disclosure.

[0084] like Figure 6 As shown, when the vehicle is in the first image scene (single color temperature scene), the process of determining the compensation coefficient corresponding to the first image data in step S230 may include the following steps: S2311: In response to the vehicle being in a first image scene, determine the first target white balance coefficient that appears most frequently among the first white balance parameters and the third white balance parameters, and determine the second target white balance coefficient that appears most frequently among the second white balance parameters and the fourth white balance parameters.

[0085] In a single color temperature scenario, although there are some differences in the white balance parameters between the cameras, these differences are mainly due to slight drifts in the automatic white balance adjustment of the ISP algorithm caused by the different proportions of color distribution in the images from each camera, rather than the actual presence of multiple light sources with different color temperatures in the environment. Therefore, the white balance parameter value that appears most frequently among the four cameras can be used as the target value.

[0086] Specifically, for the red channel, the four values ​​of the red channel gain of the front-view camera (the first white balance parameter in the first group), the red channel gain of the rear-view camera (the first white balance parameter in the second group), the red channel gain of the left camera (the third white balance parameter in the third group), and the red channel gain of the right camera (the third white balance parameter in the fourth group) are statistically compared, and the white balance parameter with the highest frequency (or the representative value of the mode interval within a continuous numerical range) is selected as the first target white balance coefficient.

[0087] Similarly, for the blue channel, the white balance parameter with the highest frequency (most occurrences) among the four blue channel gain values ​​is selected as the second target white balance coefficient. The selection method can be similar to that of the red channel, and will not be repeated here. This mode-based selection strategy can retain the correct perception results of the current ambient color temperature by most cameras, avoid the influence of extreme values, and ensure that the overall tone after compensation is natural and realistic.

[0088] S2312: Determine the first compensation coefficient based on the first target white balance coefficient and the second target white balance coefficient.

[0089] After determining the first target white balance coefficient corresponding to the red channel and the second target white balance coefficient corresponding to the blue channel, a first compensation coefficient can be constructed based on the first and second target white balance coefficients. The first compensation coefficient is a set of target values ​​used to adjust the gain of the color channels of each camera image. For each camera, its current red channel gain is adjusted to the first target white balance coefficient, the blue channel gain is adjusted to the second target white balance coefficient, and the green channel gain remains unchanged or is scaled proportionally.

[0090] In practical applications, the first compensation coefficient can be expressed as the adjustment ratio of each color channel of each camera. For example, the current red gain of a certain camera needs to be multiplied by (first target white balance coefficient / current red gain) to reach the target value.

[0091] By uniformly adjusting the white balance parameters of the four cameras using the first compensation coefficient, the color differences between cameras caused by the offset of the ISP's automatic white balance adjustment can be effectively eliminated, so that the stitched panoramic image presents a harmonious and consistent visual effect.

[0092] The method provided in this disclosure selects the target white balance parameter that appears most frequently in a single color temperature scene and determines the first compensation coefficient, thereby effectively aligning the white balance parameters of different cameras, eliminating color differences between cameras, and improving the color consistency of panoramic image data.

[0093] Figure 7This is a schematic diagram of the process for determining the compensation coefficient of the second image scene in step S230, provided by an exemplary embodiment of this disclosure.

[0094] like Figure 7 As shown, when the vehicle is in the second image scene (a complex scene with similar color temperature), the process of determining the compensation coefficient corresponding to the first image data in step S230 may include the following steps: S2321: In response to the vehicle being in the second image scene, calculate the average of the first white balance parameter and the third white balance parameter to obtain the third target white balance coefficient, and calculate the average of the second white balance parameter and the fourth white balance parameter to obtain the fourth target white balance coefficient.

[0095] The second image scene is characterized by certain differences in white balance parameters between the cameras, and the image content is also relatively complex. However, the degree of difference is still within a certain controllable range, indicating that although the color temperature of the light source faced by each camera is different, it has not deviated significantly.

[0096] In this case, the average value can be used to determine the second compensation coefficient. Specifically, for the red channel, the arithmetic mean of the red channel gain of the first camera (front-view camera and rear-view camera) (first white balance parameter) and the red channel gain of the second camera (left-view camera and right-view camera) (third white balance parameter) is calculated to obtain the third target white balance coefficient.

[0097] Similarly, for the blue channel, the arithmetic mean between the second and fourth white balance parameters is calculated to obtain the fourth target white balance coefficient. The third and fourth target white balance coefficients are target values ​​located at the midpoint between the red channel gain and the blue channel gain, respectively, so that the compensated images all move closer to the same target value, thereby achieving the purpose of image parameter coordination.

[0098] S2322: Determine the second compensation coefficient based on the third target white balance coefficient and the fourth target white balance coefficient.

[0099] In this embodiment, a second compensation coefficient is constructed using a third target white balance coefficient and a fourth target white balance coefficient. The second compensation coefficient is constructed by using the third target white balance coefficient as the unified target gain for the red channel and the fourth target white balance coefficient as the unified target gain for the blue channel. For each camera, the required compensation amount is the ratio of the target gain of the corresponding color channel to its current value. Through compensation using the second compensation coefficient, basic color consistency can be achieved between the image data of each camera, and the original color details of each image data channel can be preserved to the maximum extent.

[0100] The method provided in this disclosure determines a second compensation coefficient by taking the average value of the white balance parameters of each camera in complex but similar color temperature scenarios. This can not only coordinate the white balance parameters of different cameras and eliminate obvious color differences, but also avoid the loss of color details caused by over-correction by using the average value, thereby improving the color consistency of the panoramic image.

[0101] Figure 8 This is a schematic flowchart of step S240, LAB color space conversion compensation, provided in an exemplary embodiment of this disclosure.

[0102] like Figure 8 As shown above, in the above Figure 6 or Figure 7 Based on the illustrated embodiment, when image parameter compensation is performed on the first image data based on the first compensation coefficient or the second compensation coefficient, step S240 may include the following steps: S2411: Determine the initial color space of the first image data.

[0103] Before performing color compensation, it is necessary to first determine the color space format of the first image data. Image color spaces include one of the following: RGB space (red, green, and blue primary color space), YUV space (luminance-chrominance separation space), and RAW Bayer format space. Different color spaces have different channel semantics and numerical ranges. For example, in RGB space, the three channels represent the intensity of the three primary colors (red, green, and blue), with a typical value range of 0 to 255; in YUV space, the Y channel represents luminance information, and the U and V channels represent chrominance information. If the first image data is already in YUV format output by the ISP module, its initial color space is YUV space; if it is RAW data directly acquired from the camera, it may need to be converted to RGB space using a preset method before subsequent operations.

[0104] S2412: Convert the first image data from the initial color space to the color-opposite space to obtain the converted image data.

[0105] The Color Opposites (LAB) color space is a color representation model based on the characteristics of human visual perception. Its color representation is decomposed into three independent dimensions: the L channel represents lightness, ranging from 0 to 100, corresponding to pure black to pure white; the A channel represents the opposite color dimension from green to red, with negative values ​​leaning towards green and positive values ​​towards red; and the B channel represents the opposite color dimension from blue to yellow, with negative values ​​leaning towards blue and positive values ​​leaning towards yellow. Compared to the coupled relationship between the three color channels in the RGB space, lightness and color information are separated in the LAB space. This means that adjusting colors in the LAB space will not affect the lightness component of the image, thus avoiding additional lightness distortion introduced by compensation operations.

[0106] The first image data is converted from the initial color space (such as RGB or YUV) to the LAB space to obtain the converted image data. The converted image data carries the brightness and color information of the original image in the L, A, and B channels, respectively, to facilitate subsequent targeted image parameter compensation.

[0107] S2413: Based on the compensation coefficient, perform image parameter compensation on the transformed image data in the color-opposites space to obtain the compensated transformed image data.

[0108] Based on the compensation coefficients, specifically the first or second compensation coefficients determined in the preceding steps, the target offsets required for the A and B channels in the LAB color space can be calculated according to the target white balance parameters they contain (first and second target white balance coefficients, or third and fourth target white balance coefficients). This allows for the addition of the corresponding offsets to the A and B channel values ​​of each pixel in the converted image data within the LAB color space to perform image parameter compensation. During this compensation process, the L channel remains completely unchanged, ensuring that the compensation operation does not alter the image's brightness distribution.

[0109] S2414: Convert the compensated transformed image data from the color-opposite space to the initial color space to obtain the first target image data.

[0110] After the compensation operation is completed in the LAB space, the image data needs to be converted back from the LAB space to the initial color space (such as YUV or RGB) to obtain the first target image data, so that the subsequent AVM rendering module can render the compensated first target image data normally.

[0111] The method provided in this disclosure converts image data to the LAB color space for compensation and adjustment, corrects only the color dimension, and retains the brightness information of the original image data, thereby avoiding the introduction of brightness shift problems during image parameter compensation and improving the visual consistency of multi-camera panoramic images after compensation.

[0112] Figure 9 This is a schematic diagram of the process for determining the compensation coefficient of the third image scene in step S230, provided by an exemplary embodiment of this disclosure.

[0113] like Figure 9 As shown, when the vehicle is in the third image scene (a complex scene with large color temperature differences), the process of determining the compensation coefficient corresponding to the first image data in step S230 may include the following steps: S901: In response to the vehicle being in a third image scene, determine the front image data and rear image data of the vehicle based on the first image data.

[0114] In the third image scene, due to the rich colors and significant differences in white balance parameters between cameras, it is necessary to adjust the image parameters to different degrees for different spatial areas. At this time, the front image data collected by the front-view camera and the rear image data collected by the rear-view camera can be separated from the first image data, so that the front image data and the rear image data can be separately calculated and compensated independently.

[0115] S902: The front image data and the rear image data are respectively stitched with the second image data to obtain the front stitched image data and the rear stitched image data respectively.

[0116] To calculate the compensation coefficients corresponding to the front and rear image data respectively, the front and rear image data need to be stitched together with the second image data acquired by the second camera to obtain front stitched image data and rear stitched image data respectively. The front stitched image data is the image data obtained by stitching the front image data with the second image data, and the rear stitched image data is the image data obtained by stitching the rear image data with the second image data.

[0117] In one implementation, the stitching method can be the same as the formal AVM stitching, using perspective transformation stitching or overlapping area fusion stitching, to ensure that the stitched image data can truly reflect the spatial adjacency relationship of each image in the actual panoramic view.

[0118] S903: Determine the front compensation coefficient of the front image data based on the difference between the mean pixel value and the difference between the variance of pixel values ​​of the front image data and the front stitched image data.

[0119] After obtaining the front image data and the front stitched image data, the pixel mean and pixel value variance of the front image data and the pixel mean and pixel value variance of the front stitched image data can be calculated respectively. Then, the difference between the pixel mean and the difference between the pixel value variance can be calculated.

[0120] The difference in pixel mean values ​​represents the degree of shift between the brightness or color values ​​of the preceding image data and the brightness or color values ​​of the stitched preceding image data. The variance difference represents the degree of difference between the dispersion of color distribution in the preceding image data and the dispersion of color distribution in the stitched preceding image data. Based on these two sets of difference data, the corresponding preceding compensation coefficient can be determined. The preceding compensation coefficient is used to adjust the pixel value distribution of the preceding image data.

[0121] S904: Determine the rear compensation coefficient of the rear image data based on the difference between the mean pixel value and the difference between the variance of pixel values ​​of the rear image data and the rear stitched image data.

[0122] Similar to the calculation process of the front compensation coefficient, the rear compensation coefficient is also determined based on the difference between the pixel mean and the pixel value variance between the rear image data and the rear stitched image data. In this embodiment, the method of calculating the front compensation coefficient in S903 can be referred to to calculate the rear compensation coefficient with the rear image data and the rear stitched image data, which will not be repeated here.

[0123] It is important to note that because the shooting environment faced by rear-view cameras is usually quite different from that of front-view cameras (for example, the front of the vehicle is facing an open area ahead of the road while the rear is facing roadside buildings or green belts), the compensation direction and compensation magnitude required for rear-side image data are often different from those for front-side image data. Therefore, the rear-side compensation coefficient and the front-side compensation coefficient are two sets of independent compensation coefficients.

[0124] S905: Determine the third compensation coefficient based on the front compensation coefficient and the rear compensation coefficient.

[0125] After obtaining the front compensation coefficient and the back compensation coefficient respectively, the front compensation coefficient and the back compensation coefficient are integrated to obtain the third compensation coefficient. The third compensation coefficient retains all the compensation information of the front compensation coefficient and the back compensation coefficient. Based on the correspondence between the compensation coefficient and the image data, the front compensation coefficient is used to perform image parameter compensation on the front image data, and the back compensation coefficient is used to perform image parameter compensation on the back image data.

[0126] The method provided in this disclosure divides the front and rear spatial regions for complex color temperature difference scenes and determines the compensation coefficients respectively. It can adapt to the environmental color temperature differences of different shooting areas, thereby performing color compensation in different regions. This ensures the color consistency of images in different regions of the same panoramic view, while avoiding the problem of excessive or insufficient local compensation caused by global uniform compensation, thus improving the overall visual effect of the image data after panoramic stitching.

[0127] Figure 10 This is a detailed flowchart illustrating step S902 of the image stitching process provided in an exemplary embodiment of this disclosure.

[0128] like Figure 10 As shown above, in the above Figure 9 Based on the illustrated embodiment, step S902, which involves stitching the front image data and the rear image data with the second image data, may include the following steps: S9021: Based on the second image data, determine the left-side image data and the right-side image data of the vehicle.

[0129] The second image data includes all image data captured by the second cameras (i.e., the left and right cameras). Before performing the stitching operation, it is necessary to separate the left image data captured separately by the left camera and the right image data captured separately by the right camera from the second image data.

[0130] S9022: The front image data is stitched together with the left image data and the right image data respectively to obtain the first front stitched image data and the second front stitched image data. The rear image data is stitched together with the left image data and the right image data respectively to obtain the first rear stitched image data and the second rear stitched image data.

[0131] After obtaining the left and right image data, four stitching operations can be performed. The first stitching combines the front image data with the left image data to obtain the first front-side stitched image data. The second stitching combines the front image data with the right image data to obtain the second front-side stitched image data. The third stitching combines the rear image data with the left image data to obtain the first rear-side stitched image data. The fourth stitching combines the rear image data with the right image data to obtain the second rear-side stitched image data. Through these four stitching operations, both the front and rear image data obtain paired samples for comparative analysis with the left and right references, respectively.

[0132] S9023: Obtain front-side stitched image data based on the first front-side stitched image data and the second front-side stitched image data, and obtain rear-side stitched image data based on the first rear-side stitched image data and the second rear-side stitched image data.

[0133] After obtaining the stitched image data from two front-side stitches and two rear-side stitches, the four stitched image data need to be organized and categorized. The first and second front-side stitched image data together constitute the first stitching reference set for the front-side image data. By stitching together the first stitching reference set, the front-side stitched image data can be obtained. Similarly, the first and second rear-side stitched image data together constitute the second stitching reference set for the rear-side image data. By stitching together the second stitching reference set, the rear-side stitched image data can be obtained.

[0134] The method provided in this disclosure splits and stitches the front and rear images with the left and right images respectively to obtain stitched image data. This provides an accurate comparison benchmark for subsequent calculation of the compensation coefficients of the front and rear sides, avoids interference from different shooting environments on the left and right sides, improves the accuracy of regional color compensation, and ensures the color consistency and naturalness of the whole image after panoramic stitching.

[0135] Figure 11 This is a detailed flowchart illustrating step S903 of the image stitching process provided in an exemplary embodiment of this disclosure.

[0136] like Figure 11 As shown above, in the above Figure 9 Based on the illustrated embodiment, step S903, which determines the front compensation coefficient of the front image data according to the difference between the mean pixel value and the difference between the pixel value variance of the front image data and the front stitched image data, may include the following steps: S9031: Determine the difference between the mean pixel value and the variance of the pixel value between the front image data and the first front stitched image data, and determine the difference between the mean pixel value and the variance of the pixel value between the front image data and the second front stitched image data.

[0137] To calculate the first and second front-side compensation coefficients required for the front-side image data, it is necessary to quantify the statistical differences between the front-side image data and the two front-side stitched image data. For the first front-side stitched image data (front + left stitched), within the overlapping spatial region with the front-side image data, the difference in pixel mean and pixel value variance across each color channel is calculated. This set of differences reflects the degree of color deviation of the front-side image data relative to the "front + left" combined scene. Similarly, for the second front-side stitched image data (front + right stitched), the same difference in pixel mean and pixel value variance is calculated within the overlapping spatial region with the front-side image data. This set of differences reflects the degree of color deviation of the front-side image data relative to the "front + right" combined scene. Since the left and right image data themselves may have color differences, the degree of deviation of the front-side image data relative to these two is usually different, facilitating the separate calculation of two sets of compensation coefficients.

[0138] S9032: Determine a first front-side compensation coefficient based on the difference between the pixel mean and the pixel value variance of the front-side image data and the first front-side stitched image data; and determine a second front-side compensation coefficient based on the difference between the pixel mean and the pixel value variance of the front-side image data and the second front-side stitched image data.

[0139] After obtaining the statistical feature differences between the front image data and the two front stitched image data, two front compensation coefficients can be constructed, including a first front compensation coefficient and a second front compensation coefficient. The first front compensation coefficient is obtained based on the difference between the front image data and the first front stitched image data, and it describes the amount and direction of compensation required to coordinate the image parameters of the front image data with the left image data. The second front compensation coefficient is obtained based on the difference between the front image data and the second front stitched image data, and it describes the amount and direction of compensation required to coordinate the image parameters of the front image data with the right image data.

[0140] In one implementation, the specific calculation of each front-side compensation coefficient can employ a linear mapping formula. This involves using the difference in pixel mean as the translation amount of the color channel and the difference in pixel value variance as the scaling factor of the color channel, both of which are applied to the pixel values ​​of the front-side image data. The resulting first and second front-side compensation coefficients represent two different compensation directions, improving the accuracy of image parameter compensation for the front-side image data in the third image scene.

[0141] The method provided in this disclosure calculates two front-side compensation coefficients relative to the left and right stitched images, respectively. It can match corresponding compensation parameters for different stitching scenarios, solve the problem that a single compensation coefficient cannot adapt to the double-side stitching requirements when the front-side image data is stitched with the left and right side images at the same time, improve the color fusion effect after the front-side area and the left and right side areas are stitched, and make the overall color transition of the final panoramic image more natural and uniform.

[0142] Figure 12 This is a detailed flowchart illustrating step S904 of the image stitching process provided in an exemplary embodiment of this disclosure.

[0143] like Figure 12 As shown above, in the above Figure 11 Based on the illustrated embodiment, step S904, which determines the rear compensation coefficient of the rear image data according to the difference between the mean pixel value and the difference between the variance of pixel values ​​of the rear image data and the rear stitched image data, may include the following steps: S9041: Determine the difference between the mean pixel value and the variance of the pixel value between the rear image data and the first rear stitched image data, and determine the difference between the mean pixel value and the variance of the pixel value between the rear image data and the second rear stitched image data.

[0144] To calculate the first and second back-side compensation coefficients required for the back-side image data, it is necessary to quantify the statistical differences between the back-side image data and the two back-side stitched image data. For the first back-side stitched image data (back + left stitched), within the overlapping spatial region with the back-side image data, the difference in pixel mean and pixel value variance across each color channel is calculated. This set of differences reflects the degree of color deviation of the back-side image data relative to the "back + left" combined scene. Similarly, for the second back-side stitched image data (back + right stitched), the same difference in pixel mean and pixel value variance is calculated within the overlapping spatial region with the back-side image data. This set of differences reflects the degree of color deviation of the back-side image data relative to the "back + right" combined scene. Since the left and right image data themselves may have color differences, the degree of deviation of the back-side image data relative to these two is usually different, facilitating the separate calculation of two sets of compensation coefficients.

[0145] S9042: Determine a first rear-side compensation coefficient based on the difference between the pixel mean and the pixel value variance of the rear-side image data and the first rear-side stitched image data; and determine a second rear-side compensation coefficient based on the difference between the pixel mean and the pixel value variance of the rear-side image data and the second rear-side stitched image data.

[0146] After obtaining the statistical feature differences between the rear image data and the two rear stitched image data, two rear compensation coefficients can be constructed, including a first rear compensation coefficient and a second rear compensation coefficient. The first rear compensation coefficient is obtained based on the difference between the rear image data and the first rear stitched image data, and it describes the amount and direction of compensation required to harmonize the image parameters of the rear image data with the left image data. The second rear compensation coefficient is obtained based on the difference between the rear image data and the second rear stitched image data, and it describes the amount and direction of compensation required to harmonize the image parameters of the rear image data with the right image data.

[0147] The method provided in this disclosure calculates two rear compensation coefficients relative to the left and right stitched images, respectively. It can match corresponding compensation parameters for different stitching scenarios, solve the problem that a single compensation coefficient cannot adapt to the double-sided stitching requirements when the rear image data is stitched with the left and right images at the same time, improve the color fusion effect after the rear area and the left and right areas are stitched, and make the overall color transition of the final panoramic image more natural and uniform.

[0148] Figure 13 This is a schematic diagram of an exemplary embodiment of the present disclosure for image fusion based on a fusion mask.

[0149] like Figure 13 As shown above, in the above Figure 12 Based on the illustrated embodiment, step S240, which involves performing image parameter compensation on the first image data based on the third compensation coefficient, may include the following steps: S2431: Based on the first front compensation coefficient, perform first image parameter compensation on the front image data to obtain the first front image data.

[0150] After obtaining the first front-side compensation coefficient, it is applied to the front-side image data to perform the first round of image parameter compensation operation to obtain the first front-side image data. The process of performing the compensation operation can be referred to the aforementioned embodiment, and will not be repeated here.

[0151] S2432: Based on the second front compensation coefficient, perform second image parameter compensation on the front image data to obtain the second front image data.

[0152] After obtaining the second front-side compensation coefficient, it is applied to the front-side image data to perform the second round of image parameter compensation operation to obtain the second front-side image data. The process of performing the compensation operation can be found in the aforementioned embodiment, and will not be repeated here.

[0153] The first and second rounds of image parameter compensation operations can be executed in parallel or sequentially, depending on the actual computing resources and application scenario of the intelligent cockpit. The first and second front-side image data are two independent image data sets.

[0154] S2433: Based on the first rear-side compensation coefficient, perform first image parameter compensation on the rear-side image data to obtain the first rear-side image data.

[0155] For the rear image data, two independent compensation operations are also performed. The rear image data is compensated using the first rear compensation coefficient (with the left side as a reference) to obtain the first rear image data. This round of compensation makes the image parameters (color values, brightness) of the rear image data move closer to those of the left image data.

[0156] S2434: Based on the second rear-side compensation coefficient, perform second image parameter compensation on the rear-side image data to obtain the second rear-side image data.

[0157] In this embodiment of the disclosure, the rear image data is compensated by applying a second rear-side compensation coefficient (with the right side as a reference) to obtain second rear-side image data. This round of compensation causes the image parameters of the rear-side image data to converge with those of the right-side image data.

[0158] S2435: Get the first blend mask and the second blend mask.

[0159] The blending mask is a two-dimensional matrix that defines the spatial weight distribution. Its size is the same as the image data to be blended, and the value at each pixel position represents the blending weight of that pixel.

[0160] In one implementation, the color value weights of the first blending mask gradually decrease from left to right, while the color value weights of the second blending mask gradually decrease from right to left. Specifically, the first blending mask assigns a higher weight value (close to 1) to the left side of the image, gradually decreasing (close to 0) as the spatial position moves to the right. The second blending mask, in contrast, assigns a higher weight value to the right side of the image, gradually decreasing to the left. This gradual weight distribution ensures a smooth and natural transition between the two sets of compensation coefficients in the transition region near the blending boundary, avoiding abrupt stitching gaps.

[0161] In one implementation, the blending mask style can be a linear gradient, a cosine gradient, or other smooth curves, depending on the desired effect. In some examples, the gradient direction of the mask corresponds to the spatial adjacency relationship between the front / back image data and the left and right image data in the panoramic image. For example, the adjacent area between the front image data and the left image data uses the high-weight left portion of the first blending mask, and the adjacent area with the right image data uses the low-weight right portion of the first blending mask (corresponding to the high-weight portion of the second blending mask).

[0162] S2436: Based on the first fusion mask and the second fusion mask, fuse the first front image data and the second front image data, and fuse the first rear image data and the second rear image data to obtain the first target image data.

[0163] After obtaining the blending mask, the two sets of compensation results on the front and back sides can be blended separately. For the front image data, the first front image data and the second front image data are weighted and summed pixel by pixel according to the weights defined by the first and second blending masks. That is, the pixel values ​​of the first front image data (left-biased compensation result) are used more in the left area, the pixel values ​​of the second front image data (right-biased compensation result) are used more in the right area, and the pixel values ​​of the two are mixed proportionally in the middle transition area to obtain the front compensation result.

[0164] Similarly, for the rear image data, the first and second rear image data are weighted and summed pixel-by-pixel according to the weights defined by the first and second fusion masks to obtain the rear compensation result. Finally, the fused front and rear image data are merged to obtain the complete first target image data.

[0165] By using the smooth transition effect of the blending mask, the problem of color inconsistency on one side that may be caused by using a single compensation direction is eliminated, and the visual consistency after splicing is improved in scenes with complex color temperatures.

[0166] The method provided in this disclosure performs bilateral directional compensation on both the front and rear image data, and then uses a gradient blending mask to weightedly blend the compensation results twice. This method can adapt to scenarios where the front image is simultaneously stitched with the left and right images, taking into account the color fusion requirements of the stitching positions on both sides, improving the naturalness of the color transition after stitching the panoramic image data, and eliminating the sense of disjointed stitching.

[0167] Figure 14 This is a schematic diagram of the dynamic range large scene compensation process provided by an exemplary embodiment of this disclosure.

[0168] like Figure 14 As shown, after performing image parameter compensation on the first image data based on the compensation coefficient to obtain the first target image data, the method may further include the following steps: S2451: Based on the first image processing parameters, determine the first exposure parameters of the first camera, and based on the second image processing parameters, determine the second exposure parameters of the second camera.

[0169] In this embodiment, besides white balance parameters, exposure parameters (AE parameters) are also a crucial factor affecting the brightness consistency of images from different cameras. Each camera's exposure parameters include exposure time, analog gain (AGain), and digital gain (DGain). These three parameters collectively determine the overall brightness level of the image output by that camera. Under different lighting conditions, the automatic exposure algorithm of each camera independently adjusts these three parameters based on the brightness distribution of its respective image, which may result in differences in brightness baselines between the images. Therefore, after completing white balance-based color compensation, it is necessary to further detect and address the inconsistencies caused by exposure parameters.

[0170] S2452: Determine multiple second gain ratios based on the first exposure parameters and the second exposure parameters.

[0171] The second gain ratio is obtained by dividing the exposure parameters of different cameras using similar parameters. For four cameras, each has three exposure parameters. The ratios can be calculated separately between the exposure times, analog gains, and digital gains of different cameras, resulting in a set of multiple second gain ratios. The second gain ratio reflects the consistency of exposure across the cameras. When all second gain ratios are close to 1, it indicates that the exposure levels of the cameras are basically consistent; when the second gain ratios deviate significantly from 1, it indicates that there are significant brightness differences between the corresponding cameras.

[0172] S2453: In response to at least one second gain ratio being less than a preset third threshold, obtain a third fusion mask.

[0173] The third threshold is used to determine whether the differences in exposure parameters between the cameras reach a level requiring additional compensation. When at least one of the second gain ratios is less than the third threshold, it indicates that the exposure levels of some cameras are significantly lower (or significantly higher) than those of other cameras, meaning the current scene has a large dynamic range. In this case, a third fusion mask can be obtained, with color value weights gradually decreasing from top to bottom (i.e., higher weight at the top and lower weight at the bottom). In one scenario, this top-to-bottom gradient third fusion mask adapts to the natural brightness distribution characteristics of the sky area (usually at the top, with higher brightness) and the ground area (usually at the bottom, with lower brightness) in the panoramic image data.

[0174] In some instances, when all second gain ratios are greater than or equal to a preset third threshold, it indicates that the exposure levels of each camera are basically consistent, and the current scene belongs to the type with a small dynamic range. In this case, there is no need to obtain a third fusion mask for additional compensation, and the aforementioned first target image data is directly used as the final output. Since the brightness difference between different areas is small in scenes with a small dynamic range, the first target image data can already meet the brightness consistency requirement, eliminating the need for additional exposure compensation operations and helping to reduce computational power consumption.

[0175] S2454: Perform image parameter compensation on the first target image data using the third fusion mask to obtain the second target image data.

[0176] After obtaining the third fusion mask, it is applied to the first target image data to perform a second round of compensation operations. Specifically, a brightness adjustment coefficient field is calculated based on the differences in exposure parameters between the cameras. Then, the third fusion mask is used to spatially modulate this coefficient field, so that a smaller adjustment amount or no adjustment is applied to the upper region of the image to preserve the details of the highlight areas, while a larger adjustment amount is applied to the lower region of the image to effectively eliminate brightness inconsistencies.

[0177] The compensation result after image parameter compensation by the third fusion mask is the second target image data. While maintaining reasonable brightness levels in various regions in scenes with a large dynamic range, it effectively reduces the residual brightness differences between images from different cameras.

[0178] The method provided in this disclosure, for scenes with a large dynamic range, uses a third fusion mask with a gradient at the top and bottom to handle the brightness inconsistency caused by differences in exposure parameters. It can adapt to the brightness distribution characteristics of the panoramic image, and effectively eliminate residual brightness differences between images from different cameras while preserving the original brightness levels of different areas and protecting the details of the highlight areas, thereby improving the brightness consistency and naturalness of the panoramic image data.

[0179] In some examples, after performing image parameter compensation on the first image data based on the compensation coefficient to obtain the first target image data, the compensation coefficient can be applied to the image processing flow of the vehicle's central processing module, wherein the image processing flow is used to directly perform image parameter compensation on the first image data based on the compensation coefficient.

[0180] Specifically, in this embodiment of the disclosure, the vehicle's central processing module (such as a cockpit processor or a cockpit-driver integrated processor) may also integrate ISP processing capabilities in addition to undertaking the aforementioned compensation calculation and image compensation tasks. When the central processing module has a built-in ISP module, the previously calculated compensation coefficients can be directly placed into the ISP's image processing flow, so that the ISP module can complete the image parameter compensation operation simultaneously while performing conventional ISP processing (including noise reduction, color interpolation, color correction, gamma correction, tone mapping, etc.) on the original image data to be processed.

[0181] In this way, the compensation operation will occur in the early stages of image processing. Subsequent modules such as color correction matrix (CCM) correction, gamma curve correction, and tone mapping will be processed based on the first target image data that has already been compensated and corrected, thereby avoiding these subsequent modules from introducing or amplifying the brightness and color differences between cameras again.

[0182] The method provided in this disclosure embeds the pre-calculated compensation coefficient into the image processing flow of the built-in ISP of the central processing module, thereby deeply integrating the compensation operation with the original image processing flow, simplifying the image processing steps, and enabling subsequent image processing steps to be processed based on the compensated first target image data, reducing additional computing power consumption and improving the utilization efficiency of the vehicle's computing power resources.

[0183] In some examples, after performing image parameter compensation on the first image data based on the compensation coefficient to obtain the first target image data, it is also possible to detect whether the first image sensor of the first camera and the second image sensor of the second camera support the write-back function.

[0184] Specifically, an image sensor is a photoelectric conversion device located at the front end of a camera, responsible for converting light signals captured by the lens into electrical signals. In addition to its basic photoelectric conversion function, image sensors often support various programmable control interfaces, allowing external processors to dynamically configure and adjust multiple operating parameters of the sensor. Among these, the parameter write-back function means that the processor can rewrite the calculated new parameter values ​​into the sensor's configuration register, enabling the sensor to use the updated parameters in subsequent image acquisitions.

[0185] However, not all image sensors support this write-back function; it depends on the sensor model and firmware version. Therefore, before attempting sensor write-back, it is necessary to first check whether the image sensor equipped in each camera has the hardware support for write-back. This can be done by querying the sensor's device identifier register to confirm the model and version, or by attempting to send test write-back commands to verify whether they are executed correctly.

[0186] Once it is confirmed that the image sensors of both the first and second cameras support the write-back function, the previously calculated compensation coefficients can be converted into a parameter format acceptable to the sensor and written into the corresponding configuration registers of each sensor through the sensor's control interface (such as I2C bus or SPI bus).

[0187] The parameters written can include the compensated and adjusted target white balance gain value, target exposure parameters, etc. After successful writing, each sensor will directly use the updated parameters for photoelectric conversion and raw data output in subsequent image acquisition frames, so that the image data output from the source already has good color and brightness consistency.

[0188] The method provided in this disclosure, by writing the compensation coefficient into the image sensor configuration register that supports write-back function, can complete the consistency correction of brightness and color from the source of image acquisition, without having to repeat the calculation of compensation coefficient and image compensation operation in each subsequent acquisition frame, thereby reducing the computing power occupation of the back-end processing module and improving the system's operational stability.

[0189] Exemplary device Figure 15 This is a structural diagram of an image compensation device provided in an exemplary embodiment of the present disclosure.

[0190] The image compensation device 1500 can be applied to electronic devices, including a central processing module 1501 for acquiring first image data captured by a first camera, first image processing parameters of the first camera, second image data captured by a second camera, and second image processing parameters of the second camera, wherein the first camera and the second camera are set at different positions on the vehicle. A scene determination module 1502 is used to determine the image scene in which the vehicle is located based on the first image data, the first image processing parameters, the second image data, and the second image processing parameters. A compensation calculation module 1503 is used to determine the compensation coefficient corresponding to the first image data based on the image scene, the first image processing parameters, the second image processing parameters, the first image data, and the second image data. An image compensation module 1504 is used to perform image parameter compensation on the first image data based on the compensation coefficient to obtain first target image data.

[0191] The exemplary embodiment of this device can also execute all embodiments of the upload exemplary method through the above device structure (central processing module 1501, scene determination module 1502, compensation calculation module 1503 and image compensation module 1504). The corresponding beneficial technical effects can be referred to the corresponding beneficial technical effects in the above exemplary method section, and will not be repeated here.

[0192] Exemplary electronic devices Figure 16 This is a structural diagram of an electronic device provided as an exemplary embodiment of the present disclosure. For example... Figure 16 As shown, the electronic device 1600 includes at least one processor 1601 and a memory 1602.

[0193] The processor 1601 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 1600 to perform desired functions.

[0194] The memory 1602 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 1601 may execute one or more computer program instructions to implement the image compensation methods and / or other desired functions of the various embodiments of this disclosure described above.

[0195] In one example, the electronic device 1600 may also include an input device 1603 and an output device 1604, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).

[0196] The input device 1603 may also include, for example, a keyboard, a mouse, etc.

[0197] The output device 1604 can output various information to the outside, including, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices.

[0198] Of course, for the sake of simplicity, Figure 16 Only some of the components of the electronic device 1600 relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 1600 may include any other suitable components depending on the specific application.

[0199] Exemplary computer program products and computer-readable storage media In addition to the methods and apparatus described above, embodiments of this disclosure may also provide a computer program product, including computer program instructions that, when executed by a processor, cause the processor to perform the steps of the image compensation methods of the various embodiments of this disclosure described in the "Exemplary Methods" section above.

[0200] Computer program products can be written in any combination of one or more programming languages ​​to perform the operations of embodiments of this disclosure. These programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0201] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps in the image compensation methods of the various embodiments of this disclosure described in the "Exemplary Methods" section above.

[0202] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, but is not limited to, systems, apparatuses, or devices that are electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0203] The basic principles of this disclosure have been described above with reference to specific embodiments. However, the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.

[0204] Various modifications and variations can be made to this disclosure without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this disclosure and their equivalents, this disclosure is also intended to include such modifications and variations.

Claims

1. An image compensation method, comprising: The system acquires first image data captured by a first camera, first image processing parameters of the first camera, second image data captured by a second camera, and second image processing parameters of the second camera, wherein the first camera and the second camera are set at different locations in the vehicle. Based on the first image data, the first image processing parameters, the second image data, and the second image processing parameters, the image scene in which the vehicle is located is determined; Based on the image scene, the first image processing parameter, the second image processing parameter, the first image data, and the second image data, determine the compensation coefficient corresponding to the first image data; Based on the compensation coefficient, image parameter compensation is performed on the first image data to obtain the first target image data.

2. The image compensation method according to claim 1, wherein, Determining the image scene in which the vehicle is located based on the first image data, the first image processing parameters, the second image data, and the second image processing parameters includes: Based on the first image processing parameters and the second image processing parameters, a plurality of first gain ratios are determined; By stitching together the first image data and the second image data, a panoramic image data is obtained. Calculate the variance of the first pixel value of the panoramic image data; The image scene in which the vehicle is located is determined based on the plurality of first gain ratios and the variance of the first pixel value.

3. The image compensation method according to claim 2, wherein, The first camera is located on the front and rear sides of the vehicle, and the second camera is located on the left and right sides of the vehicle. The determination of multiple first gain ratios based on the first image processing parameters and the second image processing parameters includes: Based on the first image processing parameters, a first set of white balance parameters and a second set of white balance parameters are determined. The first set of white balance parameters is the white balance parameter of the first camera on the front side of the vehicle, and the second set of white balance parameters is the white balance parameter of the first camera on the rear side of the vehicle. Based on the second image processing parameters, a third set of white balance parameters and a fourth set of white balance parameters are determined. The third set of white balance parameters is the white balance parameter of the second camera on the left side of the vehicle, and the fourth set of white balance parameters is the white balance parameter of the second camera on the right side of the vehicle. Based on the first set of white balance parameters, the second set of white balance parameters, the third set of white balance parameters, and the fourth set of white balance parameters, multiple first gain ratios are determined.

4. The image compensation method according to claim 3, wherein, The determination of multiple first gain ratios based on the first set of white balance parameters, the second set of white balance parameters, the third set of white balance parameters, and the fourth set of white balance parameters includes: Obtain the first white balance parameter and the second white balance parameter corresponding to the first set of white balance parameters and the second set of white balance parameters respectively. The first white balance parameter is the red channel parameter of the first camera, and the second white balance parameter is the blue channel parameter of the first camera. Obtain the third white balance parameter and the fourth white balance parameter corresponding to the third set of white balance parameters and the fourth set of white balance parameters respectively. The third white balance parameter is the red channel parameter of the second camera, and the fourth white balance parameter is the blue channel parameter of the second camera. The plurality of first gain ratios are determined based on the ratio of the first white balance parameter to the third white balance parameter, the ratio of the first white balance parameter to the fourth white balance parameter, the ratio of the second white balance parameter to the third white balance parameter, and the ratio of the second white balance parameter to the fourth white balance parameter.

5. The image compensation method according to claim 4, wherein, Determining the image scene of the vehicle based on the plurality of first gain ratios and the variance of the first pixel value includes: Obtain the absolute value of the difference between the plurality of first gain ratios and 1 respectively; In response to at least one of the absolute values ​​of the difference being greater than a preset first threshold and the variance of the first pixel value being less than a preset second threshold, the first image scene in which the vehicle is located is determined. In response to the absolute value of all the differences being less than a preset first threshold and the variance of the first pixel value being greater than a preset second threshold, the second image scene in which the vehicle is located is determined. In response to at least one of the absolute values ​​of the difference being greater than a preset first threshold and the variance of the first pixel value being greater than a preset second threshold, the third image scene in which the vehicle is located is determined.

6. The image compensation method according to claim 5, wherein, The step of determining the compensation coefficient corresponding to the first image data based on the image scene, the first image processing parameters, the second image processing parameters, the first image data, and the second image data includes: In response to the vehicle being in the first image scene, a first target white balance coefficient that appears most frequently is determined among the first white balance parameter and the third white balance parameter, and a second target white balance coefficient that appears most frequently is determined among the second white balance parameter and the fourth white balance parameter; Based on the first target white balance coefficient and the second target white balance coefficient, a first compensation coefficient is determined.

7. The image compensation method according to claim 5, wherein, The step of determining the compensation coefficient corresponding to the first image data based on the image scene, the first image processing parameters, the second image processing parameters, the first image data, and the second image data includes: In response to the vehicle being in the second image scene, the average value of the first white balance parameter and the third white balance parameter is calculated to obtain the third target white balance coefficient, and the average value of the second white balance parameter and the fourth white balance parameter is calculated to obtain the fourth target white balance coefficient; The second compensation coefficient is determined based on the third target white balance coefficient and the fourth target white balance coefficient.

8. The image compensation method according to claim 6 or 7, wherein, The step of performing image parameter compensation on the first image data based on the compensation coefficient to obtain the first target image data includes: Determine the initial color space of the first image data; The first image data is converted from the initial color space to the color-opposite space to obtain the converted image data. Based on the compensation coefficient, image parameter compensation is performed on the converted image data in the color-opposition space to obtain the compensated converted image data. The compensated converted image data is converted from the color-opposites space to the initial color space to obtain the first target image data.

9. The image compensation method according to claim 5, wherein, Based on the image scene, the first image processing parameters, the second image processing parameters, the first image data, and the second image data, the compensation coefficient corresponding to the first image data is determined, including: In response to the vehicle being in the third image scene, front image data and rear image data of the vehicle are determined based on the first image data; The front image data and the rear image data are respectively stitched with the second image data to obtain front stitched image data and rear stitched image data respectively; The front compensation coefficient of the front image data is determined based on the difference between the mean pixel value and the difference between the variance of pixel value between the front image data and the front stitched image data. The rear compensation coefficient of the rear image data is determined based on the difference between the mean pixel value and the difference between the variance of pixel value between the rear image data and the rear stitched image data. A third compensation coefficient is determined based on the front compensation coefficient and the rear compensation coefficient.

10. The image compensation method according to claim 9, wherein, The step of stitching the front image data and the rear image data with the second image data respectively to obtain front stitched image data and rear stitched image data respectively includes: Based on the second image data, determine the left-side image data and the right-side image data of the vehicle; The front image data is stitched together with the left image data and the right image data to obtain the first front stitched image data and the second front stitched image data. The rear image data is stitched together with the left image data and the right image data to obtain the first rear stitched image data and the second rear stitched image data. Based on the first front-side stitched image data and the second front-side stitched image data, front-side stitched image data is obtained; and based on the first rear-side stitched image data and the second rear-side stitched image data, rear-side stitched image data is obtained.

11. The image compensation method according to claim 10, wherein, The step of determining the front compensation coefficient of the front image data based on the difference between the pixel mean and the pixel value variance of the front image data and the front stitched image data includes: Determine the difference between the mean pixel value and the variance of the pixel value between the front image data and the first front stitched image data, and determine the difference between the mean pixel value and the variance of the pixel value between the front image data and the second front stitched image data; A first front-side compensation coefficient is determined based on the difference between the mean pixel value and the difference between the first front-side stitched image data and the first front-side stitched image data. A second front-side compensation coefficient is determined based on the difference between the mean pixel value and the difference between the second front-side stitched image data and the first front-side stitched image data.

12. The image compensation method according to claim 11, wherein, Based on the difference between the mean pixel value and the difference between the variance pixel value of the rear image data and the rear stitched image data, the rear compensation coefficient of the rear image data is determined, including: Determine the difference between the mean pixel value and the difference between the mean pixel value and the variance pixel value of the rear image data and the first rear stitched image data, and determine the difference between the mean pixel value and the variance pixel value of the rear image data and the second rear stitched image data; A first rear-side compensation coefficient is determined based on the difference between the mean pixel value and the difference between the mean pixel value and the variance pixel value of the rear-side image data and the first rear-side stitched image data. A second rear-side compensation coefficient is determined based on the difference between the mean pixel value and the variance pixel value of the rear-side image data and the second rear-side stitched image data.

13. The image compensation method according to claim 12, wherein, Based on the compensation coefficient, image parameter compensation is performed on the first image data to obtain the first target image data, including: Based on the first front-side compensation coefficient, the first image parameter compensation is performed on the front-side image data to obtain the first front-side image data. Based on the second front-side compensation coefficient, the second image parameter compensation is performed on the front-side image data to obtain the second front-side image data. Based on the first rear-side compensation coefficient, the first image parameter compensation is performed on the rear-side image data to obtain the first rear-side image data. Based on the second rear-side compensation coefficient, the second image parameter compensation is performed on the rear-side image data to obtain the second rear-side image data. Obtain a first blending mask and a second blending mask. The color value weights of the first blending mask gradually decrease from left to right, and the color value weights of the second blending mask gradually decrease from right to left. Based on the first fusion mask and the second fusion mask, the first front image data and the second front image data are fused together, and the first rear image data and the second rear image data are fused together to obtain the first target image data.

14. The image compensation method according to claim 1, wherein, After the step of performing image parameter compensation on the first image data based on the compensation coefficient to obtain the first target image data, the method further includes: Based on the first image processing parameters, a first exposure parameter of the first camera is determined, and based on the second image processing parameters, a second exposure parameter of the second camera is determined; Multiple second gain ratios are determined based on the first exposure parameters and the second exposure parameters; In response to at least one of the second gain ratios being less than a preset third threshold, a third blending mask is obtained, wherein the color value weights of the third blending mask gradually decrease from top to bottom; The third fusion mask is used to perform image parameter compensation on the first target image data to obtain the second target image data.

15. The image compensation method according to claim 1, wherein, After performing image parameter compensation on the first image data based on the compensation coefficient to obtain the first target image data, the process further includes: The compensation coefficient is applied to the image processing flow of the vehicle's central processing module, and the image processing flow is used to directly perform image parameter compensation on the first image data based on the compensation coefficient.

16. The image compensation method according to claim 1, wherein, After performing image parameter compensation on the first image data based on the compensation coefficient to obtain the first target image data, the process further includes: Detect whether the first image sensor of the first camera and the second image sensor of the second camera support the write-back function; In response to the fact that both the first image sensor and the second image sensor support the write-back function, the compensation coefficient is applied to the first image sensor and the second image sensor.

17. An image compensation device, comprising: The central processing module is used to acquire first image data captured by the first camera, first image processing parameters of the first camera, second image data captured by the second camera, and second image processing parameters of the second camera, wherein the first camera and the second camera are set at different positions in the vehicle. The scene determination module is used to determine the image scene in which the vehicle is located based on the first image data, the first image processing parameters, the second image data, and the second image processing parameters; The compensation calculation module is used to determine the compensation coefficient corresponding to the first image data based on the image scene, the first image processing parameters, the second image processing parameters, the first image data, and the second image data. The image compensation module is used to perform image parameter compensation on the first image data based on the compensation coefficient to obtain the first target image data.

18. A computer-readable storage medium storing a computer program for performing the image compensation method as described in any one of claims 1-16.

19. An electronic device comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the image compensation method as described in any one of claims 1-16.