Image automatic exposure control method and system
By dynamically adjusting the exposure parameters of the roller shutter exposure method, the problem of taking into account both the bright and dark details in high-contrast environments is solved, and the exposure adaptability and brightness stability of the image in high-contrast environments are achieved.
Patent Information
- Application Number
- CN202411005847.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-11-01
AI Technical Summary
In high contrast environments, it is difficult to take into account both the bright and dark details at the same time, resulting in unsuitable and brightness oscillation problems in image exposure.
By obtaining the brightness threshold range and exposure time, adjusting the exposure parameters of each pixel row, dynamically adjusting the exposure time according to the average brightness, ensuring the exposure adaptability of the image in bright and dark fields.
The exposure adaptability of the image in a high contrast environment is achieved, the richness and completeness of image information is ensured, and the brightness oscillation problem is avoided.
Smart Images

Figure CN118890556A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image automatic exposure control method and system. Background Art
[0002] Rolling shutter and global shutter are two different exposure methods of CMOS image sensor (CIS). Rolling shutter is suitable for consumer application scenarios with restrictions on cost and power consumption. In these cases, rolling shutter can provide good image quality and performance while meeting the needs of practical applications.
[0003] Appropriate exposure time can ensure that the bright and dark details in the image are clearly visible and can accurately capture the required information under different scenes and lighting conditions. Image automatic exposure control is one of the important technologies in digital image processing. It adjusts the exposure parameters of CIS based on different metering modes such as average metering, region of interest (ROI) metering, spot metering, etc. to ensure that the captured image can maintain appropriate brightness and contrast under different lighting conditions. However, in a high-contrast ambient light field, it is impossible to take into account both bright and dark details at the same time. Summary of the invention
[0004] The embodiments of the present invention provide an automatic image exposure control method and system, which can realize the image exposure adaptability of an image obtained by a rolling shutter exposure method in high-contrast environments such as bright field, dark field, especially local bright field, local dark field, etc., thereby ensuring the richness and completeness of the image information and avoiding the problem of image brightness oscillation.
[0005] In order to solve the above technical problems, the present invention provides an image automatic exposure control method, comprising the following steps:
[0006] Get the brightness threshold range and exposure time;
[0007] Get the original real-time image of the current frame;
[0008] Performing color gamut conversion on the original real-time image to obtain a brightness component of the current frame image;
[0009] Obtaining the average brightness of each pixel row in the current frame image;
[0010] If the average brightness of the current pixel row is outside the brightness threshold range, adjusting the exposure parameter of the current pixel row, and acquiring a subsequent frame of the original real-time image of the current pixel row with the adjusted exposure parameter; and
[0011] If the average brightness of the current pixel row is within the brightness threshold range, the next frame of the original real-time image of the current pixel row is acquired with the current exposure parameters.
[0012] In one embodiment of the present invention, the step of acquiring the original real-time image includes:
[0013] Acquire effective pixel units or regions of interest of an image sensor; and
[0014] Pixel data of the original real-time image is acquired from the effective pixel unit or the region of interest.
[0015] In one embodiment of the present invention, the step of setting the brightness threshold range includes:
[0016] Dividing a pixel array into a plurality of pixel regions, wherein brightness threshold ranges of the pixel regions are configured by independent registers; and
[0017] A value is input into the register to simultaneously set the brightness threshold range of a plurality of the pixel regions.
[0018] In one embodiment of the present invention, the step of performing color gamut conversion on the original real-time image includes:
[0019] Determining whether the original real-time image is a color image;
[0020] When the original real-time image is a color image, converting the color gamut of the original real-time image into a YUV color gamut; and
[0021] When the original real-time image is a black-and-white image, a grayscale value of the original real-time image is obtained.
[0022] In one embodiment of the present invention, the step of obtaining the average brightness includes:
[0023] When the original real-time image is a color image, obtaining the average brightness according to the brightness component of the current pixel row; and
[0024] When the original real-time image is a black and white image, the average brightness is obtained according to the grayscale value of the current pixel row.
[0025] In one embodiment of the present invention, the step of adjusting the exposure parameters includes:
[0026] Acquire a target brightness range of the current pixel row according to the pixel area where the current pixel row is located;
[0027] Comparing the target brightness range with the average brightness, obtaining a brightness compensation amount of the current pixel row, wherein the brightness compensation amount is related to an exposure time compensation amount of the current pixel row; and
[0028] The exposure time adjustment step length of the current pixel row is calculated according to the brightness compensation amount.
[0029] In one embodiment of the present invention, the step of setting the exposure time adjustment step size includes:
[0030] Setting a step size threshold range and a unit step size for adjusting the exposure time, wherein a minimum value of the step size threshold range is the unit step size, and a maximum value of the step size threshold range is 1 / 16 of the current exposure time; and
[0031] The exposure time adjustment step length is selected within the step length threshold range according to the brightness compensation amount, wherein the brightness compensation amount and the exposure time adjustment step length are positively correlated.
[0032] In one embodiment of the present invention, in the step of setting the exposure time adjustment step, when the exposure time adjustment step exceeds the exposure threshold range, the exposure time adjustment step is the unit step or the step upper limit of the exposure threshold range.
[0033] In one embodiment of the present invention, the step of adjusting the exposure parameter of the current pixel row includes:
[0034] Obtaining an adjusted exposure time of the current pixel row in a next frame of image according to the current exposure time and the exposure time adjustment step; and
[0035] When acquiring the next frame of the original real-time image, the exposure position of each pixel row is reordered according to the adjusted exposure time.
[0036] The present invention provides an image automatic exposure control system, which is electrically connected to an image sensor module, wherein the image sensor module is used to obtain exposure time and obtain an original real-time image of a current frame. The image automatic exposure control system includes:
[0037] A color gamut conversion module, used for performing color gamut conversion on the original real-time image;
[0038] a brightness calculation module, used to obtain the average brightness of each pixel row in the current frame image; and
[0039] A parameter adjustment module is used to obtain a brightness threshold range. If the average brightness of the current pixel row is outside the brightness threshold range, the exposure parameters of the current pixel row are adjusted, and the next frame of the original real-time image of the current pixel row is obtained with the adjusted exposure parameters. If the average brightness of the current pixel row is within the brightness threshold range, the next frame of the original real-time image of the current pixel row is obtained with the current exposure parameters.
[0040] As described above, the present invention provides an automatic image exposure control method and system, which can realize the image exposure adaptability of the image obtained by the rolling shutter exposure method in high-contrast environments such as bright field, dark field, especially local bright field, local dark field, etc., thereby ensuring the richness and completeness of the image information and avoiding the problem of image brightness oscillation.
[0041] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0043] Figure 1 FIG. 4 is a schematic diagram of the structure of an image sensor in one embodiment of the present invention.
[0044] Figure 2 FIG. 4 is a schematic diagram of time-division multiplexing signals for readout row control and exposure row control in one embodiment of the present invention.
[0045] Figure 3 FIG. 4 is a schematic diagram of timing control waveforms of five consecutive rows of pixels in one embodiment of the present invention.
[0046] Figure 4 FIG. 4 is a flow chart of an automatic exposure control method according to an embodiment of the present invention.
[0047] Figure 5 FIG. 4 is a schematic diagram of partitioning of a pixel array in an embodiment of the present invention.
[0048] Figure 6 Schematic diagram of the exposure and readout timing of the first frame of original real-time image in one embodiment of the present invention.
[0049] Figure 7 Schematic diagram of the exposure and readout timing of the x+1th frame of the original real-time image in one embodiment of the present invention.
[0050] Figure 8FIG. 1 is a schematic diagram of the structure of an automatic exposure control system in one embodiment of the present invention.
[0051] In the figure: 100, image sensor; 101, pixel array; 102, register and timing control circuit; 103, vertical scanning circuit; 104, readout circuit; 105, horizontal scanning circuit; 106, output interface; 200, image automatic exposure control system. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] Global exposure and rolling shutter exposure are two exposure modes of CMOS image sensors. Rolling shutter exposure is to expose and read out row by row. Since the readout position is fixed in the frame, the exposure time of each row of pixels depends entirely on its exposure position in the frame. The closer the exposure position is to the readout position, the shorter the exposure time of the sensor. In consumer application scenarios, rolling shutter exposure can provide good image quality and performance while meeting the needs of practical applications. The lighting environment in different environments is also different. By automatically adjusting the exposure parameters by the image sensor, the richness and completeness of the image information in different environments can be ensured. Therefore, automatic exposure is crucial for application fields such as security monitoring, autonomous driving, and medical imaging.
[0054] The present invention provides an automatic image exposure control method and system. Figure 1 As shown, the present invention obtains the original real-time image through the image sensor 100. The image sensor 100 includes a pixel array 101, a register and timing control circuit 102, a vertical scanning circuit 103, a readout circuit 104, a horizontal scanning circuit 105, an output interface 106, and an automatic exposure control 200. Figure 1 As shown, the pixel array 101 includes a plurality of pixel units, and the plurality of pixel units are distributed in an array form. The exposure and readout actions of the image sensor 100 are controlled by a register and timing control circuit 102 and a vertical scanning circuit 103. Specifically, the register and timing control circuit 102 generates the row number to be exposed and the row number to be read out, as well as the control timing of the pixel unit according to the register configuration. Figure 2 and 3As shown, the vertical scanning circuit 103 decodes the readout row number and the exposure row number, and selects the corresponding row. The vertical scanning circuit 103 performs level conversion on the control timing of the pixel unit of the corresponding row, and sends the control timing after level conversion to the corresponding pixel row. Figure 3 As shown, the readout operation and exposure operation adopt a time division multiplexing (TDM) system to save hardware overhead. Among them, the pixel data passes through the readout circuit 104 to the horizontal scanning circuit 105, and the horizontal scanning circuit 105 reads the pixel data one by one. Specifically, the horizontal scanning circuit 105 sends the pixel data to the image automatic exposure control system 200 and the output interface 106 respectively, and outputs the pixel data through the output interface 106.
[0055] See also Figures 1 to 3 As shown, in one embodiment of the present invention, in the image sensor 100, the pixel rows are exposed according to the row numbers of the pixel rows, and then the pixel data of the pixel rows are read out in sequence according to the row numbers of the pixel rows. The row number of the pixel row currently exposed is the exposure row number, and the row number of the pixel row currently read out is the readout row number. Figure 3 A timing control schematic diagram is shown. LO_SEL(m) represents the gating condition of the pixel row with row number m. For example, when LO_SEL(m) is at a high level, the corresponding pixel row is gating, and when LO_SEL(m) is at a low level, the corresponding pixel row is not gating. LO_RX(m) represents the reset condition of the pixel row with code name m. For example, when LO_RX(m) is at a high level, the corresponding pixel row is reset. LO_TX(m) represents the charge transfer condition of the corresponding pixel row. For example, when LO_TX(m) is at a high level, data can be read out of the corresponding pixel row. It should be noted that the timing diagram provided by the present invention is only to help explain how the pixel array 101 works under timing control, and does not limit the working mode of the image sensor 100 of the present invention. The present invention does not limit the working timing of each transistor.
[0056] See also Figure 4 As shown, the present invention provides an automatic image exposure control method, based on the image sensor 100, to automatically adjust the exposure time of each row of pixels. The automatic image exposure control method includes steps S10 to S50.
[0057] Step S10: Obtain the brightness threshold range and exposure time to obtain the original real-time image.
[0058] Step S20: Perform color gamut conversion on the original real-time image to obtain the brightness component of the current frame image.
[0059] Step S30: Obtain the average brightness of each pixel row in the current frame image.
[0060] Step S40: If the average brightness of the current pixel row is outside the brightness threshold range, adjust the exposure parameters of the current pixel row, and obtain the next frame of the original real-time image of the current pixel row with the adjusted exposure parameters.
[0061] Step S50: If the average brightness of the current pixel row is within the brightness threshold range, the next frame of the original real-time image of the current pixel row is obtained with the current exposure parameters.
[0062] See also Figure 1 and Figure 4 As shown, in one embodiment of the present invention, in step S10, the brightness threshold range is determined by the first threshold and the second threshold. In this embodiment, the first threshold is set as the upper limit of the brightness threshold range, and the second threshold is set as the lower limit of the brightness threshold range. It should be noted that in the automatic exposure control method provided by the present invention, the second threshold and the first threshold are fixed values and do not change with the change of the exposure parameters. If there is an environmental adaptation requirement, the second threshold and the first threshold can be manually adjusted. In step S10, the exposure time is a preset exposure time, which is used for the exposure of the first frame of the image of the image sensor 100. In this embodiment, the image sensor 100 can acquire an image through all effective pixels or a region of interest (Range Of Interest, ROI). The number of pixels used to acquire the image is related to the resolution of the image sensor 100. In step S10, the original real-time image is acquired in frames, and after each frame of the original real-time image is acquired, the automatic exposure control method of the present invention is executed to obtain the exposure parameters of the current pixel row of the next frame of the image. In this embodiment, the original real-time image can be a color image or a black and white image.
[0063] See also Figure 1 , Figure 4 and Figure 5 As shown, in one embodiment of the present invention, in step S10, the pixel array 101 is divided into a plurality of pixel regions. In this embodiment, the pixel array 101 is divided into, for example, three pixel regions along the longitudinal direction. Figure 5As shown, the pixel array 101 includes a first area 1011, a second area 1012 and a third area 1013. The number of pixel rows in the first area 1011, the second area 1012 and the third area 1013 is equal. The brightness threshold range of each area can be the same or different. In this embodiment, the second area 1012 is located between the first area 1011 and the third area 1013. In this embodiment, the brightness threshold range includes an action threshold range and a steady-state threshold range, and the action threshold range can be greater than or equal to the steady-state threshold range. The action threshold range is determined by the third threshold and the fourth threshold, and the steady-state threshold range is determined by the first threshold and the second threshold. The action threshold range of the first area 1011 is [Hact_th1, Lact_th1], and the steady-state threshold range of the first area 1011 is [Hlock_th1, Llock_th1]. The action threshold range of the second region 1012 is [Hact_th2, Lact_th2], and the steady-state threshold range of the second region 1012 is [Hlock_th2, Llock_th2]. The action threshold range of the third region 1013 is [Hact_th3, Lact_th3], and the steady-state threshold range of the third region 1013 is [Hlock_th3, Llock_th3]. In this embodiment, the steady-state threshold range is within the action threshold range, and the specific steady-state threshold range is a subset of the action threshold range.
[0064] See also Figure 1 , Figure 4 and Figure 5 As shown, in one embodiment of the present invention, in step S10, it should be noted that in other embodiments of the present invention, according to different application scenarios or different requirements, the pixel array 101 can also be divided into, for example, 2 areas, for example, 4 areas, etc., and the present invention does not limit the specific number of pixel arrays 101. In this embodiment, the external host can control the image sensor 100 by configuring registers. Specifically, by inputting different values to the registers, the brightness threshold ranges of different areas in the pixel array 101 can be adjusted.
[0065] See also Figure 1 , Figure 4 , Figure 6 and Figure 7 As shown, in one embodiment of the present invention, in step S10, when acquiring the first frame of the original real-time image, the pixel rows are sequentially exposed and read according to the row numbers of the pixel rows. Figure 6As shown, the pixel rows with row numbers m, m+1 to m+15 participate in exposure and are read out in sequence, wherein the exposure time of each pixel row is equal. It should be noted that the exposure time of each pixel row is equal, and the acquisition of the first original real-time image defined here, that is, when the image sensor 100 works to acquire the first frame of effective image, the exposure time of each pixel row is equal. When the image sensor 100 acquires the second frame and subsequent images, the exposure time of each pixel row may be equal or unequal. When acquiring the original real-time image, each pixel row participates in exposure in the configured row number sequence and is read out in sequence. It should be noted that participating in exposure in the configured row number sequence means that the exposure sequence of multiple pixel rows can be performed in the row number sequence or not in accordance with the row number. It should be noted that the row number sequence of the first frame exposure is the default sequence, that is, the exposure action is performed in sequence from the first row to the last row, and starting from the second frame, the row number sequence of exposure is given by the automatic exposure control system.
[0066] See also Figure 1 , Figure 4 , Figure 6 and Figure 7 As shown, in one embodiment of the present invention, in step S10, one pixel row is exposed at the same time, specifically, only the pixel rows with the configured row numbers are exposed. Figure 6 As shown, when pixel row m is read out, pixel rows m+1 to pixel rows m+15 are still within the exposure time. After the exposure of the xth frame image is completed, the exposure of the x+1th frame image can be started. It should be noted that the reading work of different pixel rows is performed in sequence. For the same pixel row, the exposure action is performed first, and then the reading action is performed.
[0067] See also Figure 1 and Figure 4 As shown, in one embodiment of the present invention, in step S20, the original real-time image is converted from the original color gamut to the YUV domain. In this embodiment, the original color gamut can be an RGB domain, wherein the RGB domain is an RGB color mode, and R, G, and B correspond to the red component, green component, and blue component of the original real-time image, respectively. The YUV domain corresponds to the brightness perception and chromaticity perception of the human eye. Among them, Y corresponds to the brightness component of the original real-time image. U corresponds to the hue component of the original real-time image, which is related to the peak value of the light wave to describe the color of the light. V corresponds to the color saturation component of the original real-time image, which is related to the width of the spectrum to describe the purity of the light. In step S20, the calculation of the color gamut conversion of the original real-time image is based on formulas (1) to (3).
[0068] Y=0.299R+0.587G+0.114B (1).
[0069] U = 0.492 (BY) + 128 (2).
[0070] V = 0.877 (RY) + 128 (3).
[0071] In equations (1) to (3), R, G, and B correspond to the red component, green component, and blue component of the original real-time image, respectively. Y is the brightness component of the original real-time image, U is the hue component of the original real-time image, and V is the color saturation component of the original real-time image.
[0072] See also Figure 1 and Figure 4 As shown, in one embodiment of the present invention, in step S20, if the original real-time image is a black-and-white image, the color gamut conversion step can be skipped to directly obtain the grayscale value of the original real-time image. The grayscale value is used for the average brightness calculation in step S30.
[0073] See also Figure 1 and Figure 4 As shown, in one embodiment of the present invention, in step S30, the average brightness of each pixel row in the current frame image is obtained row by row. The average brightness is obtained according to formula (4).
[0074]
[0075] In formula (4), Y i is the brightness value of the i-th row, M and N are the number of pixel rows and pixel columns of the image respectively, and y(i, j) is the Y component value of the pixel in the i-th row and j-th column.
[0076] See also Figure 1 and Figure 4 As shown, in one embodiment of the present invention, in step S30, the brightness component of each pixel row is counted. Specifically, the brightness component of each pixel unit in the pixel row is accumulated and processed to obtain the total brightness. According to the total brightness and the number of pixel units in the pixel row, the average brightness of the pixel row is obtained. If in step S20, the original real-time image is a black and white image, the average grayscale value of the pixel row is directly used as the average brightness of the current frame image.
[0077] See also Figure 1 and Figure 4 As shown, in one embodiment of the present invention, in step S40, the average brightness of the current pixel row is compared with the brightness threshold range. If the average brightness is within the brightness threshold range, the current exposure time is reasonable. More specifically, in step S40, if the average brightness of the current pixel row is within the action threshold range, the current exposure time is reasonable. Therefore, the exposure time of the current pixel row can continue to be used, and when acquiring the next frame of the original real-time image of the current pixel row, the exposure time of the current frame image is used.
[0078] See also Figure 1 , Figure 4 and Figure 5 As shown, in one embodiment of the present invention, in step S50, if the average brightness is outside the brightness threshold range, the exposure time of the current pixel row is unreasonable. More specifically, if the average brightness is outside the action threshold range, the exposure time of the current pixel row is unreasonable. Therefore, the exposure time of the current pixel row is adjusted. In the step of adjusting the exposure time, the target brightness range of the current pixel row is first obtained. The steady-state threshold range is used as a reference for the target brightness range of the current pixel row. In this embodiment, the target brightness range of the current pixel row is the average value range of the second threshold and the first threshold. Taking the pixel row of the first area 1011 as an example, the target brightness range of the pixel row in the first area 1011 is in the range of (Hlock_th1+Llock_th1) / 2. The actual brightness of the pixel row is the average brightness. According to the difference between the average brightness and the actual brightness of the pixel row, the brightness compensation amount is obtained. According to the brightness compensation amount, the exposure time is adjusted. In this embodiment, the larger the brightness compensation amount, the larger the adjustment amount of the exposure time.
[0079] See also Figure 1 , Figure 4 and Figure 5 As shown, in one embodiment of the present invention, in step S50, in the step of adjusting the exposure parameters, the brightness compensation amount and the exposure time compensation amount are positively correlated. The larger the brightness compensation amount, the larger the exposure time compensation amount. The smaller the brightness compensation amount, the smaller the exposure time compensation amount. In this embodiment, a comparison table of the brightness compensation amount and the exposure time compensation amount is set according to the experiment, or a correlation function is established between the brightness compensation amount and the exposure time compensation amount. According to the brightness compensation amount of the current pixel row, the exposure time adjustment step length of the current pixel row is obtained.
[0080] See also Figure 1 , Figure 4 and Figure 7 As shown, in one embodiment of the present invention, in step S50, the exposure time adjustment step has a step threshold range and a unit step. The unit step is the minimum step of the exposure time adjustment step, and the specific unit step is the lower limit of the step threshold range. The upper limit of the step threshold range is the maximum step of the exposure time adjustment step. In this embodiment, the maximum value of the step threshold range is 1 / 16 of the current exposure time. The step threshold range may be different between images of different frames. The step threshold range may be different between different pixel rows of the same frame image. In the same frame image, the exposure time compensation amount and exposure time adjustment step of different pixel rows may be different.
[0081] See also Figure 1 , Figure 4 and Figure 7As shown, in one embodiment of the present invention, in step S50, for the same frame image, the row number sequence of the pixel rows is used as the readout sequence of the pixel rows. In this embodiment, in one frame, the readout sequence of a row of pixels is fixed, and the exposure time of each row of pixels is controlled by adjusting the exposure timing of each row of pixels. It should be noted that in this embodiment, when the readout sequence is determined, the exposure time of different pixel rows may be different, so the exposure sequence of the pixel rows may be different from the pixel row number sequence. Figure 7 As shown, from pixel row m to pixel row m+15, the exposure positions of multiple pixel rows are disordered. Specifically, after determining the readout time point, the exposure position of the current pixel row is determined according to the readout time point and the exposure time. It should be noted that only one pixel row is exposed at the same time. Therefore, in step S50, the exposure position of the pixel row is obtained, and the pixel rows are exposed in sequence according to the order of the exposure positions of the pixel rows. It should be noted that in step S50, when the exposure time adjustment step exceeds the step threshold range, it is adjusted with the maximum step or unit step to avoid sudden changes in image brightness. Specifically, when the exposure time adjustment step is greater than the upper limit value of the step threshold range, the upper limit value of the step threshold range is used as the exposure time adjustment step. When the exposure time adjustment step is less than the unit step, the unit step is used as the exposure time adjustment step.
[0082] See also Figure 1 , Figure 4 and Figure 7 As shown, in one embodiment of the present invention, in step S50, the compensation amount of each pixel row to the optimal exposure time may be different, and the exposure time is adjusted only once in each frame. Through the adjustment of multiple frames, the exposure time of the pixel row is made close to the optimal exposure time frame by frame, and finally reaches the optimal exposure time. It should be noted here that in the process of adjusting the pixel row to the optimal exposure time, the value of the optimal exposure time is variable and not a fixed value. According to the working environment of the image sensor 100, the optimal exposure time can be constantly changing. And it should be noted that after reaching the optimal exposure time, the next frame of image still implements the automatic exposure control method provided by the present invention, continues to calculate the average brightness, and determines whether the exposure time of the current frame of image is optimal. The automatic exposure control method provided by the present invention is implemented in the entire working process of the image sensor 100, and is applied to obtain each frame of image except the first frame of image.
[0083] It should be noted that, in the present invention, the target brightness range used when adjusting the exposure parameters is based on the steady-state threshold range, so the optimal exposure time is within the steady-state threshold range. The action threshold range is the brightness threshold range that triggers the exposure parameter adjustment, and the steady-state threshold range is the brightness threshold range that triggers the stop of the exposure parameter adjustment. For example, when the current pixel row reaches the optimal exposure time, the current exposure time of the current pixel row is maintained if the average brightness does not exceed the action threshold range. If the current pixel row exceeds the action threshold range, the exposure parameter adjustment of the current pixel row is started until the average brightness of the current pixel row returns to the threshold range, and the exposure parameter adjustment of the current pixel row is stopped.
[0084] See also Figure 1 , Figure 4 and Figure 7 As shown, in one embodiment of the present invention, in step S50, after the exposure time calculation of all pixel rows is completed, the exposure time of each row is sorted using a sorting algorithm to determine the exposure timing of each pixel row in the next frame. Among them, for rows with the same exposure time, they are sorted according to the size of the row number. Since the pixel data must be an integer and the range is fixed, a counting sort algorithm is used in this embodiment. The counting sort algorithm is a stable, non-comparative algorithm that counts the number of occurrences of each element and then rearranges the data according to the statistical information. It is applicable to integer data within a certain range, and the sorting speed is faster than any comparison sorting algorithm. The time complexity of counting sort is O(n+k), where n is the size of the array to be sorted, and k is the value range of the data to be sorted. For example, for 10-bit data generated by a 1920*1080 pixel array, the time complexity is 2104 clock cycles, and the sorting can be completed during the frame blanking period of 2 rows. Therefore, the sorting time for the pixel rows is extremely short, and the exposure of the next frame can be started quickly, thereby leaving more time for exposure.
[0085] See also Figure 1 , Figure 4 and Figure 8As shown, in one embodiment of the present invention, the image automatic exposure control system 200 is electrically connected to the image sensor module 201. The image automatic exposure control system 200 includes a color gamut conversion module 202, a brightness calculation module 203 and a parameter adjustment module 204. In this embodiment, the image sensor module 201 is combined with the register and the timing control circuit 102 to set the brightness threshold range and the exposure time, and obtain the original real-time image of the current frame. The color gamut conversion module 202 is used to perform color gamut conversion on the original real-time image to obtain the current frame image. The brightness calculation module 203 is used to obtain the average brightness of each pixel row in the current frame image row by row. If the average brightness of the current pixel row is outside the brightness threshold range, the parameter adjustment module 204 is used to obtain the brightness threshold range, and adjust the exposure parameters of the current pixel row, and obtain the next frame of the original real-time image of the current pixel row with the adjusted exposure parameters. If the average brightness of the current pixel row is within the brightness threshold range, the parameter adjustment module 204 obtains the next frame of the original real-time image of the current pixel row with the current exposure parameters.
[0086] The embodiments of the present invention disclosed above are only used to help illustrate the present invention. The embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. An automatic image exposure control method, characterized in that: The following steps are involved: Get the brightness threshold range and exposure time; Get the original real-time image of the current frame; Performing color gamut conversion on the original real-time image to obtain a brightness component of the current frame image; Obtaining the average brightness of each pixel row in the current frame image; If the average brightness of the current pixel row is outside the brightness threshold range, adjusting the exposure parameter of the current pixel row, and acquiring a subsequent frame of the original real-time image of the current pixel row with the adjusted exposure parameter; as well as If the average brightness of the current pixel row is within the brightness threshold range, the next frame of the original real-time image of the current pixel row is acquired with the current exposure parameters.
2. The method for automatic image exposure control according to claim 1, characterized in that: The step of acquiring the original real-time image comprises: Acquire effective pixel units or regions of interest of an image sensor; and Pixel data of the original real-time image is acquired from the effective pixel unit or the region of interest.
3. The method for automatic image exposure control according to claim 1, characterized in that: The steps to set the brightness threshold range include: Dividing a pixel array into a plurality of pixel regions, wherein brightness threshold ranges of the pixel regions are configured by independent registers; and A value is input into the register to simultaneously set the brightness threshold range of a plurality of the pixel regions.
4. The method for automatic image exposure control according to claim 1, characterized in that: The step of performing color gamut conversion on the original real-time image comprises: Determining whether the original real-time image is a color image; When the original real-time image is a color image, converting the color gamut of the original real-time image into a YUV color gamut; and When the original real-time image is a black-and-white image, a grayscale value of the original real-time image is obtained.
5. The method for automatic image exposure control according to claim 4, characterized in that: The step of obtaining the average brightness includes: When the original real-time image is a color image, obtaining the average brightness according to the brightness component of the current pixel row; and When the original real-time image is a black and white image, the average brightness is obtained according to the grayscale value of the current pixel row.
6. The method for automatic image exposure control according to claim 1, characterized in that: The step of adjusting the exposure parameters comprises: Acquire a target brightness range of the current pixel row according to the pixel area where the current pixel row is located; Comparing the target brightness range with the average brightness, obtaining a brightness compensation amount of the current pixel row, wherein the brightness compensation amount is related to an exposure time compensation amount of the current pixel row; and The exposure time adjustment step length of the current pixel row is calculated according to the brightness compensation amount.
7. The method for controlling automatic image exposure according to claim 6, characterized in that: The step of setting the exposure time adjustment step size comprises: Setting a step size threshold range and a unit step size for adjusting the exposure time, wherein a minimum value of the step size threshold range is the unit step size, and a maximum value of the step size threshold range is 1 / 16 of the current exposure time; and The exposure time adjustment step length is selected within the step length threshold range according to the brightness compensation amount, wherein the brightness compensation amount and the exposure time adjustment step length are positively correlated.
8. The method for controlling automatic image exposure according to claim 7, characterized in that: In the step of setting the exposure time adjustment step, when the exposure time adjustment step exceeds the exposure threshold range, the exposure time adjustment step is the unit step or the step upper limit of the exposure threshold range.
9. The method for controlling automatic image exposure according to claim 1, characterized in that: The step of adjusting the exposure parameters of the current pixel row comprises: Obtaining an adjusted exposure time of the current pixel row in a next frame of image according to the current exposure time and the exposure time adjustment step; and When acquiring the next frame of the original real-time image, the exposure position of each pixel row is reordered according to the adjusted exposure time.
10. An image automatic exposure control system, electrically connected to an image sensor module, wherein the image sensor module is used to obtain exposure time and obtain the original real-time image of the current frame, characterized in that: The image automatic exposure control system comprises: A color gamut conversion module, used for performing color gamut conversion on the original real-time image; a brightness calculation module, used to obtain the average brightness of each pixel row in the current frame image; and A parameter adjustment module is used to obtain a brightness threshold range. If the average brightness of the current pixel row is outside the brightness threshold range, the exposure parameters of the current pixel row are adjusted, and the next frame of the original real-time image of the current pixel row is obtained with the adjusted exposure parameters. If the average brightness of the current pixel row is within the brightness threshold range, the next frame of the original real-time image of the current pixel row is obtained with the current exposure parameters.
