Camera exposure control method

By reading the brightness mean and environmental judgment of the camera image frame, the target exposure time and gain are directly calculated, which solves the problems of long camera exposure time and image flickering, and improves the imaging speed and quality of the on-board camera.

CN116193266BActive Publication Date: 2025-08-08FORYOU GENERAL ELECTRONICS
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310169199.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-23
Publication Date
2025-08-08
Estimated Expiration
2043-02-23

AI Technical Summary

Technical Problem

The existing cameras have a long exposure time determination process in the on-board image acquisition device and fail to effectively detect image flickering, resulting in poor imaging quality.

Method used

By reading the brightness average of the current image frame, judging the environment type and calculating the target gain or exposure time, directly adjusting the exposure parameters to meet the target brightness, and detecting and eliminating image flickering.

Benefits of technology

It realizes rapid determination of exposure time, improves imaging speed and quality, eliminates image flickering, and improves imaging effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116193266B_ABST
    Figure CN116193266B_ABST
Patent Text Reader

Abstract

The present invention provides a camera exposure control method, comprising: step 1, reading the current image frame output by the camera and calculating its average brightness; step 2, determining the relationship between the average brightness and a target brightness; step 3, determining a target gain and / or a target exposure time for the camera based on the determination result; and step 4, setting the target exposure time and / or target gain to take effect and capturing the next image frame. The present invention enables rapid exposure time determination, accelerates the exposure adjustment process, and improves imaging speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cameras, and in particular to a camera exposure control method. Background Art

[0002] Cameras are increasingly being used in automotive image acquisition devices to enhance driving safety, such as streaming rearview mirrors, dashcams, and panoramic systems. These in-vehicle devices all utilize the same principle for image acquisition: capturing images of the road conditions surrounding the vehicle using cameras. Due to the frequent changes in the driving environment and the complex range of light on the road, the exposure performance of automotive cameras is a crucial parameter in determining image quality. Overexposure or underexposure can result in poor image quality.

[0003] In the prior art, cameras must gradually adjust the gain before each exposure time adjustment. Only when the gain adjustment reaches its limit and still fails to achieve the target brightness is a new exposure time calculated: exposure time 1 → gain 1 (not meeting the target brightness) → gain 2 (not meeting the target brightness)… maximum gain value (not meeting the target brightness) → exposure time 2 → gain 1 (not meeting the target brightness)… → exposure time n (meeting the target brightness). This results in a lengthy exposure time determination process. Furthermore, most current cameras do not detect image flicker when setting exposure parameters, resulting in rolling ripples in captured images, which also adversely affects image quality. Summary of the Invention

[0004] The present invention provides a camera exposure control method, which aims to solve the defects in the prior art, realize rapid determination of exposure time, accelerate the exposure adjustment process, and improve imaging speed.

[0005] In order to achieve the above object, the technical solution adopted by the present invention is:

[0006] A camera exposure control method, comprising:

[0007] Step 1: Read the current image frame output by the camera and calculate its brightness mean;

[0008] Step 2: Determine the relationship between the brightness mean and the target brightness;

[0009] Step 3: Determine the target gain and / or target exposure time of the camera according to the judgment result;

[0010] Step 4: The target exposure time and / or target gain settings are enabled, and the next frame of image is captured.

[0011] Specifically, the step 2 includes:

[0012] Step 201: Obtain a first judgment threshold, a second judgment threshold, a third judgment threshold, and a fourth judgment threshold, wherein the first judgment threshold is used to determine whether an image is overexposed in a daytime environment, the second judgment threshold is used to determine whether an image is underexposed in a daytime environment, the third judgment threshold is used to determine whether an image is overexposed in a nighttime environment, and the second judgment threshold is used to determine whether an image is underexposed in a nighttime environment;

[0013] Step 202: Obtain a histogram of the current image frame, divide the histogram into two parts, a left part and a right part, with a middle grayscale of 127 as a boundary, and calculate a first parameter according to a first preset relationship.

