Rapid 2A adjustment method for automatically positioning region of interest
By pre-calibrating the camera's light sensitivity curve and selecting the region of interest, the problem of slow exposure and gain adjustment speed in dynamic scenes is solved, enabling fast and accurate image grayscale adjustment, and improving image quality and system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies suffer from slow automatic exposure and gain adjustment in dynamic scenes, leading to image blurring or abnormal exposure, which affects detection accuracy. Furthermore, traditional methods struggle to quickly stabilize brightness, resulting in system instability and making it difficult to fully display detailed information of the region of interest in scenes with a large dynamic range.
By pre-calibrating the camera's light sensitivity curve, selecting the region of interest, determining the 2A statistical region using histograms and gradient judgment, and selecting appropriate image frames for exposure or gain adjustment based on the exposure timing under different exposure modes, combined with grayscale prediction methods, a single frame can be quickly adjusted to the target grayscale value.
It achieves precise adjustment of the region of interest, significantly improves the adjustment speed and image quality of 2A, enhances system stability and processing efficiency, and reduces adjustment time.
Smart Images

Figure CN121665119A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image acquisition technology, and in particular to a fast 2A adjustment method for automatically locating regions of interest. Background Technology
[0002] Automatic 2A adjustment in industrial cameras refers to the camera's function of automatically adjusting exposure or gain to achieve the desired grayscale value in an image. The speed of automatic exposure and automatic gain adjustment is crucial. In dynamic scenes, such as detecting high-speed moving objects, slow adjustment can easily lead to image blurring or abnormal exposure as the object moves, affecting detection accuracy. In the event of sudden changes in lighting, rapid adjustment can quickly stabilize brightness and reduce algorithmic misjudgments. Moreover, fast and stable 2A adjustment enhances system stability, preventing production interruptions due to imaging problems and ensuring smooth and efficient industrial production processes. When shooting scenes with a large dynamic range, such as cell morphology detection, back-illuminated light sources are often used. This lighting method significantly increases the grayscale difference between the background and cells. If grayscale values are directly calculated for the entire image, the detailed information of the cells will be difficult to fully display. Therefore, it is necessary to accurately identify and extract the areas of interest to the user.
[0003] In most sensors, the light sensitivity curve exhibits a linear characteristic. Specifically, when the external environment is stable, if the exposure time increases proportionally, the grayscale value of the image will also increase proportionally. However, it is worth noting that some sensors possess more powerful functions, supporting high dynamic range (HDR), gamma correction, and non-linear transformation functions such as lookup tables (LUTs). This can lead to oscillations or slow speeds in 2A adjustment. Therefore, calibrating the camera's light sensitivity curve in advance can quickly determine the relationship between image grayscale values and exposure time during adjustment.
[0004] In addition, in image processing algorithms, 2A adjustments are based on the current frame before the calculation of the next frame can be performed. Most cameras require adjustments every two frames, resulting in too many frames for automatic exposure or gain adjustment. Summary of the Invention
[0005] This invention discloses a fast 2A adjustment method that supports precise adjustment of the region of interest. The fast 2A adjustment method that supports precise adjustment of the region of interest includes the following steps:
[0006] Step 1: Select the region of interest based on the current image;
[0007] Step 2: Pre-calibrate the current camera's light sensitivity curve;
[0008] Step 3: The sensor sets the exposure or exposure prediction based on the effective time of different modes, and adjusts it to the target grayscale value;
[0009] Step 3 also includes the following steps:
[0010] Step 31, based on the sensor exposure mode and setting the exposure timing, is divided into 4 cases;
[0011] The four situations include:
[0012] Output the current frame image for grayscale value statistics;
[0013] Estimate the image grayscale value corresponding to the current frame's exposure time;
[0014] The current frame is discarded, and the image corresponding to the exposure time of the next frame is output for grayscale value statistics.
[0015] The current frame is discarded, and the image grayscale value corresponding to the exposure time of the next frame is estimated.
[0016] Step 32: Calculate the exposure time of the next frame based on the exposure timing.
[0017] Step 33: Repeat the adjustment in step 32 until the image is adjusted to the target grayscale value as determined by the FPGA statistical grayscale value.
[0018] Furthermore, in step 1, selecting the region of interest includes using histogram statistics to determine the 2A statistical region and using gradient judgment to select non-uniform regions;
[0019] Determining the statistical region 2A using histogram statistics includes the following steps:
[0020] In the image, locate pixels with gray values greater than 20 and less than 230 in non-flat regions; select n% of the pixels before or after as the region of interest.
[0021] Using gradient judgment to select non-uniform regions includes the following steps:
[0022] Convolution is performed between a template and the image, and points with larger gradients are selected as the 2A statistical regions. The template includes, but is not limited to, the Laplacian operator.
[0023] ;
[0024] ;
[0025] ImageBlock is a 5x5 pixel area. This is the result of multiplying the image block by the template. For templates;
[0026] The 2A statistical region is defined as all pixels whose gradient Diff is greater than a threshold as the region of interest.
[0027] Furthermore, in step 2, the photosensitivity curve of the sensor is pre-calibrated to obtain a function that can be fitted to describe the changes in the photosensitivity curve: , For exposure time or gain, Let the image grayscale value be the inverse function; further, calculate the inverse function of this function: .
[0028] Furthermore, step 31 also includes the following steps:
[0029] Step 311, the exposure timing includes three cases: before the exposure of the current frame image, during the exposure of the current frame image, and during the readout of the current frame image;
[0030] When the exposure time is set before the exposure, the image output in this frame is the image exposed at the current exposure time. In this case, the current frame image is used to count grayscale values.
[0031] When the exposure setting is in progress, the current frame image has already started to be exposed. The exposure duration is the exposure time of the previous frame. The grayscale value of the current frame image corresponds to the previous exposure value, not the exposure value set this time. In this case, the grayscale value of the image corresponding to the current exposure time is estimated.
[0032] When the exposure setting is in the readout phase, the exposure time of the current frame is the same as the previous exposure time, and some pixel grayscale values have already been read out. It is impossible to estimate the grayscale values of pixels that have already been read out in the region of interest. In this case, the current frame is discarded, but the grayscale values of the next frame correspond to the exposure time and can be used to count the grayscale values.
[0033] Furthermore, step 31 also includes the following steps:
[0034] Step 312, setting the exposure timing includes four cases: before the exposure of the current frame image, before the readout of the current frame image, during the readout of the current frame image and before the exposure of the next frame image, and during the readout of the current frame image and during the exposure of the next frame image.
[0035] The exposure time is set before the exposure of the current frame image. The current frame image corresponds to the current exposure time. In this case, the current frame image is output for the purpose of calculating grayscale values.
[0036] When the exposure occurs before the current frame image is read out, the current frame image has already finished being exposed, the exposure time is the exposure time of the previous frame, and the grayscale value of the current frame image corresponds to the value of the previous exposure time rather than the value of the current exposure time. In this case, the grayscale value of the image corresponding to the current frame exposure time is estimated.
[0037] When the exposure timing is set during the reading of the current frame image and before the exposure of the next frame image, the exposure time of the image output in the current frame is the exposure time of the previous one, and some pixel gray values have already been read. It is impossible to estimate the gray values of pixels that have already been read in the region of interest. In this case, the current frame is discarded, and the image corresponding to the exposure time of the next frame is output for the purpose of statistical gray value.
[0038] When the exposure timing is set during the reading of the current frame and the exposure of the next frame, the exposure time of the output image of the current frame is the exposure time of the previous frame, and some pixel grayscale values have already been read. It is impossible to estimate the grayscale values of pixels that have already been read in the region of interest, and the next frame has already started to be exposed. In this case, the current frame is discarded, and the grayscale value of the image corresponding to the exposure time of the next frame is estimated.
[0039] Furthermore, step 31 also includes the following steps:
[0040] Step 313: Since it is uncertain when the sensor will take effect, but it is guaranteed that the second frame will definitely take effect, the current frame is discarded directly in this case, and the next frame image is obtained for grayscale value statistics.
[0041] When adjusting gain, it is impossible to determine the precise timing of the effect. This can be divided into the following two situations:
[0042] Digital gain adjustment: After setting the gain, it will take effect in the current frame, and the current frame image is used to count grayscale values;
[0043] Adjusting the gain through simulation: After setting the gain, it may not take effect in the current frame, but it will definitely take effect in the next frame. The image of the next frame is used to count the grayscale values.
[0044] Furthermore, step 32 also includes the following steps:
[0045] Step 321: For the case of obtaining the actual image of the current frame, obtain the statistical grayscale value;
[0046] Step 322: For cases where the current exposure time does not correspond to the image grayscale value, obtain the estimated grayscale value;
[0047] Step 323: Calculate the exposure time of the next frame by statistically analyzing or estimating the grayscale value of the current frame.
[0048] Furthermore, in step 321, for the case of acquiring the actual image of the current frame, the FPGA counts the gray values of all pixels in the region of interest; after counting pixel by pixel, the estimated pixel gray values of the region of interest are accumulated and the average gray value is calculated and passed to the firmware as the statistical gray value.
[0049] Furthermore, in step 322, for cases where grayscale values need to be estimated based on exposure time, the exposure time of the current image remains the same as the previous exposure time. Calculate the grayscale value of each pixel in the current target area. The exposure time is estimated using the pre-calibrated photosensitive profile. When effective, the estimated grayscale values of each pixel in the target area are calculated. :
[0050] ;
[0051] Exposure time of the current frame The corresponding image grayscale value is estimated.
[0052] The FPGA performs point-by-point evaluation of the region of interest, evaluating the side length S of the region and the corresponding maximum grayscale value at the bit depth. The maximum value for 8 bits is 255, which is the maximum threshold. minimum threshold , ;
[0053] The evaluation region traverses all pixels in the region of interest, assuming the current image... Let C be the gray value of the pixel at position [i,j]. Let V be the set of gray values of other pixels within a range S×S centered on C, representing the neighborhood gray value information of the current point. Classify the gray value set V by sorting it according to the gray value. ;
[0054] When C = When the maximum grayscale value of 255 is reached, obtain the minimum value in V. ,like Less than Estimate the gray value at position [i,j] in the image. ;like equal Estimate the gray value of the image at position [i,j]. When estimating the image grayscale value at [i,j] Then make ;
[0055] When C = When the minimum gray level is 0, predict the image gray level at location [i,j]. ;
[0056] After pixel-by-pixel estimation, the estimated pixel grayscale values of the region of interest are accumulated and the average grayscale value is calculated and passed to the firmware as the average grayscale value of the current image.
[0057] Furthermore, in step 323, the firmware calculates the exposure time or gain value that should be set next:
[0058] ;
[0059] For the exposure time or gain of the next frame, For the current exposure time or gain, For the target grayscale value, For FPGA statistics or grayscale value prediction, The damping coefficient is mainly used to prevent vibrations caused by environmental instability, and its value ranges from (0, 1).
[0060] The beneficial effects achieved by this invention are:
[0061] This invention innovatively proposes a grayscale prediction method based on center point neighborhood grayscale estimation. This method achieves efficient and accurate grayscale prediction by pre-calibrating the photosensitive curve and combining it with the actual grayscale value of the current pixel, thereby achieving the goal of completing 2A adjustment in as few frames as possible. Simultaneously, it also has the ability to perform targeted statistical adjustment on regions of interest. Compared with traditional methods, this method has significant advantages, not only greatly improving the speed of 2A adjustment but also achieving more precise grayscale value adjustment on regions of interest in the image, effectively enhancing image quality and processing efficiency. Attached Figure Description
[0062] Figure 1 A flowchart of a fast 2A adjustment method for automatically locating the region of interest;
[0063] Figure 2 This is a schematic diagram illustrating the exposure time and frame number for non-overlapping exposure modes.
[0064] Figure 3 This is a schematic diagram illustrating the exposure time and frame number of overlapping exposure modes.
[0065] Figure 4 A schematic diagram showing the number of frames for main mode overlapping and non-overlapping, and the analog gain implemented by the sensor;
[0066] Figure 5 A schematic diagram of the FPGA implementation of the number of frames for main mode overlapping and non-overlapping and sensor-based analog gain;
[0067] Figure 6 This diagram illustrates a comparison of adjusting the frame rate between the traditional approach and the approach of this invention. Detailed Implementation
[0068] The present invention will be further described below with reference to specific embodiments, and the advantages and features of the present invention will become clearer as a result. However, these embodiments are merely exemplary and do not constitute any limitation on the scope of the present invention. Those skilled in the art should understand that modifications or substitutions can be made to the details and form of the technical solutions of the present invention without departing from the spirit and scope of the present invention, but all such modifications and substitutions fall within the protection scope of the present invention.
[0069] like Figure 1 As shown, a fast 2A adjustment method supporting precise adjustment of the region of interest includes the following steps:
[0070] Step 1: Select the region of interest based on the current image; generally, a non-uniform region is selected.
[0071] Selecting regions of interest includes using histogram statistics to determine the 2A statistical region and using gradient judgment to select non-uniform regions;
[0072] Using histogram statistics to determine the 2A statistical region is effective in clearly distinguishing between background and foreground, such as in microscopes and indoor tracking vehicles. This method for locating background regions of interest has two advantages: adjustments better align with the expectations of subsequent algorithms, and it offers better stability in continuous mode.
[0073] Locating non-flat regions in an image requires two conditions:
[0074] Gray values greater than 20 and less than 230 (based on noise estimation, values greater than 230 will result in some saturation).
[0075] Statistical results for n% before or after the statistics.
[0076] Using gradient criterion, non-uniform regions are selected. A template is then convolved with the image, and points with larger gradients are chosen as the 2A statistical regions. The template includes, but is not limited to, the Laplacian operator.
[0077]
[0078]
[0079] ImageBlock is a 5x5 pixel area. This is the result of multiplying the image block by the template. This is a template.
[0080] The 2A statistical region is defined as all points where the gradient calculation Diff is greater than the threshold T, and these points are considered as regions of interest.
[0081] Step 2: Pre-calibrate the current camera's light sensitivity curve;
[0082] Given the above, in order to process image grayscale values more accurately and quickly, it is necessary to pre-calibrate the sensor's photosensitivity curve first. Through this process, a function describing the changes in the photosensitivity curve can be fitted, denoted as... , For exposure time or gain, This represents the image grayscale value. Subsequently, the inverse function of this function is calculated, i.e. These two functions will play an important role in the subsequent 2A adjustment.
[0083] Step 3: The sensor sets the exposure based on the effective timing of different modes, adjusting it to the target grayscale value;
[0084] Specifically, the following steps are included:
[0085] Step 31, based on the sensor exposure mode and setting the exposure timing, is divided into 4 cases;
[0086] Step 311, the exposure is set to a non-overlapping exposure mode;
[0087] like Figure 2 As shown, when the exposure is a non-overlapping mode exposure, the exposure timing includes three situations: before exposure, during exposure, and during readout.
[0088] When the exposure timing is before exposure, the current frame can set the accurate exposure time and acquire the current frame image. In this case, the current frame image is output for grayscale value statistics.
[0089] When the exposure time is in the process of exposure, the exposure time cannot be set in this frame. The exposure time of the previous frame can only be used. The gray value of the current frame image is the previous exposure value instead of the exposure value set this time. In this case, the gray value of the image corresponding to the current frame exposure time is estimated.
[0090] When the exposure timing is in readout, the exposure time cannot be set for this frame, nor can the current frame image be read out. In this case, the current frame is discarded, but the exposure time for the next frame can be set, and the image corresponding to the exposure time of the next frame is output for grayscale value statistics.
[0091] Step 312, the exposure is set to the mode overlap exposure mode;
[0092] like Figure 3 As shown, when the exposure is from the mode overlap exposure, the exposure timing includes four situations: before exposure and before readout, at the start of exposure and before readout, after exposure and during readout, and during exposure and during readout.
[0093] When the exposure timing is before exposure and before readout, the current frame can set the accurate exposure time and acquire the current frame image. In this case, the current frame image is output for grayscale value statistics.
[0094] When the exposure timing is before the start of exposure and readout, the exposure time cannot be set in this frame. The exposure time of the previous frame can only be used. The gray value of the current frame image corresponds to the value of the previous exposure time, not the value of the current exposure time. In this case, the gray value of the image corresponding to the current frame exposure time is estimated.
[0095] When the exposure timing is after exposure and during readout, the exposure time cannot be set in this frame, nor can the grayscale value of the current frame image be read. However, the exposure time of the next frame can be set. In this case, the current frame is discarded, and the image corresponding to the exposure time of the next frame is output for grayscale value statistics.
[0096] When the exposure time is in the process of exposure and readout, the current frame cannot set the exposure time, nor can the grayscale value of the current frame image be read out, and the next frame image still cannot set the exposure time. In this case, the current frame is discarded, and the grayscale value of the image corresponding to the exposure time of the next frame is estimated.
[0097] Step 313: Exposure is primarily in either overlapping or non-overlapping modes.
[0098] like Figure 4 As shown, in this mode, it is uncertain when the sensor will take effect, but it is guaranteed that the second frame will definitely take effect. Therefore, in this case, the current frame is discarded directly, and the next frame image is obtained for grayscale value statistics.
[0099] like Figure 5 As shown, when adjusting the gain, it is impossible to determine the precise timing of the effect. Specifically, this can be divided into the following two situations:
[0100] Digital gain adjustment: After setting the gain, it will take effect in the current frame, and the current frame image is used to count grayscale values;
[0101] Adjusting the gain through simulation: After setting the gain, it may not take effect in the current frame, but it will definitely take effect in the next frame. The image of the next frame is used to count the grayscale values.
[0102] Step 32: Obtain the exposure time of the next frame based on the exposure timing.
[0103] Based on the analysis of specific situations, grayscale calculation only involves two cases: statistically analyzing grayscale values from the read image and estimating grayscale values based on exposure time. The specific steps include:
[0104] Step 321: For the case of obtaining the actual image of the current frame, obtain the statistical grayscale value;
[0105] When acquiring the actual image of the current frame, the FPGA counts the gray values of all pixels in the region of interest; after counting pixel by pixel, the estimated pixel gray values of the region of interest are accumulated and the average gray value is calculated and passed to the firmware as the statistical gray value.
[0106] Step 322: For the case of estimating the image grayscale value corresponding to the exposure time of the next frame, obtain the estimated grayscale value;
[0107] For situations where grayscale values need to be estimated based on exposure time, the current image's exposure time remains the same as the previous exposure time. Calculate the grayscale value of each pixel in the current target area. The exposure time is estimated using a pre-calibrated function. The estimated grayscale values of each pixel in the target region when it takes effect as follows:
[0108]
[0109]
[0110] Due to the complexity of real-world image scenes, point-by-point statistics are performed on the FPGA, and overexposed points are specially processed to determine control parameters: the side length S of the evaluation area (usually an odd number), and the corresponding maximum grayscale value at the bit depth. The maximum value for 8 bits is 255, which is the maximum threshold. minimum threshold , .
[0111] Traverse all pixels in the region of interest. The grayscale value of the current pixel as the center is denoted as C. The grayscale values of other pixels within its S×S range are used as the neighborhood grayscale information set of the current point, denoted as V (V does not contain C). The grayscale set V is then classified and sorted according to the grayscale value. .
[0112] When C = When the maximum grayscale value of 255 is reached, obtain the minimum value in V. ,like Less than Estimate the gray value of the image at position [i,j]. ;like equal Estimate the gray value of the image at position [i,j]. When estimating the image grayscale value at [i,j] Then make .
[0113] When C = When the minimum gray level of 0 is reached, the image gray level at location [i,j] is estimated. .
[0114] After pixel-by-pixel estimation, the estimated pixel grayscale values of the region of interest are accumulated and the average grayscale value is calculated and passed to the firmware as the estimated grayscale value.
[0115] Step 323: Calculate the exposure time of the next frame by statistically analyzing or estimating the grayscale value of the current frame;
[0116] The firmware calculates the next exposure time or gain value using the following formula, where the damping coefficient F is mainly to prevent jitter caused by environmental instability, and its value ranges from (0, 1).
[0117]
[0118] For the exposure time or gain of the next frame, For the current exposure time or gain, For the target grayscale value, To statistically analyze or predict grayscale values, is the damping coefficient.
[0119] Step 33: Repeat the adjustment in step 32 until the image is adjusted to the target grayscale value as determined by the FPGA statistical grayscale value.
[0120] like Figure 6 As shown, if the image obtained after the exposure setting of the traditional algorithm takes effect, it takes 18 frames to adjust the image to the target grayscale value; if the next frame takes effect, it takes 36 frames to complete the adjustment. However, the fast 2A adjustment method proposed in this invention only requires 7 frames to complete the adjustment, regardless of whether the exposure time of the next frame takes effect, which greatly reduces the adjustment time.
[0121] The above are merely preferred embodiments of the present invention and do not constitute any limitation on the scope of protection of the present invention; all technical solutions formed by equivalent transformations or equivalent substitutions fall within the scope of protection of the present invention; the parts of the present invention not described in detail are well-known technologies to those skilled in the art.
Claims
1. A fast 2A adjustment method supporting precise adjustment of the region of interest, characterized in that, The fast 2A adjustment method that supports precise adjustment of the region of interest includes the following steps: Step 1: Select the region of interest based on the current image; Step 2: Pre-calibrate the current camera's light sensitivity curve; Step 3: The sensor sets the exposure or exposure prediction based on the effective time of different modes, and adjusts it to the target grayscale value; Step 3 also includes the following steps: Step 31, based on the sensor exposure mode and setting the exposure timing, is divided into 4 cases; The four situations include: Output the current frame image for grayscale value statistics; Estimate the image grayscale value corresponding to the current frame's exposure time; The current frame is discarded, and the image corresponding to the exposure time of the next frame is output for grayscale value statistics. The current frame is discarded, and the image grayscale value corresponding to the exposure time of the next frame is estimated. Step 32: Calculate the exposure time of the next frame based on the exposure timing. Step 33: Repeat the adjustment in step 32 until the image is adjusted to the target grayscale value as determined by the FPGA statistical grayscale value.
2. The fast 2A adjustment method supporting precise adjustment of the region of interest according to claim 1, characterized in that, In step 1, selecting the region of interest includes using histogram statistics to determine the 2A statistical region and using gradient judgment to select non-uniform regions; Determining the statistical region 2A using histogram statistics includes the following steps: In the image, locate pixels with gray values greater than 20 and less than 230 in non-flat regions; select n% of the pixels before or after as the region of interest. Using gradient judgment to select non-uniform regions includes the following steps: Convolution is performed between a template and the image, and points with larger gradients are selected as the 2A statistical regions. The template includes, but is not limited to, the Laplacian operator. ; ; ImageBlock is a 5x5 pixel area. This is the result of multiplying the image block by the template. For templates; The 2A statistical region is defined as all pixels whose gradient Diff is greater than a threshold as the region of interest.
3. The fast 2A adjustment method supporting precise adjustment of the region of interest according to claim 1, characterized in that, In step 2, the photosensitivity curve of the sensor is pre-calibrated to obtain a function that can be fitted to describe the changes in the photosensitivity curve: , For exposure time or gain, Let the image grayscale value be the inverse function; further, calculate the inverse function of this function: .
4. The fast 2A adjustment method supporting precise adjustment of the region of interest according to claim 1, characterized in that, Step 31 also includes the following steps: Step 311, the exposure timing includes three cases: before the exposure of the current frame image, during the exposure of the current frame image, and during the readout of the current frame image; When the exposure time is set before the exposure, the image output in this frame is the image exposed at the current exposure time. In this case, the current frame image is used to count grayscale values. When the exposure setting is in progress, the current frame image has already started to be exposed. The exposure duration is the exposure time of the previous frame. The grayscale value of the current frame image corresponds to the previous exposure value, not the exposure value set this time. In this case, the grayscale value of the image corresponding to the current exposure time is estimated. When the exposure setting is in the readout phase, the exposure time of the current frame is the same as the previous exposure time, and some pixel grayscale values have already been read out. It is impossible to estimate the grayscale values of pixels that have already been read out in the region of interest. In this case, the current frame is discarded, but the grayscale values of the next frame correspond to the exposure time and can be used to count the grayscale values.
5. The fast 2A adjustment method supporting precise adjustment of the region of interest according to claim 1, characterized in that, Step 31 also includes the following steps: Step 312, setting the exposure timing includes four cases: before the exposure of the current frame image, before the readout of the current frame image, during the readout of the current frame image and before the exposure of the next frame image, and during the readout of the current frame image and during the exposure of the next frame image. The exposure time is set before the exposure of the current frame image. The current frame image corresponds to the current exposure time. In this case, the current frame image is output for the purpose of calculating grayscale values. When the exposure occurs before the current frame image is read out, the current frame image has already finished being exposed, the exposure time is the exposure time of the previous frame, and the grayscale value of the current frame image corresponds to the value of the previous exposure time rather than the value of the current exposure time. In this case, the grayscale value of the image corresponding to the current frame exposure time is estimated. When the exposure timing is set during the reading of the current frame image and before the exposure of the next frame image, the exposure time of the image output in the current frame is the exposure time of the previous one, and some pixel gray values have already been read. It is impossible to estimate the gray values of pixels that have already been read in the region of interest. In this case, the current frame is discarded, and the image corresponding to the exposure time of the next frame is output for the purpose of statistical gray value. When the exposure timing is set during the reading of the current frame and the exposure of the next frame, the exposure time of the output image of the current frame is the exposure time of the previous frame, and some pixel grayscale values have already been read. It is impossible to estimate the grayscale values of pixels that have already been read in the region of interest, and the next frame has already started to be exposed. In this case, the current frame is discarded, and the grayscale value of the image corresponding to the exposure time of the next frame is estimated.
6. The fast 2A adjustment method supporting precise adjustment of the region of interest according to claim 1, characterized in that, Step 31 also includes the following steps: Step 313: Since it is uncertain when the sensor will take effect, but it is guaranteed that the second frame will definitely take effect, the current frame is discarded directly in this case, and the next frame image is obtained for grayscale value statistics. When adjusting gain, it is impossible to determine the precise timing of the effect. This can be divided into the following two situations: Digital gain adjustment: After setting the gain, it will take effect in the current frame, and the current frame image is used to count grayscale values; Adjusting the gain through simulation: After setting the gain, it may not take effect in the current frame, but it will definitely take effect in the next frame. The image of the next frame is used to count the grayscale values.
7. The fast 2A adjustment method supporting precise adjustment of the region of interest according to claim 1, characterized in that, Step 32 also includes the following steps: Step 321: For the case of obtaining the actual image of the current frame, obtain the statistical grayscale value; Step 322: For cases where the current exposure time does not correspond to the image grayscale value, obtain the estimated grayscale value; Step 323: Calculate the exposure time of the next frame by statistically analyzing or estimating the grayscale value of the current frame.
8. The fast 2A adjustment method supporting precise adjustment of the region of interest according to claim 7, characterized in that, In step 321, for the case of obtaining the actual image of the current frame, the FPGA counts the gray values of all pixels in the region of interest; after counting pixel by pixel, the estimated pixel gray values of the region of interest are accumulated and the average gray value is calculated and passed to the firmware as the statistical gray value.
9. The fast 2A adjustment method supporting precise adjustment of the region of interest according to claim 7, characterized in that, In step 322, for cases where grayscale values need to be estimated based on exposure time, the exposure time of the current image remains the same as the previous exposure time. Calculate the grayscale value of each pixel in the current target area. The exposure time is estimated using the pre-calibrated photosensitive profile. When effective, the estimated grayscale values of each pixel in the target area are calculated. : ; Exposure time of the current frame The corresponding image grayscale value is estimated. The FPGA performs point-by-point evaluation of the region of interest, evaluating the side length S of the region and the corresponding maximum grayscale value at the bit depth. The maximum value for 8 bits is 255, which is the maximum threshold. minimum threshold , ; The evaluation region traverses all pixels in the region of interest, assuming the current image... Let C be the gray value of the pixel at position [i,j]. Let V be the set of gray values of other pixels within a range S×S centered on C, representing the neighborhood gray value information of the current point. Classify the gray value set V by sorting it according to the gray value. ; When C = When the maximum grayscale value of 255 is reached, obtain the minimum value in V. ,like Less than Estimate the gray value at position [i,j] in the image. ;like equal Estimate the gray value of the image at position [i,j]. ; When predicting the image grayscale value at [i,j] Then make ; When C = When the minimum gray level is 0, predict the image gray level at location [i,j]. ; After pixel-by-pixel estimation, the estimated pixel grayscale values of the region of interest are accumulated and the average grayscale value is calculated and passed to the firmware as the average grayscale value of the current image.
10. The fast 2A adjustment method supporting precise adjustment of the region of interest according to claim 7, characterized in that, In step 323, the firmware calculates the exposure time or gain value that should be set next: ; For the exposure time or gain of the next frame, For the current exposure time or gain, For the target grayscale value, For FPGA statistics or grayscale value prediction, The damping coefficient is mainly used to prevent vibrations caused by environmental instability, and its value ranges from (0, 1).