Image generation method and related apparatus

CN121908142BActive Publication Date: 2026-07-14深圳市欧冶半导体有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
深圳市欧冶半导体有限公司
Filing Date
2026-03-24
Publication Date
2026-07-14

Smart Images

  • Figure CN121908142B_ABST
    Figure CN121908142B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a kind of image generation method and related device, method is applied to the processor of vehicle electronic rearview mirror system, comprising: obtain the first long frame image and first short frame image collected by image acquisition equipment;According to the first long frame image and first short frame image fusion obtained by first synthesis image according to preset exposure ratio;Determine the first brightness distribution histogram data of first short frame image and the second brightness distribution histogram data of first synthesis image;According to first brightness distribution histogram data, second brightness distribution histogram data, the first exposure time of first long frame image, the second exposure time of first short frame image and historical exposure data determine target exposure ratio;According to target exposure ratio, first long frame image and first short frame image fusion generation target synthesis image are generated.The present application can be adaptively regulated exposure ratio of image frame in different dynamic range scene, improve the imaging quality of streaming media rearview mirror.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an image generation method and related apparatus. Background Technology

[0002] In-vehicle streaming rearview mirror systems typically consist of an image sensor, an image processor, and a display screen. During vehicle operation, complex scenarios requiring high dynamic range (entering and exiting tunnels, direct high beams at night, backlighting) and low dynamic range (overcast skies, inside tunnels, unlit nighttime) must be addressed. To capture details in both bright and dark areas, the image sensor needs to output two or more frames with different exposure durations. These multiple frames are then combined using HDR (High-Resolution Mode) to form a single image frame for display on the in-vehicle streaming rearview mirror's screen. It is known that the HDR synthesis process relies on the exposure ratio, but there is a trade-off between exposure ratio and image quality: a larger exposure ratio results in a larger dynamic range in the synthesized HDR image, but also increases noise after LTM (Light Detection and Modulation) enhancement; conversely, a smaller exposure ratio results in a smaller dynamic range in the synthesized HDR image, requiring less LTM enhancement and thus less noise.

[0003] Existing in-vehicle streaming rearview mirror systems cannot adaptively adjust the exposure ratio of image frames under different dynamic range scenarios. They only use a fixed exposure duration ratio setting, which cannot achieve a balance between dynamic range and noise control, ultimately affecting the overall quality of the images displayed by the streaming rearview mirror. Summary of the Invention

[0004] In view of this, embodiments of this application provide an image generation method and related apparatus, which aims to dynamically calculate a target exposure ratio based on two frames of images with different exposure durations output in real time by an image sensor, according to the brightness distribution histogram data corresponding to the two frames of images and the different exposure durations, combined with historical exposure data, and to synthesize the two image frames into a target composite image based on the target exposure ratio, so as to achieve accurate fusion of bright and dark area details and effectively improve the imaging quality and driving safety of streaming media rearview mirrors.

[0005] In a first aspect, embodiments of this application provide an image generation method applied to a processor of a vehicle electronic rearview mirror system. The vehicle electronic rearview mirror system further includes an image acquisition device and a display screen of a streaming media rearview mirror installed inside the vehicle. The processor is connected to both the image acquisition device and the display screen. The method includes:

[0006] The image acquisition device acquires a first long frame image and a first short frame image in the current acquisition operation, wherein the exposure duration of the long frame image is greater than the exposure duration of the short frame image;

[0007] The first long frame image and the first short frame image are fused according to a preset exposure ratio to obtain a first composite image;

[0008] Determine the first brightness distribution histogram data corresponding to the first short frame image and the second brightness distribution histogram data corresponding to the first synthesized image;

[0009] The target exposure ratio is determined based on the first brightness distribution histogram data, the second brightness distribution histogram data, the first exposure duration of the first long frame image, the second exposure duration of the first short frame image, and historical exposure data.

[0010] The first long frame image and the first short frame image are fused according to the target exposure ratio to generate a target composite image for display on the display screen.

[0011] Secondly, this application also provides an image generation processing apparatus, applied to a processor of a vehicle electronic rearview mirror system. The vehicle electronic rearview mirror system further includes an image acquisition device and a display screen of a streaming media rearview mirror installed in the vehicle. The processor is connected to the image acquisition device and the display screen respectively. The apparatus includes an acquisition unit and a processing unit. The acquisition unit is used to acquire a first long frame image and a first short frame image acquired by the image acquisition device in the current acquisition operation, wherein the exposure duration of the long frame image is greater than the exposure duration of the short frame image.

[0012] The processing unit is configured to perform fusion processing on the first long frame image and the first short frame image according to a preset exposure ratio to obtain a first composite image; determine the first luminance distribution histogram data corresponding to the first short frame image and the second luminance distribution histogram data corresponding to the first composite image; determine a target exposure ratio based on the first luminance distribution histogram data, the second luminance distribution histogram data, the first exposure duration of the first long frame image, the second exposure duration of the first short frame image, and historical exposure data; and perform fusion processing on the first long frame image and the first short frame image according to the target exposure ratio to generate a target composite image for display on the display screen.

[0013] Thirdly, embodiments of this application provide an electronic device, including a processing module, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processing module, and the programs include instructions for performing the steps in the first aspect of embodiments of this application.

[0014] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in the first aspect of embodiments of this application.

[0015] Fifthly, embodiments of this application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the first aspect of embodiments of this application. The computer program product may be a software installation package.

[0016] As can be seen, through the image generation method and related apparatus provided in this application, the processor of the vehicle electronic rearview mirror system acquires a first long frame image and a first short frame image acquired by the image acquisition device in the current acquisition operation; performs fusion processing on the first long frame image and the first short frame image according to a preset exposure ratio to obtain a first composite image; determines the first brightness distribution histogram data corresponding to the first short frame image and the second brightness distribution histogram data corresponding to the first composite image; determines the target exposure ratio based on the first brightness distribution histogram data, the second brightness distribution histogram data, the first exposure time of the first long frame image, the second exposure time of the first short frame image, and historical exposure data; and performs fusion processing on the first long frame image and the first short frame image according to the target exposure ratio to generate a target composite image for display on the screen. Thus, compared to the existing in-vehicle streaming rearview mirror scheme that uses a fixed exposure time ratio to generate images, this application can adaptively adjust the exposure ratio of image frames under different dynamic range scenarios, dynamically calculate the target exposure ratio, and synthesize two image frames into a target composite image according to the target exposure ratio, thereby achieving precise fusion of bright and dark area details and effectively improving the imaging quality and driving safety of the streaming rearview mirror. Attached Figure Description

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

[0018] Figure 1 This is a schematic diagram of the architecture of a vehicle electronic rearview mirror system provided in an embodiment of this application;

[0019] Figure 2 This is a schematic flowchart of an image generation method provided in an embodiment of this application;

[0020] Figure 3 This is a schematic diagram of a process for determining the exposure duration of a target long frame, provided in an embodiment of this application.

[0021] Figure 4 This is a schematic diagram of a process for determining the exposure duration of a target short frame, provided in an embodiment of this application.

[0022] Figure 5 This is a schematic diagram of the overall process of an image generation method provided in an embodiment of this application;

[0023] Figure 6 This is a schematic diagram of a vehicle driving scenario provided in an embodiment of this application;

[0024] Figure 7 This is a schematic diagram of the display interface of a streaming media rearview mirror provided in an embodiment of this application;

[0025] Figure 8 This is a functional unit block diagram of an image generation processing device provided in an embodiment of this application;

[0026] Figure 9 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0028] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0029] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article indicates that the preceding and following related objects have an "or" relationship.

[0030] In this application's embodiments, "multiple" refers to two or more. In this application's embodiments, "connection" refers to various connection methods, such as direct or indirect connections, to achieve communication between devices; this application's embodiments do not impose any limitations on this.

[0031] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0032] The following describes the relevant content, concepts, meanings, technical issues, technical solutions, and beneficial effects involved in the embodiments of this application.