[0014] Step 203: determine whether the proportion of pixels with grayscale values less than 100 in the histogram exceeds a preset threshold; if so, determine that the current environment type is night; otherwise, determine that the current environment type is day;

[0015] Step 204: reading a corresponding judgment threshold according to the current environment type, and determining a relationship between the brightness mean and the target brightness according to the first parameter and the corresponding judgment threshold;

[0016] The first preset relationship is:

[0017]

[0018] Among them, G represents the first parameter, g i Indicates the number of pixels at each grayscale level in the histogram.

[0019] Specifically, step 204 includes:

[0020] 1) If the current environment type is daytime and the first parameter is greater than the first judgment threshold, it is determined that the average brightness is higher than the target brightness;

[0021] 2) If the current environment type is daytime and the first parameter is less than the second judgment threshold, it is determined that the average brightness is lower than the target brightness;

[0022] 3) If the current environment type is night and the first parameter is greater than the third judgment threshold, it is determined that the average brightness is higher than the target brightness;

[0023] 4) If the current environment type is night and the first parameter is less than the fourth judgment threshold, it is determined that the average brightness is lower than the target brightness.

[0024] Specifically, the step 3 includes:

[0025] If the average brightness is higher than the target brightness, then execute steps A1 to A3; if the average brightness is lower than the target brightness, then execute steps B1 to B3:

[0026] Step A1: Determine whether the current gain has reached the maximum gain value. If yes, proceed to step A3; otherwise, proceed to the next step.

[0027] Step A2: Calculate whether the image brightness is equal to or greater than the target brightness when the gain is set to the maximum gain value. If yes, calculate the target gain; otherwise, proceed to the next step.

[0028] Step A3: Calculate the target exposure time and set the target gain to the minimum gain value;

[0029] Step B1: Determine whether the current gain has reached the minimum gain value. If yes, proceed to step B3; otherwise, proceed to the next step.

[0030] Step B2: Calculate whether the image brightness is lower than the target brightness when the gain is set to the minimum gain value. If yes, calculate the target gain; otherwise, proceed to the next step.

[0031] Step B3: Calculate the target exposure time and set the target gain to the maximum gain value.

[0032] Specifically, calculating the target exposure time includes:

[0033] Step a, dividing the current image frame into three equal parts in the vertical pixel direction, recording the upper 1 / 3 area and the lower 1 / 3 area as the first area and the second area respectively, and dividing the middle 2 / 3 area again into three areas from left to right, recording them as the third area, the fourth area, and the fifth area respectively, and setting weight values for the first to fifth areas;

[0034] Step b, calculating the average brightness of each of the first to fifth areas;

[0035] Step c, determining the brightness value of the next frame of image according to the average brightness of each area and a second preset relationship;

[0036] Step d: determining the target exposure time of the next frame of image according to the brightness value of the next frame of image and a third preset relationship.

[0037] Specifically, the second preset relationship is:

[0038]

[0039] The third preset relationship is:

[0040]

[0041] Among them, Bn+1 Indicates the brightness value of the next frame image, W i Indicates the weight values of the first to fifth regions, B ni represents the average brightness of each area from the first to the fifth area, t n+1 Indicates the target exposure time, t n Indicates the current exposure time, B n Indicates the average brightness of the current image.

[0042] Furthermore, after step A3 or step B3, the method further includes:

[0043] Step C1, detecting whether there is flicker in the current image frame, if yes, proceeding to the next step, otherwise maintaining the target exposure time;

[0044] Step C2: determine whether there is a corrected exposure time that meets the preset conditions; if so, adjust the target exposure time to the corrected exposure time; otherwise, maintain the target exposure time.

[0045] Specifically, detecting whether there is flicker in the current image frame includes:

[0046] Step C1-1, reading two consecutive adjacent image frames, and calculating the sum of the brightness of all pixels in any same row in the two adjacent image frames, which are recorded as a first brightness function and a second brightness function respectively;

[0047] Step C1-2, calculating a third brightness function, where the third brightness function is the difference between the first brightness function and the second brightness function;

[0048] Step C1-3, determining whether the third brightness function is a periodic function, if so, proceeding to the next step; otherwise, determining that there is no flicker in the current image frame;