[0033] Existing in-vehicle streaming rearview mirror systems cannot adaptively adjust the exposure ratio of image frames under different dynamic range scenarios. They only use a fixed exposure duration ratio setting, which cannot achieve a balance between dynamic range and noise control, ultimately affecting the overall quality of the images displayed by the streaming rearview mirror.

[0034] To address the aforementioned issues, this application provides an image generation method and related apparatus. The method aims to dynamically calculate a target exposure ratio based on two frames of images with different exposure durations output in real-time from an image sensor. This is achieved by combining the brightness distribution histogram data of the two frames with the different exposure durations and historical exposure data, and then merging the two image frames into a target composite image. This results in precise fusion of details in both bright and dark areas, effectively improving the imaging quality and driving safety of the streaming media rearview mirror.

[0035] First, combined Figure 1 The vehicle electronic rearview mirror system in the embodiments of this application will be described. Figure 1 This is a schematic diagram of the architecture of a vehicle electronic rearview mirror system provided in an embodiment of this application, such as... Figure 1 As shown, the vehicle electronic rearview mirror system 100 includes: a processor 110, an image acquisition device 120, and a display screen 131 of a streaming media rearview mirror 130 installed in the vehicle. The processor 110 is connected to both the image acquisition device 120 and the display screen 131. Specifically, the processor 110 is electrically connected to the vehicle's main control system 140 to acquire information such as the vehicle's driving status and the driver's driving status in real time.

[0036] The image acquisition device 120 is the system's visual input module, with an image sensor 121 at its core. It is typically installed at the rear of the vehicle as a high-definition camera, but may also be deployed on either side of the front of the vehicle to replace traditional optical rearview mirrors. The image acquisition device 120 can continuously acquire two images with different exposure durations. The longer exposure frame is used to capture details in dark areas of the scene, while the shorter exposure frame is used to preserve details in bright areas, providing raw material for subsequent HDR fusion. This device transmits the raw image data to the processor 110 in real time via an interface and can receive target exposure duration commands from the processor 110, dynamically adjusting its own exposure parameters to adapt to different driving scene lighting changes.

[0037] The processor 110 is the core control and computing unit of the vehicle electronic rearview mirror system 100. It receives dual-exposure raw image data from the image acquisition device 120 and interacts with the vehicle's main control system 140 to obtain information such as vehicle driving status and driver operation. Specifically, the processor 110 executes core algorithms such as HDR weighted fusion of dual-exposure frames, histogram statistical analysis, and adaptive iterative optimization of exposure ratio to generate target synthetic image data that takes into account details in both bright and dark areas. It also sends the optimized target exposure duration to the image acquisition device 120 and updates the preset exposure ratio. In particular, the processor 110 is typically an automotive-grade system-on-a-chip (SOC) that integrates an image signal processor (ISP) to perform operations such as raw image preprocessing, exposure adjustment, and wide dynamic range fusion. The built-in computing unit supports real-time image processing and AI algorithms. It also has multiple interfaces to achieve stable connections with the image acquisition device 120, the display screen 131, and the vehicle bus.

[0038] The streaming rearview mirror 130 serves as the system's human-computer interaction and image output terminal. Its core component is the display screen 131 installed above the windshield inside the vehicle. This screen typically uses a high refresh rate, high contrast LCD or OLED display, offering excellent visibility in bright sunlight and low latency. The display screen 131 receives target composite image data output by the processor 110 and displays a real-time HDR-optimized rear road view, replacing the reflective imaging of traditional optical rearview mirrors and effectively eliminating blind spots. The display screen 131 also supports touch interaction, split-screen display, and overlay of driver assistance information, enabling the driver to clearly observe vehicles, road markings, and obstacles behind them, thus improving driving safety.

[0039] The vehicle main control system 140 serves as the interface between the vehicle's electronic rearview mirror system 100 and the entire vehicle. It connects to the processor 110 via CAN / LIN or other vehicle-mounted buses, transmitting real-time vehicle status information such as vehicle speed, turn signals, and light status, as well as driver commands, to the processor 110. Simultaneously, it can receive image optimization status and system operation data from the processor 110 for vehicle status monitoring and fault diagnosis, ensuring stable system operation in complex in-vehicle environments.

[0040] The aforementioned vehicle electronic rearview mirror system 100, through the deep collaboration of dual-exposure image acquisition, real-time HDR optimization, and adaptive exposure control, combined with the linkage of automotive-grade processor and high dynamic range display, can accurately preserve details in bright and dark areas of the image under various complex in-vehicle scenarios, significantly improving the imaging quality and driving safety of the streaming media rearview mirror.

[0041] The following is combined with Figure 2 The image generation method provided in the embodiments of this application will be further described below. Please refer to... Figure 2 , Figure 2 This is a flowchart illustrating an image generation method provided in an embodiment of this application, applied to... Figure 1 The processor 110 in the middle, such as Figure 2 As shown, the method includes the following steps:

[0042] Step S210: Obtain the first long frame image and the first short frame image acquired by the image acquisition device in the current acquisition operation, wherein the exposure duration of the long frame image is greater than the exposure duration of the short frame image.

[0043] In one possible embodiment, the image acquisition device acquires two frames of images with different exposure durations during each acquisition operation. The shorter frame image with a shorter exposure duration is used to capture details in bright areas of the scene, and the longer frame image with a longer exposure duration is used to capture details in dark areas of the scene.

[0044] Exposure time, or the duration for which an image sensor captures light, directly determines the amount of light entering the image. A long exposure results in a first long frame with ample light, enhancing brightness in dark areas and capturing more detail, making objects in dark areas like tunnels or unlit nighttime scenes clearly visible. However, this increases the risk of overexposure in bright areas. Conversely, a short exposure results in a first short frame with less light, suppressing overexposure and effectively preventing overexposure in strong light areas. This preserves the outlines and details of bright areas like high beams and backlighting, but it can cause underexposure in dark areas due to insufficient light. By differentiating exposure times, two frames can respectively carry effective information from bright and dark areas.

[0045] Step S220: The first long frame image and the first short frame image are fused according to a preset exposure ratio to obtain a first composite image.

[0046] The preset exposure ratio is a fixed value calibrated at the factory based on common automotive scenarios. It serves as the default fusion benchmark during system startup, ensuring real-time output of the first frame. The preset exposure ratio follows the logic of the ratio of "short exposure duration to long exposure duration," for example, it is calibrated to 0.1 or 0.2.

[0047] The fusion processing algorithm primarily utilizes HDR weighted fusion, whose core principle is to dynamically assign weights to pixels in long and short frames based on their exposure ratios. For each pixel in the image, the algorithm allocates higher weights to pixels in bright areas (shorter frames) to suppress overexposure and higher weights to pixels in dark areas (long frames) to preserve details, based on a preset exposure ratio. The resulting composite image is then output through pixel-level weighted fusion. This algorithm does not rely on continuous shooting; it achieves brightness balance solely through the complementary information of dual-exposure frames, making it suitable for the real-time requirements of automotive scenarios.

[0048] Step S230: Determine the first brightness distribution histogram data corresponding to the first short frame image and the second brightness distribution histogram data corresponding to the first synthesized image.

[0049] The brightness distribution histogram data is a quantitative statistical result of the brightness level distribution pattern of all pixels in an image. It contains two key elements: first, the brightness level range (e.g., 256 grayscale levels, covering the complete brightness range from pure black to pure white); and second, the percentage of pixels corresponding to each brightness level. This data can intuitively reflect the overall brightness level of the image and the pixel distribution ratio between bright and dark areas, serving as a key input parameter for adaptive exposure ratio optimization.

[0050] Specifically, determining the brightness distribution histogram data of the image frame needs to be done through the histogram statistics module built into the processor: For the first short frame image, the brightness values ​​of all its pixels are directly read, and the pixels are counted according to the preset 256 brightness level intervals. The number of pixels under each brightness level is counted to generate the first brightness distribution histogram data; For the first composite image, global tone mapping (GTM) processing needs to be performed first to compress the high bit width of the fused image data to a low bit width. Then, the same statistical logic is used to count the processed pixel brightness values ​​in different levels to finally obtain the second brightness distribution histogram data.

[0051] Step S240: Determine the target exposure ratio based on the first brightness distribution histogram data, the second brightness distribution histogram data, the first exposure duration of the first long frame image, the second exposure duration of the first short frame image, and historical exposure data.

[0052] The target exposure ratio is the ratio of the exposure duration of the short frame image to the exposure duration of the long frame image. Its principle is to quantify the difference in exposure duration between the two frames, providing a precise weighting basis for subsequent secondary HDR fusion. This ratio directly reflects the degree of functional complementarity between the two frames: the smaller the ratio, the greater the difference in exposure duration between the short and long frames, resulting in a wider dynamic range of the fused image, suitable for complex high dynamic scenes such as strong light and backlight; the larger the ratio, the smaller the difference in exposure duration between the short and long frames, resulting in a lower noise level of the fused image, suitable for low dynamic scenes such as cloudy days and tunnels.

[0053] In one possible embodiment, determining the target exposure ratio based on the first luminance distribution histogram data, the second luminance distribution histogram data, the first exposure duration of the first long frame image, the second exposure duration of the first short frame image, and historical exposure data includes: determining the target long frame exposure duration based on the second luminance distribution histogram data and the first exposure duration; determining the target short frame exposure duration based on the first luminance distribution histogram data, the historical exposure data, and the second exposure duration; and obtaining the target exposure ratio based on the ratio of the target short frame exposure duration to the target long frame exposure duration.

[0054] Specifically, the calculation of the target long frame exposure time is based on the second brightness distribution histogram data (the brightness distribution after GTM processing of the fused image). The principle is to make the overall average brightness of the fused image approach the preset first target exposure brightness. The core is to ensure the overall brightness and darkness balance of the fused image, adapting to the basic visual requirements of automotive scenarios. The calculation of the target short frame exposure time revolves around the first brightness distribution histogram data (the original brightness distribution of the short frame image) and historical exposure data. The core objective is to suppress overexposure in the bright areas of the short frame and make the brightness of the bright areas approach the preset second target exposure brightness. The introduction of historical exposure data can avoid frequent fluctuations in exposure time and improve the stability of details in the bright areas of the short frame.

[0055] Step S250: The first long frame image and the first short frame image are fused according to the target exposure ratio to generate a target composite image for display on the display screen.

[0056] The fusion process remains a pixel-level HDR weighted fusion algorithm, but the benchmark for weight allocation has been upgraded from "factory preset exposure ratio" to "target exposure ratio calculated in real time based on the current scene." The algorithm dynamically adjusts the pixel weight ratio between the first long frame and the first short frame based on the target exposure ratio: for dark area pixels, a higher weight is allocated to the long frame to enhance details; for bright area pixels, a higher weight is allocated to the short frame to suppress overexposure; and for pixels with intermediate brightness, a proportional weighting balance is applied, ultimately outputting an image with balanced details in both bright and dark areas.

[0057] Understandably, the initial fusion in step S220 is to quickly generate the first composite image for subsequent histogram statistics and exposure ratio calculation, with the core objective of ensuring the real-time performance of the first frame. The secondary fusion in step S250, however, is a precise fusion performed based on the optimized target exposure ratio, with the core objective of achieving optimal image quality for the current scene. The generated target composite image can adaptively match the lighting conditions of the current driving scene: in high-dynamic scenes (such as backlighting or direct high beams), the target exposure ratio is smaller, and the weight difference between long and short frames is large, resulting in a wider dynamic range for the fused image, clearly presenting details in both bright and shadow areas simultaneously; in low-dynamic scenes (such as overcast skies or tunnels), the target exposure ratio is larger, and the weight difference between long and short frames is smaller, resulting in a lower noise level and a cleaner image after fusion. The final output image is directly transmitted to the display screen, ensuring the driver receives a clear rear view.

[0058] In one possible embodiment, after fusing the first long frame image and the first short frame image according to the target exposure ratio to generate a target composite image for display on the screen, the method further includes: updating the preset exposure ratio according to the target exposure ratio; and sending the target short frame exposure duration and the target long frame exposure duration to the image acquisition device, so that the image acquisition device can acquire short frame images with the target short frame exposure duration and long frame images with the target long frame exposure duration respectively in the next acquisition operation.

[0059] Understandably, the target short frame exposure duration and target long frame exposure duration are the optimal acquisition parameters calculated based on the current scene brightness distribution. These parameters are then sent to the image acquisition device, allowing the next acquired double-exposure image frame to adapt to the current lighting scene from the source. By updating the preset exposure ratio using the target exposure ratio calculated from the current frame, the first fusion of the double-exposure image frames in the next acquisition cycle (corresponding to the fusion operation in step S220) will directly use the real-time calculated target exposure ratio, eliminating the need to iterate from a fixed value. This significantly improves the initial image quality of the first fusion of subsequent frames, avoiding inter-frame image quality fluctuations caused by fixed preset values, and ensuring the continuity and stability of the image presentation.

[0060] As can be seen, in this embodiment, after each acquisition and processing cycle, the system's fusion benchmark (exposure ratio) and acquisition parameters (target short frame exposure time and target long frame exposure time) will approach the optimal state of the current scene. After multiple frame iterations, it can stably adapt to various complex vehicle lighting scenarios, reducing hardware costs while ensuring the continuous clarity and stability of the streaming media rearview mirror image.

[0061] Please refer to details. Figure 3 , Figure 3 This is a schematic diagram of a process for determining the exposure duration of a target long frame, provided in an embodiment of this application. Figure 3 As shown, determining the target long frame exposure time based on the second brightness distribution histogram data and the first exposure time includes the following steps:

[0062] S301, determine the first exposure amount of the first long frame image based on the first exposure duration.

[0063] Exposure refers to the total amount of light received by the photosensitive unit of the image sensor during image acquisition. It is used to characterize the light sensitivity of the image sensor, and its magnitude directly determines the overall brightness of the acquired image.

[0064] Assuming the photosensitive parameters of the image sensor remain constant, exposure is positively correlated with exposure time: under the same lighting conditions and gain, the longer the exposure time, the more light the photosensitive unit receives, resulting in a higher exposure; conversely, the shorter the exposure time, the less light the photosensitive unit receives, resulting in a lower exposure. Generally, exposure can be considered as: Exposure = Exposure Time × Analog Gain × Digital Gain.

[0065] Specifically, the first exposure value of the first long frame image is determined based on the first exposure duration, including but not limited to the following methods: directly using the first exposure duration as the first exposure value of the first long frame image; or, obtaining the first exposure value using an exposure value calculation formula based on the first exposure duration and the current analog and digital gain of the image acquisition device; or, determining the corresponding first exposure value from the first exposure duration using a lookup table or linear conversion method based on a preset mapping relationship between exposure duration and exposure value. This application does not limit this method.

[0066] S302, determine the average brightness of the first synthesized image based on the second brightness distribution histogram data.

[0067] Among them, the average brightness of the image is a quantitative indicator that measures the overall brightness of the image. It reflects the arithmetic average level of the brightness values ​​of all pixels in the image and is the core basis for judging whether the image is too bright or too dark. It directly determines the direction of subsequent long frame exposure time adjustment.

[0068] Specifically, when calculating the average brightness of the first synthesized image based on the second brightness distribution histogram data, the two core parameters of the histogram are first extracted: brightness level. (i ranges from 0 to 255, corresponding to the grayscale range from pure black to pure white) and the number of pixels corresponding to each brightness level. Then, the average brightness of the image is calculated using a weighted average formula. The formula is shown below:

[0069] .

[0070] For example, assuming that in the second brightness distribution histogram of the first synthesized image, brightness level 50 corresponds to 10,000 pixels, brightness level 100 corresponds to 20,000 pixels, brightness level 150 corresponds to 10,000 pixels, and the remaining brightness levels have 0 pixels, then the total number of pixels is 10,000 + 20,000 + 10,000 = 40,000, and the average brightness of the image is ((50 × 10,000) + (100 × 20,000) + (150 × 10,000)) / 40,000 = 100, this value indicates that the overall brightness of the image is moderate.