[0049] Step C1-4, calculating the number of exposure lines corresponding to the period of the third brightness function, and calculating the flicker frequency according to a fourth preset relationship;

[0050] Step C1-5: Calculate a second parameter according to a fifth preset relationship. If the second parameter is within a preset range, determine that there is no flicker in the current image frame; otherwise, there is flicker in the current image frame.

[0051] Specifically, the fourth preset relationship is:

[0052] The fifth preset relationship is: q = 1 / ft n / k,

[0053] Where f is the flicker frequency, h is the number of exposure lines corresponding to the period of the third brightness function, W is the horizontal resolution of the camera sensor, and P is the pixel clock. Indicates rounding up operation, q indicates the second parameter, k is a positive integer, t n is the current exposure time.

[0054] Specifically, the preset condition is: |t' n+1 -m / 2f|≤δ and |t' n+1 -t n+1 |≤Δt, where t' n+1 Indicates the corrected exposure time, t n+1 represents the target exposure time, m is a positive integer, f is the flicker frequency, δ and Δt are constants.

[0055] The beneficial effect of the present invention is that: under the current exposure time, the present invention first calculates the maximum brightness that can be achieved by the maximum gain. If the target brightness still exceeds the maximum brightness, the target exposure time is directly calculated, thereby omitting unnecessary gain adjustment process, that is, there is no need to adjust the gain multiple times during the exposure time adjustment process, and the exposure time is quickly determined, the exposure adjustment process is accelerated, the imaging speed is improved, and the flicker phenomenon can be automatically eliminated when it occurs, thereby improving the imaging quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a flow chart of the camera exposure control method of the present invention. DETAILED DESCRIPTION

[0057] The following describes the embodiments of the present invention in detail with reference to the accompanying drawings, which are for reference and illustration only and do not limit the scope of patent protection of the present invention.

[0058] In the processes described in the specification, claims, or drawings of the present invention, if the steps are numbered (e.g., steps 10, 20, etc.), the numbers are used solely to distinguish the steps and do not represent any order of execution. It should be noted that the terms "first," "second," etc., used herein are used solely to distinguish the objects being described and do not indicate a sequential order or indicate different types of steps.

[0059] like Figure 1 As shown, an embodiment of the present invention provides a camera exposure control method, comprising:

[0060] Step 1: Read the current image frame output by the camera and calculate its brightness mean B n .

[0061] Step 2: Determine the brightness mean B nRelationship with target brightness B0.

[0062] In this embodiment, step 2 includes:

[0063] Step 201: Obtain the first judgment threshold G B1 , the second judgment threshold G B2 , the third judgment threshold G W1 , the fourth judgment threshold G W2 , the first judgment threshold G B1 The second judgment threshold G is used to judge whether the image is overexposed in daytime environment. B2 The third judgment threshold G is used to judge whether the image is underexposed in daytime environment. W1 The second judgment threshold G is used to judge whether the image is overexposed in a night environment. W2 Used to determine whether the image is underexposed in night environment.

[0064] Step 202: Obtain a histogram of the current image frame, divide the histogram into two parts, a left part and a right part, with the middle grayscale 127 as the boundary, and calculate a first parameter G according to a first preset relationship.

[0065] In this embodiment, the first preset relationship is:

[0066]

[0067] Among them, G represents the first parameter, g i Indicates the number of pixels at each grayscale level in the histogram.

[0068] Step 203: determine whether the proportion of pixels with grayscale values less than 100 in the histogram exceeds a preset threshold (for example, 75%). If so, determine that the current environment type is night; otherwise, determine that the current environment type is day.

[0069] Step 204: Read the corresponding judgment threshold according to the current environment type, and determine the brightness mean B according to the first parameter G and the corresponding judgment threshold. n Relationship with target brightness B0.

[0070] In this embodiment, step 204 includes:

[0071] 1) If the current environment type is daytime and the first parameter G is greater than the first judgment threshold G B1 , then it is determined to be the brightness mean B n Higher than the target brightness B0;