[0071] S303, determine the absolute value of the first difference between the average brightness of the image and the preset first target exposure brightness.

[0072] Specifically, if the absolute value of the first difference is greater than the first preset threshold, then step S304 is executed; otherwise, step S305 is executed.

[0073] The preset first target exposure brightness is the optimal brightness threshold calibrated based on the needs of in-vehicle displays (e.g., set to 128 grayscale values), representing the most comfortable image brightness level for the human eye in driving scenarios.

[0074] Specifically, the absolute value of the first difference can represent two core pieces of information: one is the direction of the brightness deviation, where if the actual average brightness is higher than the threshold, the image is judged to be too bright, and if it is lower than the threshold, the image is judged to be too dark; the other is the magnitude of the brightness deviation, where subsequent exposure time adjustment is triggered only when the deviation value or deviation ratio exceeds the preset threshold, thus avoiding frequent adjustments caused by small fluctuations.

[0075] S304, if the absolute value of the first difference is greater than the first preset threshold, then the target long frame exposure duration is determined based on the average brightness of the image, the first target exposure brightness, and the first exposure amount.

[0076] In one possible embodiment, determining the target long frame exposure duration based on the average image brightness, the first target exposure brightness, and the first exposure amount includes: determining the second exposure amount required by the image acquisition device to acquire the second long frame image in the next acquisition operation according to a first preset relationship, wherein the first preset relationship characterizes the correlation between the exposure amount required for the next long frame image acquisition and the first exposure amount used in the current long frame image acquisition, the average image brightness, and the first target exposure brightness; performing a weighted summation of the first exposure amount and the second exposure amount according to a first preset weight and a second preset weight to obtain a corrected second exposure amount, wherein the sum of the first preset weight and the second preset weight is a first preset value; and determining the target long frame exposure duration based on the corrected second exposure amount.

[0077] It is understandable that the exposure of the image acquisition device is linearly correlated with the brightness of the original RAW data (the raw brightness signal directly output by the image sensor after light sensing, without brightness compression, color processing, or image enhancement, and only truly reflecting the amount of light received by the sensor). However, before performing brightness statistics on the image, global tone mapping (GTM) processing has been performed on the HDR-fused image. In this embodiment, square root operation is used to achieve approximate compression, so that the statistically obtained average image brightness and exposure are no longer in a simple linear relationship. Therefore, the square root relationship can be used to characterize the correlation between exposure and image brightness after tone mapping, as shown in the following formula:

[0078] SquareRoot(Exposure(n+1) / Exposure(n))=AE_Target / Avage_Luma(n);

[0079] Where Exposure(n) is the first exposure amount used in the current acquisition of long frame image, Exposure(n+1) is the exposure amount required for the next acquisition of long frame image, Avage_Luma(n) is the average brightness of the image, AE_Target is the first target exposure brightness, and SquareRoot represents the square root operation.

[0080] Furthermore, by transforming the above formula, we obtain the calculation formula corresponding to the first preset relationship, as shown in the following formula:

[0081] Exposure(n+1)=Exposure(n)×(AE_Target / Avage_Luma(n))².

[0082] As can be seen, by transforming and deriving the constraint relationship between the exposure ratio and the brightness ratio, we can obtain the exposure calculation formula corresponding to the first preset relationship: the exposure of the next long frame is determined by the square of the ratio of the current long frame exposure, the target exposure brightness and the current average brightness of the image. Thus, based on the difference between the average brightness of the image and the target exposure brightness, the theoretically required exposure of the next long frame can be directly calculated, so that the overall brightness of the image approaches the target exposure brightness.

[0083] Furthermore, to avoid brightness jumps and screen flickering caused by directly using the theoretically calculated second exposure value when ambient brightness changes rapidly, this embodiment employs a weighted fusion method to smooth the calculated second exposure value. Specifically, the theoretically calculated (next frame) second exposure value and (current frame) first exposure value are weighted and summed using a first preset weight and a second preset weight, respectively, so that the average image brightness gradually approaches the first target exposure brightness. In this embodiment, the weighted fusion is specifically implemented using the Blending smooth approximation method. The correspondingly set Blending coefficient α1 is the first preset weight, and the second preset weight is 1-α1, where the value range of the Blending coefficient α1 is [0~1]. The theoretically calculated second exposure value is smoothed and corrected using the Blending coefficient, and the correction formula is as follows:

[0084] Exposure(n+1)=Exposure(n+1)×α1+Exposure(n)×(1-α1).

[0085] Further, the target long frame exposure duration is determined based on the corrected second exposure value, including but not limited to the following methods: directly determining the corrected second exposure value as the target long frame exposure duration; or converting the corrected second exposure value into the target long frame exposure duration according to a preset correspondence between exposure value and exposure duration; or using the path allocation strategy built into the AE algorithm to preferentially allocate the corrected second exposure value to the exposure duration, and combining the analog gain AGain and the digital gain DGain to finally determine the target long frame exposure duration. This application does not impose any limitations on this.

[0086] As can be seen, in this embodiment, by combining the nonlinear brightness relationship after global tone mapping to calculate the exposure, the overall brightness of the long frame can be accurately adjusted in high dynamic range scenes, making it quickly approach the target brightness; at the same time, the exposure is progressively corrected by blending weighted smoothing, which effectively avoids brightness jumps and flickering in the picture. Then, the exposure time of the target long frame is determined according to the corrected exposure. Under the premise of ensuring image quality, the automatic exposure process can be made stable, continuous and adapted to the actual use needs of vehicle electronic rearview mirrors.

[0087] S305, if the absolute value of the first difference is not greater than the first preset threshold, then the first exposure duration is determined as the target long frame exposure duration.

[0088] Understandably, when the absolute value of the difference between the average brightness of the image and the brightness of the first target exposure is not greater than the first preset threshold, it indicates that the overall brightness of the current fused frame is already within the optimal range for human eye comfort, and there is no need to adjust the first exposure duration further. At this point, directly confirming the current first exposure duration as the target long frame exposure duration can reduce processor computational power consumption and avoid problems such as screen flickering and inter-frame image quality fluctuations caused by frequent adjustments to exposure parameters, thus meeting the dual requirements of real-time performance and stability in automotive scenarios.

[0089] As can be seen, in this embodiment, by calculating the average brightness based on the brightness distribution histogram, comparing thresholds, and using a flexible multi-algorithm adjustment strategy, the precise adaptive optimization of the target long frame exposure time is achieved, effectively ensuring the ability to capture details in the dark areas of the long frame image and the stability of the image, and adapting to the real-time and reliability requirements of complex lighting scenarios in vehicles.

[0090] Please refer to details. Figure 4 , Figure 4 This is a schematic diagram of a process for determining the exposure duration of a target short frame, provided in an embodiment of this application. Figure 4 As shown, determining the target short frame exposure duration based on the first brightness distribution histogram data, the historical exposure data, and the second exposure duration includes the following steps:

[0091] S401, determine the brightness of the first bright area of ​​the first image of the first short frame image based on the first brightness distribution histogram data.

[0092] Among them, the brightness of the bright areas in the image is used to characterize the degree of overexposure of the image frame. The brightness of the bright areas in the current frame is a quantitative brightness index calculated for the set of bright pixels defined above. It is different from the overall average brightness of the image. It only focuses on the brightness of pixels within the bright area and is the core basis for judging whether the details of the bright areas in a short exposure frame are complete and whether the exposure time of the short frame needs to be further adjusted.

[0093] Specifically, bright areas are defined based on the statistical characteristics of the first brightness distribution histogram data: by analyzing the pixel proportion distribution of brightness levels in the histogram, the set of pixels whose pixel quantity proportion meets specific conditions and whose brightness level is in the high range is designated as bright areas. These areas correspond to strong light areas in automotive scenes that are prone to overexposure, such as oncoming vehicle headlights, road surface reflections, and areas directly illuminated by strong light. These are also core areas where short exposure frames need to focus on preserving details.

[0094] In one possible embodiment, determining the brightness of the first bright area of ​​the first short frame image based on the first brightness distribution histogram data includes: determining multiple brightness levels of the first short frame image and their corresponding number of pixels based on the first brightness distribution histogram data, wherein the brightness level is positively correlated with the brightness of the image frame; determining a first preset weight for the first brightness level and multiple second preset weights for other brightness levels besides the first brightness level to obtain multiple preset weights, wherein the first preset weight is greater than the multiple second preset weights, and the first brightness level is the brightness level representing the bright area of ​​the image frame that is closest to the maximum brightness level; and performing a weighted summation based on the multiple brightness levels, the number of pixels, and the multiple preset weights to obtain the brightness of the first bright area of ​​the first short frame image.

[0095] Among them, the first brightness level, which represents the bright area, is assigned the highest weight, and the weight value decreases step by step as the difference between the brightness level and the first brightness level increases, thereby strengthening the contribution of bright area pixels to the final brightness calculation result and weakening the interference of non-bright area pixels.

[0096] Specifically, a one-dimensional weight array Wa

[256] of length 256 is constructed. The horizontal coordinate of the array is the brightness level, with a value range of 0~255. The element value of the array is the weight value of the corresponding brightness level. The horizontal coordinate corresponding to the maximum value of the weight in the weight array is a. a can be adjusted according to actual needs, preferably 255×0.9 (i.e. 229.5, rounded to 230). The brightness level corresponding to the horizontal coordinate a is the first brightness level, which is a pre-selected single high brightness value, corresponding to the core bright area pixel in the image that is most prone to overexposure, and is the core anchor point for calculating the brightness of the bright area. For gray levels smaller than a, their weight gradually decreases as the difference from a increases.

[0097] Specifically, the brightness of the first bright area of ​​the first short frame image is obtained by weighted summation based on the multiple brightness levels, the multiple number of pixels, and the multiple preset weights, as shown in the following formula:

[0098] ;

[0099] in, The brightness of the bright area in the first image of the first short frame. The value of i is the brightness level (i ranges from 0 to 255, corresponding to the grayscale range from pure black to pure white). Let i be the number of pixels corresponding to the i-th brightness level. This represents the weight corresponding to the i-th brightness level.

[0100] S402, determine the absolute value of the second difference between the brightness of the bright area of ​​the first image and the preset exposure brightness of the second target.

[0101] Specifically, if the absolute value of the second difference is greater than the second preset threshold, then step S403 is executed; otherwise, step S404 is executed.

[0102] The preset second target exposure brightness is the optimal brightness threshold calibrated for the detail rendering of bright areas in automotive scenes. Unlike the first target exposure brightness, which characterizes the overall brightness of the image, the second target exposure brightness focuses on the ideal brightness level of pixels in bright areas (e.g., set to 200 in a 256-level grayscale system). Its core function is to define the optimal range for bright area pixels that "neither lose detail due to overexposure" nor fail to clearly present outlines. If the brightness of a bright area is higher than the second target exposure brightness, it indicates a risk of overexposure in the short-frame bright area, requiring a shorter exposure time. Conversely, if the brightness of a bright area is lower than the second target exposure brightness, it indicates that the details in the bright area are too dark, allowing for a longer exposure time. The setting of the second target exposure brightness needs to consider factors such as the human eye's visual tolerance to strong automotive lighting and the dynamic range of the image sensor; it is a key benchmark for ensuring the integrity of details in bright areas within short frames.

[0103] S403, if the absolute value of the second difference is greater than the second preset threshold, then the target short frame exposure duration is determined based on the second exposure duration, the historical exposure data, the brightness of the first image bright area, and the second target exposure brightness.

[0104] The historical exposure data includes the short frame exposure duration used by the image acquisition device in the last acquisition operation, as well as the brightness of the bright areas of the corresponding short frame image obtained by brightness distribution histogram statistics. This data is used to provide a timing reference for the iterative calculation of the current short frame exposure duration, ensuring a continuous and smooth exposure adjustment process.

[0105] In one possible embodiment, determining the target short frame exposure duration based on the second exposure duration, the historical exposure data, the brightness of the first image bright area, and the second target exposure brightness includes: determining, based on the historical exposure data, the third exposure duration of the second short frame image acquired by the image acquisition device during the previous acquisition operation and the third brightness distribution histogram data of the second short frame image; determining, based on the third brightness distribution histogram data, the brightness of the second image bright area of ​​the second short frame image; and determining, based on a second preset relationship, the fourth exposure duration required by the image acquisition device to acquire the short frame image during the next acquisition operation. The second preset relationship characterizes the correlation between the exposure time required for the next short frame image acquisition, the second exposure time used for the current short frame image acquisition, the brightness of the bright area of ​​the first image, the third exposure time used for the previous short frame image acquisition, the brightness of the bright area of ​​the second image, and the second target exposure brightness; the fourth exposure time and the second exposure time are weighted and summed according to the third preset weight and the fourth preset weight to obtain the corrected fourth exposure time, and the sum of the third preset weight and the fourth preset weight is the second preset value; the corrected fourth exposure time is determined as the target short frame exposure time.

[0106] In this embodiment, to ensure that short-frame images can stably capture details in bright areas of the scene and avoid overexposure or insufficient contrast in bright areas, the exposure time of the short frame needs to be iteratively adjusted based on the current short-frame exposure time, historical exposure data, current brightness of bright areas, and a preset second target exposure brightness. The historical exposure data provides the exposure parameters and brightness information of the previous short frame, enabling smooth iteration based on temporal changes and avoiding screen flickering caused by sudden exposure changes. Specifically, the calculation formula corresponding to the second preset relationship is as follows:

[0107] ;

[0108] in, This is the fourth exposure duration required for the next acquisition operation to capture a short frame image. The second exposure duration is used for the current acquisition of the short frame image. The brightness of the bright area of ​​the first image in the currently acquired short frame image. The third exposure duration used in the previous acquisition of the short frame image. The brightness of the bright area in the second image from the last short-frame image acquisition. The exposure brightness for the second target.

[0109] For example, suppose the current short frame exposure duration is... The duration is 3ms, which is the exposure time of the previous short frame. The current brightness of the bright area is 2ms. The value is 230, representing the brightness of the bright areas in the previous frame. The second target exposure brightness is 210. Substituting 220 into the formula, we can see that the theoretical fourth exposure time required for the next short frame image is 2.5ms.

[0110] Furthermore, to avoid over-adjustment by causing the brightness of the bright area to exceed the second target exposure brightness due to the iteratively calculated exposure duration of the next frame, and to prevent flickering in the bright area due to sudden exposure changes, this embodiment of the application continues to use a weighted fusion method to smooth the theoretically calculated fourth exposure duration. In this embodiment, the weighted fusion is implemented through the blending smoothing method, where the third preset weight is the blending coefficient α2, and the fourth preset weight is 1-α2, with α2 ranging from [0 to 1]. Using the third and fourth preset weights, the theoretically calculated fourth exposure duration is weighted and summed with the currently used second exposure duration, and the corresponding calculation formula is as follows:

[0111] Exposuretime(n+1)=Exposuretime(n+1)×α2+Exposuretime(n)×(1-α2);

[0112] Preferably, α2 is set to 0.5, employing a gradual adjustment method similar to the bisection method. This ensures rapid convergence of bright area brightness to the target brightness while avoiding over-adjustment or image flicker, balancing convergence speed and control stability. Finally, the corrected fourth exposure duration is determined as the target short frame exposure duration and configured in the corresponding register of the image sensor. This achieves continuous, smooth, and reliable control of short frame exposure while stably capturing details in bright areas.