[0072] 2) If the current environment type is daytime and the first parameter G is less than the second judgment threshold G B2 , then it is determined to be the brightness mean Bn Lower than the target brightness B0;

[0073] 3) If the current environment type is night, and the first parameter G is greater than the third judgment threshold G W1 , then it is determined to be the brightness mean B n Higher than the target brightness B0;

[0074] 4) If the current environment type is night, and the first parameter G is less than the fourth judgment threshold G W2 , then it is determined to be the brightness mean B n Lower than the target brightness B0.

[0075] Step 3: Determine the target gain and / or target exposure time of the camera according to the judgment result.

[0076] In this embodiment, step 3 includes:

[0077] If the brightness mean B n Higher than the target brightness B0, then execute steps A1 to A3; if the brightness mean B n If the brightness is lower than the target brightness B0, then execute steps B1 to B3:

[0078] Step A1: Determine the current gain G n Has the maximum gain value G been reached? max If yes, go to step A3, otherwise go to the next step.

[0079] Step A2: Calculate the maximum gain value G when the gain is set to max Is the image brightness equal to or greater than the target brightness B0? If yes, calculate the target gain G n+1 , otherwise go to the next step.

[0080] Step A3: Calculate target exposure time t n+1 , and set the target gain G n+1 Set to minimum gain value G min .

[0081] Step B1: Determine the current gain G n Has the minimum gain value G been reached? min If yes, go to step B3, otherwise go to the next step.

[0082] Step B2: Calculate the minimum gain value G when the gain is set to the minimum gain value G min Is the image brightness lower than the target brightness B0? If so, calculate the target gain G n+1 , otherwise go to the next step.

[0083] Step B3: Calculate target exposure time t n+1, and set the target gain G n+1 Set to the maximum gain value G max .

[0084] In this embodiment, the target exposure time t is calculated n+1 include:

[0085] Step a: Divide the current image frame into three equal parts in the vertical pixel direction, record the upper 1 / 3 area and the lower 1 / 3 area as the first area Z1 and the second area Z2 respectively, and divide the middle 2 / 3 area again into three areas from left to right, record them as the third area Z3, the fourth area Z4, and the fifth area Z5 respectively, and set the weight values W of the first to fifth areas i .

[0086] In specific implementation, the weight value W i It is calibrated according to the actual exposure effect.

[0087] Step b: Calculate the average brightness B of each of the first to fifth areas Z1 to Z5 ni .

[0088] Step c: Determine the brightness value B of the next frame image based on the average brightness of each area and the second preset relationship. n+1 .

[0089] In this embodiment, the second preset relationship is:

[0090]

[0091] Among them, B n+1 Indicates the brightness value of the next frame image, W i Indicates the weight values of the first to fifth regions, B ni Indicates the average brightness of each area from the first to the fifth area.

[0092] Step d: according to the brightness value B of the next frame image n+1 The target exposure time t for the next frame of image is determined by the third preset relationship: n+1 .

[0093] In this embodiment, the third preset relationship is:

[0094]

[0095] Among them, t n+1 Indicates the target exposure time, t n Indicates the current exposure time, B n Indicates the average brightness of the current image.

[0096] In another embodiment of the present invention, after step A3 or step B3, the method further includes:

[0097] Step C1: Detect whether there is flicker in the current image frame. If yes, proceed to the next step. Otherwise, maintain the target exposure time t n+1 .

[0098] In this embodiment, detecting whether there is flicker in the current image frame includes:

[0099] Step C1-1: Read two consecutive adjacent frames of image F n (x,y) and F n+1 (x, y), and calculate the sum of the brightness of all pixels in any same row in the two adjacent frames of image, respectively recorded as the first brightness function Y n (j) Second brightness function Y n+1 (j), j represents the row number.

[0100] It is easy to understand that the first brightness function Y n (j) Second brightness function Y n+1 (j) is a function of exposure time and ambient light brightness.

[0101] Step C1-2: Calculate the third brightness function D n (j), the third brightness function is the first brightness function Y n (j) Second brightness function Y n+1 (j) the difference.