[0113] As can be seen, in this embodiment, by performing weighted brightness calculation on the high-brightness range of short-frame images, the overexposure risk in vehicle-mounted strong light scenes can be accurately reflected. Iterative adjustments are made by combining the exposure time and brightness of the current and historical frames, and then blending is used to smooth and correct the image to avoid over-adjustment and screen flicker. Under the premise of ensuring stable capture of bright area details in short frames, the exposure time can be quickly, smoothly and accurately converged to the target brightness, which greatly improves the imaging reliability and visual continuity of the streaming media rearview mirror in complex lighting environments.

[0114] S404, if the absolute value of the second difference is not greater than the second preset threshold, then the second exposure duration is determined as the target short frame exposure duration.

[0115] Understandably, when the absolute value of the difference between the brightness of the bright area in the current frame image and the brightness of the second target exposure is not greater than the second preset threshold, it indicates that the brightness of the bright area in the short frame image is already in the ideal range of "no overexposure and clear details," and there is no need to adjust the second exposure duration further. At this point, directly confirming the current second exposure duration as the target short frame exposure duration can reduce processor computational power consumption and avoid redundant algorithm calculations. Furthermore, it can prevent brightness fluctuations in the short frame image caused by frequent adjustments to exposure parameters, thereby ensuring the image quality stability of the subsequent long-short frame fusion image, perfectly meeting the dual requirements of real-time performance and reliability in automotive scenarios.

[0116] As can be seen, in this embodiment, by calculating the brightness of bright areas based on the brightness distribution histogram, comparing the target threshold, and combining historical exposure data and preset relationships, precise adaptive optimization of short frame exposure time is achieved. This can quickly shorten the exposure time to suppress overexposure when bright areas are overexposed, and extend the exposure time to improve details when bright areas are too dark. At the same time, invalid adjustments are terminated by threshold judgment, reducing computing power consumption and avoiding image fluctuations, thus ensuring clear and stable presentation of bright area details in short frame images under vehicle dynamic lighting scenarios.

[0117] Please see Figure 5 , Figure 5 This is a schematic diagram of the overall process of an image generation method provided in an embodiment of this application, such as... Figure 5 As shown, the processor 110 includes a luminance distribution histogram statistics unit 111, used to perform luminance distribution statistics on the input image frames and generate luminance distribution histogram data; an image signal processing unit 114, used to calculate the target exposure ratio and target long / short frame exposure duration based on the histogram data, exposure duration, and historical exposure data, and feed it back to the image acquisition device 120; an HDR fusion unit 112, used to perform fusion processing on long / short exposure image frames sequentially with a preset exposure ratio and a target exposure ratio; and a global tone mapping processing unit 113, used to compress the HDR-fused high dynamic range image to a display-adaptive dynamic range. The overall process of the image generation method includes:

[0118] First, the image sensor 121 of the image acquisition device 120 acquires a first long frame image (long exposure frame) with a relatively long first exposure time and a first short frame image (short exposure frame) with a relatively short second exposure time, and sends these two image frames to the brightness distribution histogram statistics unit 111. Simultaneously, the first long frame image and the first short frame image are sent to the HDR fusion unit 112. The HDR fusion unit 112 then performs a first fusion of the first long frame image and the first short frame image according to a preset exposure ratio. The fused image undergoes dynamic range compression adjustment by the global tone mapping processing unit 113 to obtain the fused first composite image, and the first composite image is sent to the brightness distribution histogram statistics unit 111.

[0119] Next, the luminance distribution histogram statistics unit 111 generates first luminance distribution histogram data corresponding to the first short frame image and second luminance distribution histogram data corresponding to the first composite image. Subsequently, the image signal processing unit 114 calculates the dynamic target exposure ratio based on the first and second luminance distribution histogram data, combined with the first and second exposure durations and historical exposure data. This target exposure ratio, along with the corresponding target long frame exposure duration and target short frame exposure duration, is fed back to the image acquisition device 120 to adjust the exposure parameters for the next acquisition operation. It is also sent to the HDR fusion unit 112 for secondary fusion.

[0120] Then, the HDR fusion unit 112 calls up the first long frame image and the first short frame image again, and performs secondary fusion using the newly calculated target exposure ratio to output a high dynamic range image. Subsequently, this image is sent to the global tone mapping processing unit 113, and after dynamic range compression adaptation, a target composite image suitable for display on the streaming media rearview mirror display is generated.

[0121] Finally, the target composite image is transmitted to the independent image display processing module 115, and after final display adaptation, it is output to the display screen 131 of the streaming media rearview mirror 130. The image display processing module 115 is a dedicated adaptation unit connecting the processor 110 and the display screen 131 of the streaming media rearview mirror 130. It is independent of the processor 110, and its core function is to complete the final adaptation optimization before display. It can receive the target composite image output by the processor 110 and perform format conversion and image optimization according to the physical resolution, color gamut range and refresh rate of the display screen 131.

[0122] As can be seen, in this embodiment, by combining the brightness distribution histogram data of the first short frame image and the first composite image, the current long / short exposure time, and historical exposure data of two image frames with different exposure durations output in real time by the image sensor, the target exposure ratio is dynamically calculated. The two image frames are then combined into a target composite image through two fusion processes. This achieves accurate fusion of details in bright and dark areas, and ensures imaging stability through real-time feedback adjustment of exposure parameters. This effectively improves the imaging quality and driving safety of the streaming media rearview mirror, fully meeting the actual usage requirements of vehicle electronic rearview mirror systems.

[0123] Please see Figure 6 , Figure 7 , Figure 6 This is a schematic diagram of a vehicle driving scenario provided in an embodiment of this application. Figure 7 This is a schematic diagram of the display interface of a streaming media rearview mirror provided in an embodiment of this application, as shown below. Figure 6 , Figure 7As shown, the vehicles are in a tunnel scenario. The first vehicle 601 has entered the tunnel entrance and is in a dimly lit environment under artificial lighting. The second vehicle 602 is following behind the first vehicle 601, located on the road outside the tunnel entrance, and is fully illuminated by natural light. There is a brightness difference of hundreds of times between the tunnel (dark area) and the outside (bright area), creating an extremely high dynamic range environment. Specifically, the first vehicle 601 is equipped with the aforementioned electronic rearview mirror system, which includes image acquisition equipment and a display screen 131 of a streaming media rearview mirror 130 installed inside the vehicle.

[0124] in, Figure 7 The display interface of the streaming media rearview mirror 130 of the first vehicle 601 is presented, clearly showing the complete details and background environment of the second vehicle 602. The rear image captured by the image sensor of the image acquisition device of the first vehicle 601 has distinct dynamic range characteristics in terms of light features. The main subject of the image is the second vehicle 602 in the strong natural light environment outside the tunnel, with extremely high brightness in its body area. The background of the image is in the transition zone between the light inside and outside the tunnel. On one side is the strong light road surface extending outside the tunnel, and on the other side is the weak light area extending inward from the tunnel entrance. The brightness difference between the two can be more than 100 times, forming a typical high dynamic range imaging scene.

[0125] It is known that although existing technologies attempt to capture details in both bright and dark areas by using multi-exposure frame acquisition, their fixed fusion strategy and lack of dynamic adjustment mechanism limit their effectiveness. Figure 6 In such scenarios, rearview mirror imaging will exhibit significant defects. If long exposure frames are used as the primary method for fusion, the bright areas such as the body and license plate of the second vehicle will be overexposed and appear washed out, resulting in the complete loss of key details. If short exposure frames are used as the primary method for fusion, the weak light background in the direction of the tunnel entrance will be blurred due to insufficient exposure, making it impossible to judge the environmental conditions inside the tunnel. At the same time, the exposure adjustment of existing technologies lacks historical data support, and the image is prone to flickering and brightness jumps when faced with dynamic changes in light, affecting the driver's visual judgment.