[0102] Step C1-3: Determine the third brightness function D n (j) Whether it is a periodic function, if so, proceed to the next step, otherwise, determine whether there is no flicker in the current image frame.

[0103] Step C1-4: Calculate the third brightness function D n The number of exposure lines h corresponding to the period of (j) is calculated, and the flicker frequency f is calculated according to the fourth preset relationship.

[0104] In this embodiment, the fourth preset relationship is:

[0105] Where f is the flicker frequency, h is the number of exposure lines corresponding to the period of the third brightness function, W is the horizontal resolution of the camera sensor, and P is the pixel clock. Indicates a round-up operation.

[0106] Step C1-5: Calculate a second parameter q according to a fifth preset relationship. If the second parameter q is within a preset range, determine that there is no flicker in the current image frame; otherwise, there is flicker in the current image frame.

[0107] In this embodiment, the fifth preset relationship is:

[0108] q = 1 / ft n / k, where q represents the second parameter, k is a positive integer, t n is the current exposure time.

[0109] Step C2: Determine whether there is a corrected exposure time t' that meets the preset conditions n+1 , then the target exposure time is adjusted to the corrected exposure time t' n+1 , otherwise keep the target exposure time t n+1 .

[0110] In this embodiment, the preset condition is: |t' n+1 -m / 2f|≤δ and |t' n+1 -t n+1 |≤Δt, where m is a positive integer, f is the flicker frequency, δ and Δt are constants that can be obtained through calibration of experimental results.

[0111] This step can eliminate the stripes in the camera image caused by ambient light flicker.

[0112] Step 4: Set the target exposure time t n+1 or / and target gain G n+1 The settings take effect and the next frame is captured.

[0113] The above disclosure is only a preferred embodiment of the present invention and cannot be used to limit the scope of protection of the present invention. Therefore, equivalent changes made according to the scope of the patent application of the present invention are still within the scope covered by the present invention.

Claims

1. A camera exposure control method, characterized in that: include: Step 1: Read the current image frame output by the camera and calculate its brightness mean; Step 2: Determine the relationship between the brightness mean and the target brightness; Step 3: Determine the target gain and / or target exposure time of the camera according to the judgment result; Step 4: setting the target exposure time and / or target gain to take effect and capturing the next frame of image; The step 3 includes: If the average brightness is higher than the target brightness, then execute steps A1 to A3; if the average brightness is lower than the target brightness, then execute steps B1 to B3: Step A1: Determine whether the current gain has reached the maximum gain value. If yes, proceed to step A3; otherwise, proceed to the next step. Step A2: Calculate whether the image brightness is equal to or greater than the target brightness when the gain is set to the maximum gain value. If yes, calculate the target gain; otherwise, proceed to the next step. Step A3: Calculate the target exposure time and set the target gain to the minimum gain value; Step B1: Determine whether the current gain has reached the minimum gain value. If yes, proceed to step B3; otherwise, proceed to the next step. Step B2: Calculate whether the image brightness is lower than the target brightness when the gain is set to the minimum gain value. If yes, calculate the target gain; otherwise, proceed to the next step. Step B3: Calculate the target exposure time and set the target gain to the maximum gain value.

2. The camera exposure control method according to claim 1, wherein: The step 2 includes: Step 201: Obtain a first judgment threshold, a second judgment threshold, a third judgment threshold, and a fourth judgment threshold, wherein the first judgment threshold is used to determine whether an image is overexposed in a daytime environment, the second judgment threshold is used to determine whether an image is underexposed in a daytime environment, the third judgment threshold is used to determine whether an image is overexposed in a nighttime environment, and the second judgment threshold is used to determine whether an image is underexposed in a nighttime environment; Step 202: Obtain a histogram of the current image frame, divide the histogram into two parts, a left part and a right part, with a middle grayscale of 127 as a boundary, and calculate a first parameter according to a first preset relationship. Step 203: determine whether the proportion of pixels with grayscale values less than 100 in the histogram exceeds a preset threshold; if so, determine that the current environment type is night; otherwise, determine that the current environment type is day; Step 204: reading a corresponding judgment threshold according to the current environment type, and determining a relationship between the brightness mean and the target brightness according to the first parameter and the corresponding judgment threshold; The first preset relationship is: Among them, G represents the first parameter, g i Indicates the number of pixels at each grayscale level in the histogram.