[0126] The image generation solution provided in this application can be accurately adapted. Figure 6In high dynamic range scenarios, this application first completes the initial fusion of long and short exposure frames by setting a preset exposure ratio. Then, based on the first brightness distribution histogram data of the first short frame image and the second brightness distribution histogram data of the first composite image, and combined with historical exposure data, the dynamic target exposure ratio is calculated. Subsequently, a second fusion is completed using this target exposure ratio, which not only preserves the bright details of the second vehicle 602, but also clearly presents the background layers in the direction of the tunnel entrance. Finally, through global tone mapping processing, the fused image is compressed to the display screen adaptation range, so that the display screen 131 of the streaming media rearview mirror 130 of the first vehicle 601 can present a rear vehicle image with complete details, balanced brightness and darkness, and stable and smoothness, effectively ensuring driving safety.

[0127] This application embodiment can divide the electronic device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0128] Please see Figure 8 , Figure 8 This is a functional unit block diagram of an image generation processing device provided in this application embodiment. The image generation processing device 800 includes: an acquisition unit 810 and a processing unit 820; wherein, the acquisition unit 810 is used to acquire a first long frame image and a first short frame image acquired by the image acquisition device in the current acquisition operation, wherein the exposure duration of the long frame image is greater than the exposure duration of the short frame image; the processing unit 820 is used to perform fusion processing on the first long frame image and the first short frame image according to a preset exposure ratio to obtain a first composite image; determine the first brightness distribution histogram data corresponding to the first short frame image and the second brightness distribution histogram data corresponding to the first composite image; determine a target exposure ratio according to the first brightness distribution histogram data, the second brightness distribution histogram data, the first exposure duration of the first long frame image, the second exposure duration of the first short frame image, and historical exposure data; and perform fusion processing on the first long frame image and the first short frame image according to the target exposure ratio to generate a target composite image for display on the display screen.

[0129] In one possible embodiment, the image acquisition device acquires two frames of images with different exposure durations during each acquisition operation. The shorter frame image with a shorter exposure duration is used to capture details in bright areas of the scene, and the longer frame image with a longer exposure duration is used to capture details in dark areas of the scene.

[0130] In one possible embodiment, a target exposure ratio is determined based on the first luminance distribution histogram data, the second luminance distribution histogram data, the first exposure duration of the first long frame image, the second exposure duration of the first short frame image, and historical exposure data. Specifically, the processing unit 820 is configured to: determine the target long frame exposure duration based on the second luminance distribution histogram data and the first exposure duration; determine the target short frame exposure duration based on the first luminance distribution histogram data, the historical exposure data, and the second exposure duration; and obtain the target exposure ratio based on the ratio of the target short frame exposure duration to the target long frame exposure duration.

[0131] In one possible embodiment, the target long frame exposure duration is determined based on the second brightness distribution histogram data and the first exposure duration. The processing unit 820 is specifically configured to: determine a first exposure amount of the first long frame image based on the first exposure duration; determine the average brightness of the first synthesized image based on the second brightness distribution histogram data; determine the absolute value of a first difference between the average image brightness and a preset first target exposure brightness; if the absolute value of the first difference is greater than a first preset threshold, then determine the target long frame exposure duration based on the average image brightness, the first target exposure brightness, and the first exposure amount; if the absolute value of the first difference is not greater than the first preset threshold, then determine the first exposure duration as the target long frame exposure duration.

[0132] In one possible embodiment, the target long frame exposure duration is determined based on the average image brightness, the first target exposure brightness, and the first exposure amount. The processing unit 820 is specifically configured to: determine, based on a first preset relationship, the second exposure amount required by the image acquisition device to acquire the second long frame image in the next acquisition operation, where the first preset relationship characterizes the correlation between the exposure amount required for the next long frame image acquisition and the first exposure amount used in the current long frame image acquisition, the average image brightness, and the first target exposure brightness; perform a weighted summation of the first exposure amount and the second exposure amount based on a first preset weight and a second preset weight to obtain a corrected second exposure amount, where the sum of the first preset weight and the second preset weight is a first preset value; and determine the target long frame exposure duration based on the corrected second exposure amount.

[0133] In one possible embodiment, the target short frame exposure duration is determined based on the first brightness distribution histogram data, the historical exposure data, and the second exposure duration. Specifically, the processing unit 820 is configured to: determine the brightness of a first bright area of ​​the first short frame image based on the first brightness distribution histogram data, where the brightness of the bright area characterizes the overexposure level of the image frame; determine the absolute value of a second difference between the brightness of the first bright area and a preset second target exposure brightness; if the absolute value of the second difference is greater than a second preset threshold, then determine the target short frame exposure duration based on the second exposure duration, the historical exposure data, the brightness of the first bright area, and the second target exposure brightness; if the absolute value of the second difference is not greater than the second preset threshold, then determine the second exposure duration as the target short frame exposure duration.

[0134] In one possible embodiment, the target short frame exposure duration is determined based on the second exposure duration, the historical exposure data, the brightness of the first image bright area, and the second target exposure brightness. The processing unit 820 is specifically configured to: determine, based on the historical exposure data, the third exposure duration of the second short frame image acquired by the image acquisition device during the previous acquisition operation and the third brightness distribution histogram data of the second short frame image; determine the brightness of the second image bright area of ​​the second short frame image based on the third brightness distribution histogram data; and determine, based on a second preset relationship, the fourth exposure duration required for the image acquisition device to acquire the short frame image during the next acquisition operation. The second preset relationship characterizes the correlation between the exposure time required for the next short frame image acquisition, the second exposure time used for the current short frame image acquisition, the brightness of the bright area of ​​the first image, the third exposure time used for the previous short frame image acquisition, the brightness of the bright area of ​​the second image, and the second target exposure brightness; the fourth exposure time and the second exposure time are weighted and summed according to the third preset weight and the fourth preset weight to obtain the corrected fourth exposure time, and the sum of the third preset weight and the fourth preset weight is the second preset value; the corrected fourth exposure time is determined as the target short frame exposure time.

[0135] In one possible embodiment, the processing unit 820 determines the brightness of the first bright area of ​​the first short frame image based on the first brightness distribution histogram data. Specifically, the processing unit 820 is configured to: determine multiple brightness levels of the first short frame image and their corresponding number of pixels based on the first brightness distribution histogram data, wherein the brightness level is positively correlated with the brightness of the image frame; determine a first preset weight for the first brightness level and multiple second preset weights for other brightness levels besides the first brightness level, thereby obtaining multiple preset weights, wherein the first preset weight is greater than the multiple second preset weights, and the first brightness level is the brightness level representing the bright area of ​​the image frame that is closest to the maximum brightness level; and perform a weighted summation based on the multiple brightness levels, the multiple number of pixels, and the multiple preset weights to obtain the brightness of the first bright area of ​​the first short frame image.

[0136] In one possible embodiment, after fusing the first long frame image and the first short frame image according to the target exposure ratio to generate a target composite image for display on the screen, the processing unit 820 is specifically configured to: update the preset exposure ratio according to the target exposure ratio; and send the target short frame exposure duration and the target long frame exposure duration to the image acquisition device, so that the image acquisition device can acquire short frame images with the target short frame exposure duration and long frame images with the target long frame exposure duration respectively in the next acquisition operation.

[0137] As can be seen, in this embodiment, by taking two image frames with different exposure durations output in real time by the image sensor, and based on the brightness distribution histogram data corresponding to the two image frames and the different exposure durations, combined with historical exposure data, the target exposure ratio is dynamically calculated and the two image frames are synthesized into a target composite image according to the target exposure ratio, so as to achieve accurate fusion of bright and dark area details, effectively improving the imaging quality and driving safety of the streaming media rearview mirror.

[0138] It is understood that since the method embodiments and the device embodiments are different presentations of the same technical concept, the content of the method embodiment section in this application should be adapted to the device embodiment section in a synchronous manner, and will not be repeated here.

[0139] Figure 9 This is a structural block diagram of an electronic device provided in an embodiment of this application. For example... Figure 9 As shown, the electronic device 900 may include one or more of the following components: a processing module 901 and a memory 902 coupled to the processing module 901, wherein the memory 902 may store one or more computer programs, which may be configured to implement the methods described in the examples above when executed by one or more processing modules 901. The electronic device 900 may be as follows: Figure 1The processor 110 shown.