3. The camera exposure control method according to claim 2, wherein: The step 204 includes: 1) If the current environment type is daytime and the first parameter is greater than the first judgment threshold, it is determined that the average brightness is higher than the target brightness; 2) If the current environment type is daytime and the first parameter is less than the second judgment threshold, it is determined that the average brightness is lower than the target brightness; 3) If the current environment type is night and the first parameter is greater than the third judgment threshold, it is determined that the average brightness is higher than the target brightness; 4) If the current environment type is night and the first parameter is less than the fourth judgment threshold, it is determined that the average brightness is lower than the target brightness.

4. The camera exposure control method according to claim 1, wherein: Calculating the target exposure time includes: Step a, dividing the current image frame into three equal parts in the vertical pixel direction, recording the upper 1 / 3 area and the lower 1 / 3 area as the first area and the second area respectively, and dividing the middle 2 / 3 area again into three areas from left to right, recording them as the third area, the fourth area, and the fifth area respectively, and setting weight values for the first to fifth areas; Step b, calculating the average brightness of each of the first to fifth areas; Step c, determining the brightness value of the next frame of image according to the average brightness of each area and a second preset relationship; Step d: determining the target exposure time of the next frame of image according to the brightness value of the next frame of image and a third preset relationship.

5. The camera exposure control method according to claim 4, characterized in that: The second preset relationship is: The third preset relationship is: Among them, B n+1 Indicates the brightness value of the next frame image, W i Indicates the weight values of the first to fifth regions, B ni represents the average brightness of each area from the first to the fifth area, t n+1 Indicates the target exposure time, t n Indicates the current exposure time, B n Indicates the average brightness of the current image.

6. The camera exposure control method according to claim 5, characterized in that: After step A3 or step B3, the method further includes: Step C1, detecting whether there is flicker in the current image frame, if yes, proceeding to the next step, otherwise maintaining the target exposure time; Step C2: determine whether there is a corrected exposure time that meets the preset conditions; if so, adjust the target exposure time to the corrected exposure time; otherwise, maintain the target exposure time.

7. The camera exposure control method according to claim 6, wherein: Detecting whether there is flicker in the current image frame includes: Step C1-1, reading two consecutive adjacent image frames, and calculating the sum of the brightness of all pixels in any same row in the two adjacent image frames, which are recorded as a first brightness function and a second brightness function respectively; Step C1-2, calculating a third brightness function, where the third brightness function is the difference between the first brightness function and the second brightness function; Step C1-3, determining whether the third brightness function is a periodic function, if so, proceeding to the next step; otherwise, determining that there is no flicker in the current image frame; Step C1-4, calculating the number of exposure lines corresponding to the period of the third brightness function, and calculating the flicker frequency according to a fourth preset relationship; Step C1-5: Calculate a second parameter according to a fifth preset relationship. If the second parameter is within a preset range, determine that there is no flicker in the current image frame; otherwise, there is flicker in the current image frame.

8. The camera exposure control method according to claim 7, wherein: The fourth preset relationship is: The fifth preset relationship is: q = 1 / ft n / k, Where f is the flicker frequency, h is the number of exposure lines corresponding to the period of the third brightness function, W is the horizontal resolution of the camera sensor, and P is the pixel clock. Indicates rounding up operation, q indicates the second parameter, k is a positive integer, t n is the current exposure time.

9. The camera exposure control method according to claim 8, wherein: The preset condition is: |t' n+1 -m / 2f|≤δ and |t' n+1 -t n+1 |≤Δt, where t' n+1 Indicates the corrected exposure time, t n+1 represents the target exposure time, m is a positive integer, f is the flicker frequency, δ and Δt are constants.

Citation Information

Patent Citations

  • Automatic EMCCD gain adjusting method

    CN104954696A