[0140] The processing module 901 may include one or more processing cores. The processing module 901 connects to various parts within the electronic device 900 using various interfaces and lines. It executes various functions and processes data of the electronic device 900 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 902, and by calling data stored in the memory 902. Optionally, the processing module 901 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processing module 901 may integrate one or more of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. It is understood that the aforementioned modem may also not be integrated into the processing module 901 and may be implemented separately through a communication chip.

[0141] The memory 902 may include random access memory (RAM) or read-only memory (ROM). The memory 902 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 902 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the above-described method examples. The data storage area may also store data created during the use of the electronic device 900.

[0142] It is understood that the electronic device 900 may include more or fewer structural elements than those shown in the above block diagram, such as a power module, physical buttons, WiFi (Wireless Fidelity) module, speaker, Bluetooth module, sensor, etc., without limitation.

[0143] This application also provides a computer storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements some or all of the steps of any of the methods described in the above method embodiments.

[0144] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments.

[0145] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0146] In the several embodiments provided in this application, it should be understood that the disclosed methods, apparatuses, and systems can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for example, the division of units is merely a logical functional division, and there may be other division methods in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0147] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0148] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can be physically comprised separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or in the form of hardware plus software functional units.

[0149] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute partial steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes: a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, volatile memory, or non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM), etc., which are various media capable of storing program code.

[0150] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can easily conceive of variations or substitutions without departing from the spirit and scope of the present invention, and various modifications and alterations can be made, including combinations of the different functions and implementation steps described above, as well as software and hardware implementation methods, all of which are within the protection scope of the present invention.

Claims

1. An image generation method, characterized in that, A processor for use in a vehicle electronic rearview mirror system, the vehicle electronic rearview mirror system further including an image acquisition device and a display screen of a streaming media rearview mirror installed in the vehicle, the processor being connected to the image acquisition device and the display screen respectively, the method comprising: The image acquisition device acquires a first long frame image and a first short frame image in the current acquisition operation, wherein the exposure duration of the long frame image is greater than the exposure duration of the short frame image; The first long frame image and the first short frame image are fused according to a preset exposure ratio to obtain a first composite image; Determine the first brightness distribution histogram data corresponding to the first short frame image and the second brightness distribution histogram data corresponding to the first synthesized image; The target exposure ratio is determined based on the first brightness distribution histogram data, the second brightness distribution histogram data, the first exposure duration of the first long frame image, the second exposure duration of the first short frame image, and historical exposure data. The first long frame image and the first short frame image are fused according to the target exposure ratio to generate a target composite image for display on the display screen.

2. The method according to claim 1, characterized in that, The image acquisition device acquires two frames of images with different exposure durations during each acquisition operation. The shorter frame image with a shorter exposure duration is used to capture details in bright areas of the scene, and the longer frame image with a longer exposure duration is used to capture details in dark areas of the scene.

3. The method according to claim 1 or 2, characterized in that, The step of determining the target exposure ratio based on the first brightness distribution histogram data, the second brightness distribution histogram data, the first exposure duration of the first long frame image, the second exposure duration of the first short frame image, and historical exposure data includes: The target long frame exposure duration is determined based on the second brightness distribution histogram data and the first exposure duration; The target short frame exposure duration is determined based on the first brightness distribution histogram data, the historical exposure data, and the second exposure duration. The target exposure ratio is obtained by the ratio of the target short frame exposure duration to the target long frame exposure duration.

4. The method according to claim 3, characterized in that, The step of determining the target long frame exposure duration based on the second brightness distribution histogram data and the first exposure duration includes: The first exposure amount of the first long frame image is determined based on the first exposure duration; The average brightness of the first synthesized image is determined based on the second brightness distribution histogram data. Determine the absolute value of a first difference between the average brightness of the image and the preset first target exposure brightness; If the absolute value of the first difference is greater than the first preset threshold, the target long frame exposure duration is determined based on the average brightness of the image, the first target exposure brightness, and the first exposure amount. If the absolute value of the first difference is not greater than the first preset threshold, then the first exposure duration is determined as the target long frame exposure duration.

5. The method according to claim 4, characterized in that, Determining the target long frame exposure duration based on the average image brightness, the first target exposure brightness, and the first exposure amount includes: The second exposure amount required for the image acquisition device to acquire the second long frame image in the next acquisition operation is determined according to the first preset relationship. The first preset relationship represents the correlation between the exposure amount required for the next acquisition of the long frame image, the first exposure amount used in the current acquisition of the long frame image, the average brightness of the image, and the first target exposure brightness. The first exposure and the second exposure are weighted and summed according to the first preset weight and the second preset weight to obtain the corrected second exposure. The sum of the first preset weight and the second preset weight is the first preset value. The target long frame exposure duration is determined based on the corrected second exposure value.

6. The method according to claim 3, characterized in that, The step of determining the target short frame exposure duration based on the first brightness distribution histogram data, the historical exposure data, and the second exposure duration includes: The brightness of the first bright area of ​​the first short frame image is determined based on the first brightness distribution histogram data. The brightness of the bright area is used to characterize the overexposure of the image frame. Determine the absolute value of the second difference between the brightness of the bright area of ​​the first image and the preset exposure brightness of the second target; If the absolute value of the second difference is greater than the second preset threshold, the target short frame exposure duration is determined based on the second exposure duration, the historical exposure data, the brightness of the bright area of ​​the first image, and the second target exposure brightness. If the absolute value of the second difference is not greater than the second preset threshold, then the second exposure duration is determined as the target short frame exposure duration.

7. The method according to claim 6, characterized in that, Determining the target short frame exposure duration based on the second exposure duration, the historical exposure data, the brightness of the bright area of ​​the first image, and the second target exposure brightness includes: Based on the historical exposure data, the third exposure duration of the second short frame image and the third brightness distribution histogram data of the second short frame image acquired by the image acquisition device during the last acquisition operation are determined; The brightness of the bright area of ​​the second image in the second short frame image is determined based on the third brightness distribution histogram data. The fourth exposure duration required for the image acquisition device to acquire a short frame image in the next acquisition operation is determined according to the second preset relationship. The second preset relationship represents the correlation between the exposure duration required for the next acquisition of a short frame image and the second exposure duration and the brightness of the bright area of ​​the first image used in the current acquisition of the short frame image, the third exposure duration and the brightness of the bright area of ​​the second image used in the previous acquisition of the short frame image, and the second target exposure brightness. The fourth exposure time and the second exposure time are weighted and summed according to the third preset weight and the fourth preset weight to obtain the corrected fourth exposure time. The sum of the third preset weight and the fourth preset weight is the second preset value. The corrected fourth exposure duration is determined as the target short frame exposure duration.

8. The method according to claim 6 or 7, characterized in that, Determining the brightness of the first bright area of ​​the first image in the first short frame image based on the first brightness distribution histogram data includes: Based on the first brightness distribution histogram data, multiple brightness levels of the first short frame image and the number of multiple corresponding pixels are determined, wherein the brightness level is positively correlated with the brightness of the image frame. Determine a first preset weight for the first brightness level among the plurality of brightness levels and a plurality of second preset weights corresponding to the plurality of other brightness levels besides the first brightness level to obtain a plurality of preset weights. The first preset weight is greater than the plurality of second preset weights. The first brightness level is the brightness level that is close to the maximum brightness level and represents the bright area of ​​the image frame. The brightness of the first bright area of ​​the first short frame image is obtained by weighted summation based on the multiple brightness levels, the multiple number of pixels, and the multiple preset weights.

9. The method according to claim 3, characterized in that, After performing the fusion processing on the first long frame image and the first short frame image according to the target exposure ratio to generate a target composite image for display on the screen, the method further includes: Update the preset exposure ratio according to the target exposure ratio; The target short frame exposure duration and the target long frame exposure duration are sent to the image acquisition device so that the image acquisition device can acquire a short frame image with the target short frame exposure duration and a long frame image with the target long frame exposure duration in the next acquisition operation.

10. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, The computer program / instructions are executed by the processor to implement the steps of the method according to any one of claims 1-9.