Image automatic exposure method, storage medium and electronic device

By adjusting the image exposure time according to the relationship between the image exposure time and the gain coefficient, the problem of slow response speed of the image automatic exposure algorithm in the prior art is solved, and fast and stable automatic exposure is achieved, and image quality is improved.

CN114697563BActive Publication Date: 2025-02-07CHANGCHUN UP OPTOTECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210504223.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-10
Publication Date
2025-02-07
Estimated Expiration
2042-05-10

AI Technical Summary

Technical Problem

The existing automatic exposure algorithms of image are slow in response speed and cannot quickly adjust the image exposure time, resulting in poor image quality.

Method used

By determining the adjustment coefficient of the current frame image exposure time and the preset time threshold based on the size relationship between the current frame image exposure time and the preset time threshold, and the adjustment coefficient is used to expose the current frame image to the current frame image exposure time, and the adjustment coefficient is used to expose the current frame image Make adjustments.

Benefits of technology

The visible light camera quickly and stably adjusts the automatic exposure time in unmanned monitoring scenarios to obtain clear and good-quality images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114697563B_ABST
    Figure CN114697563B_ABST
Patent Text Reader

Abstract

The present invention proposes an automatic image exposure method, a storage medium, and an electronic device, the method comprising the following steps: S1: determining an adjustment coefficient of the exposure time of the current frame image according to the size relationship between the exposure time of the current frame image and a preset time threshold, and the size relationship between the current gain coefficient and the preset coefficient threshold, and using the adjustment coefficient to adjust the exposure time of the current frame image; S2: using the adjusted image exposure time for exposure to obtain the next frame exposure image. The present invention allocates different weighted values ​​through dual adjustment of the gain coefficient and the exposure time, and can quickly and stably realize automatic exposure adjustment, thereby obtaining better image quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of digital image processing, and in particular to an automatic image exposure method, a storage medium and an electronic device. Background Art

[0002] The image automatic exposure algorithm is mainly used to adjust the exposure time of the visible light camera to make the image brightness moderate, which is suitable for observing the image under different light levels. In many unmanned monitoring, tracking, and capture scenarios, since it is impossible to manually adjust the aperture, the visible light camera needs to automatically and quickly adjust the exposure time in real time according to the brightness of the scene to obtain a good quality image, so as to achieve the purpose of tracking and monitoring the target. However, the existing image automatic exposure algorithm has the problem of slow response speed and inability to quickly adjust the image exposure time, resulting in poor quality of the exposed image. Summary of the invention

[0003] In order to overcome the defects in the above-mentioned prior art, the present invention proposes an automatic image exposure method, storage medium and electronic device. The method can realize real-time and rapid adjustment of the automatic exposure time of a visible light camera according to the light intensity in scenes such as unmanned monitoring, tracking, and capturing, so as to obtain a clear image with good quality, thereby better identifying the target.

[0004] To achieve the above object, the present invention adopts the following specific technical solutions:

[0005] In a first aspect, the present invention provides an image automatic exposure method, the method comprising the following steps:

[0006] S1: determining an adjustment coefficient of the exposure time of the current frame image according to a magnitude relationship between the exposure time of the current frame image and a preset time threshold, and a magnitude relationship between the current gain coefficient and a preset coefficient threshold, and adjusting the exposure time of the current frame image by using the adjustment coefficient;

[0007] S2: Expose the image using the adjusted image exposure time to obtain the next frame of exposure image.

[0008] As an optional embodiment, the value of the preset time threshold is a first preset ratio multiplied by a frame period size, and the frame period size is equal to the sum of the current frame image exposure time and the image readout time.

[0009] As an optional embodiment, the first preset ratio is 90%.

[0010] As an optional embodiment, the preset coefficient threshold includes a first preset coefficient threshold and a second preset coefficient threshold, and the first preset coefficient threshold is greater than the second preset coefficient threshold;

[0011] In step S1, “determining the adjustment coefficient of the exposure time of the current frame image according to the size relationship between the exposure time of the current frame image and the preset time threshold, and the size relationship between the current gain coefficient and the preset coefficient threshold” includes:

[0012] If it is determined that the exposure time of the current frame image is greater than or equal to the preset time threshold, and the current gain coefficient is less than or equal to the first preset coefficient threshold, the adjustment coefficient is determined by increasing the current gain coefficient;

[0013] If it is determined that the exposure time of the current frame image is greater than or equal to the preset time threshold, and the current gain coefficient is greater than the first preset coefficient threshold, then the adjustment coefficient is determined directly according to the exposure time of the current frame image by an automatic exposure time algorithm;

[0014] If it is determined that the exposure time of the current frame image is less than the preset time threshold, and the current gain coefficient is greater than or equal to the second preset coefficient threshold, the adjustment coefficient is determined by reducing the current gain coefficient;

[0015] If it is determined that the exposure time of the current frame image is less than the preset time threshold and the current gain coefficient is less than the second preset coefficient threshold, the adjustment coefficient is determined directly according to the exposure time of the current frame image through an automatic exposure time algorithm.

[0016] As an alternative embodiment, the adjustment coefficient is determined by increasing the current gain coefficient according to the following formula, and the adjustment coefficient is used to adjust the exposure time of the current frame image:

[0017]

[0018]

[0019] Among them, Gain is the current gain coefficient and k1 is the adjustment coefficient. is the exposure time of the current frame image, Reduce the adjustment rate for the current frame image exposure time, E t is the adjusted image exposure time;

[0020] According to the following formula, the adjustment coefficient is realized by reducing the current gain coefficient, and the adjustment coefficient is used to adjust the exposure time of the current frame image:

[0021]

[0022]

[0023] Among them, Gain is the current gain coefficient and k2 is the adjustment coefficient. is the exposure time of the current frame image, The exposure time of the current frame image increases the adjustment rate, E t is the adjusted image exposure time.

[0024] As an optional embodiment, the method further includes:

[0025] Expose according to the current exposure time and the current gain coefficient to obtain the grayscale statistical histogram of the image;

[0026] Determine a grayscale value corresponding to a first pixel on the image according to a grayscale statistical histogram of the image, determine an adjustment coefficient for the exposure time of a current frame image according to a magnitude relationship between the grayscale value corresponding to the first pixel and a preset grayscale value, and use the adjustment coefficient to adjust the exposure time of the current frame image;

[0027] The grayscale value corresponding to the first pixel is determined according to the following method:

[0028] After arranging the grayscale values ​​of all pixels on the image in order from small to large or from large to small, the number of pixels is counted according to the grayscale value order from large to small. When the ratio of the counted number of pixels to the number of all pixels on the image reaches a preset second ratio, the grayscale value of the current pixel is recorded as the grayscale value corresponding to the first pixel.

[0029] As an optional embodiment, the preset grayscale value is 3700;

[0030] Determining an adjustment coefficient of the exposure time of the current frame image according to a magnitude relationship between the determined grayscale value and the preset grayscale value, and adjusting the exposure time of the current frame image by using the adjustment coefficient includes:

[0031] When it is determined that the grayscale value corresponding to the first pixel is less than or equal to the preset grayscale value, the exposure time of the current frame image is adjusted according to the following formula:

[0032]

[0033]

[0034] Among them, k3 is the adjustment coefficient of the current exposure time, DN1 is the gray value corresponding to the first pixel, and v 上 is the current exposure time increase rate, E t is the exposure time after adjustment;

[0035] When it is determined that the grayscale value corresponding to the first pixel point is greater than the preset grayscale value, the exposure time of the current frame image is adjusted according to the following formula:

[0036]

[0037]

[0038] Among them, k4 is the adjustment coefficient of the current exposure time, DN1 is the gray value corresponding to the first pixel, and v 上 is the down-regulation rate of the current exposure time, E t is the exposure time after adjustment; It represents the ratio of the number of pixels whose grayscale values ​​range from 3700 to DN1 to the number of pixels whose grayscale values ​​change from 0 to DN1.

[0039] As an optional embodiment, determining an adjustment coefficient of the exposure time of the current frame image according to a magnitude relationship between the determined grayscale value and the preset grayscale value, and adjusting the exposure time of the current frame image by using the adjustment coefficient further includes:

[0040] When it is determined that the difference between the grayscale value corresponding to the first pixel and the preset grayscale value is within a preset error range, the adjustment coefficient is constantly set to 1.

[0041] In a second aspect, the present invention further provides a storage medium storing a computer program, wherein the computer program, when executed, implements the method described in the first aspect of the present invention.

[0042] In a third aspect, the present invention further provides an electronic device, comprising:

[0043] A storage medium, which is the storage medium as described in the second aspect of the present invention;

[0044] A processor is used to execute the computer program in the storage medium to implement the method as described in the first aspect of the present invention.

[0045] The present invention can achieve the following technical effects:

[0046] The present invention proposes an automatic image exposure method, storage medium, and electronic device, the method comprising the following steps: S1: determining an adjustment coefficient of the exposure time of the current frame image according to the size relationship between the exposure time of the current frame image and a preset time threshold, and the size relationship between the current gain coefficient and the preset coefficient threshold, and using the adjustment coefficient to adjust the exposure time of the current frame image; S2: using the adjusted image exposure time for exposure to obtain the next frame exposure image. The present invention allocates different weighted values ​​through dual adjustment of the gain coefficient and the exposure time, and can quickly and stably realize automatic exposure adjustment, thereby obtaining better image quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 is a flow chart of an automatic image exposure method according to an embodiment of the present invention;

[0048] Figure 2is a flow chart of an image automatic exposure method according to another embodiment of the present invention;

[0049] Figure 3 is a schematic diagram of a grayscale statistical histogram of an image involved in an embodiment of the present invention;

[0050] Figure 4 is a schematic diagram of an exposure image according to an embodiment of the present invention;

[0051] Figure 5 is a schematic diagram of an exposure image according to another embodiment of the present invention. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not constitute a limitation of the present invention.

[0053] In a first aspect, the present invention provides an image automatic exposure method, the method comprising the following steps:

[0054] S1: determining an adjustment coefficient of the exposure time of the current frame image according to a magnitude relationship between the exposure time of the current frame image and a preset time threshold, and a magnitude relationship between the current gain coefficient and a preset coefficient threshold, and adjusting the exposure time of the current frame image by using the adjustment coefficient;

[0055] S2: Expose the image using the adjusted image exposure time to obtain the next frame of exposure image.

[0056] Preferably, before step S1, it also includes: setting the initial exposure time and the initial gain coefficient according to the scene brightness, and exposing the image according to the initial exposure time to obtain an initial frame exposure image. The initial exposure time is the initial value of the exposure time of the current frame image, which can be set to 1000us, and the initial gain coefficient can be set to 2. After the image is obtained by exposure, the target area of ​​interest (such as an object or a human body area) can also be identified according to the information entropy on the image, and the current gain coefficient is used to perform gain processing on the target area of ​​interest to enhance the image details.

[0057] The present invention distributes different weighted values ​​through dual adjustment of gain coefficient and exposure time, and can realize automatic exposure adjustment quickly and stably, thereby obtaining better image quality.

[0058] In some embodiments, the value of the preset time threshold is a first preset ratio multiplied by a frame period, where the frame period is equal to the sum of the current frame image exposure time and the image readout time. Preferably, the first preset ratio is 90%.

[0059] The method of the present invention calculates the adjustment coefficient corresponding to the current frame image, and adjusts the exposure time of the current frame according to the adjustment coefficient, and uses the adjusted exposure time as the exposure time of the next frame image, thereby adjusting the exposure time in real time to expose the next frame image. During the entire exposure time adjustment process, the exposure time adjustment can be completed quickly and stably within 3 seconds when switching from one lighting scene to another lighting scene. Figure 4 and Figure 5 The corresponding image obtained after adjusting the exposure time by the method of the present invention is shown. Figure 4 and Figure 5 It can be seen that the image has a clear distinction between light and dark, and the details are clearer.

[0060] In some embodiments, the preset coefficient threshold includes a first preset coefficient threshold and a second preset coefficient threshold, and the first preset coefficient threshold is greater than the second preset coefficient threshold;

[0061] In step S1, “determining the adjustment coefficient of the exposure time of the current frame image according to the size relationship between the exposure time of the current frame image and the preset time threshold, and the size relationship between the current gain coefficient and the preset coefficient threshold” includes:

[0062] If it is determined that the exposure time of the current frame image is greater than or equal to the preset time threshold, and the current gain coefficient is less than or equal to the first preset coefficient threshold, the adjustment coefficient is determined by increasing the current gain coefficient;

[0063] If it is determined that the exposure time of the current frame image is greater than or equal to the preset time threshold, and the current gain coefficient is greater than the first preset coefficient threshold, then the adjustment coefficient is determined directly according to the exposure time of the current frame image by an automatic exposure time algorithm;

[0064] If it is determined that the exposure time of the current frame image is less than the preset time threshold, and the current gain coefficient is greater than or equal to the second preset coefficient threshold, the adjustment coefficient is determined by reducing the current gain coefficient;

[0065] If it is determined that the exposure time of the current frame image is less than the preset time threshold and the current gain coefficient is less than the second preset coefficient threshold, the adjustment coefficient is determined directly according to the exposure time of the current frame image through an automatic exposure time algorithm.

[0066] Preferably, the size of the preset time threshold is 90% of the frame period size, the first preset coefficient threshold is 2.5, and the second preset coefficient threshold is 1.

[0067] Preferably, the adjustment coefficient is determined by increasing the current gain coefficient according to the following formula, and the exposure time of the current frame image is adjusted by using the adjustment coefficient:

[0068]

[0069]

[0070] Among them, Gain is the current gain coefficient, k1 is the adjustment coefficient, is the exposure time of the current frame image, The exposure time of the current frame image is reduced by the adjustment rate, E t is the adjusted image exposure time.

[0071] In short, if the current frame exposure time is greater than or equal to 90% of the frame period value and the gain coefficient is less than or equal to 2.5, the exposure time can be reduced by increasing the gain coefficient, and then the reduced exposure time is used as the real-time exposure time to expose the next frame image.

[0072] If the current frame exposure time is greater than or equal to 90% of the frame period value and the gain coefficient is greater than 2.5, the exposure time cannot be reduced by increasing the gain coefficient. In this case, the exposure time is adjusted using the automatic exposure time algorithm. The automatic exposure time algorithm adaptively adjusts the current exposure time and the current gain coefficient according to the brightness value of the current scene.

[0073] Preferably, the adjustment coefficient is determined by reducing the current gain coefficient according to the following formula, and the exposure time of the current frame image is adjusted by using the adjustment coefficient:

[0074]

[0075]

[0076] Among them, Gain is the current gain coefficient, k2 is the adjustment coefficient, is the exposure time of the current frame image, The exposure time of the current frame image increases the adjustment rate, E t is the adjusted image exposure time.

[0077] In short, if the current frame exposure time is less than 90% of the frame period value and the gain coefficient is greater than 1.5, the exposure time can be increased by reducing the gain coefficient, and then the increased exposure time is used as the real-time exposure time to expose the next frame image.

[0078] If the current frame exposure time is less than 90% of the frame period value and the gain coefficient is less than 1.5, the exposure time cannot be increased by reducing the gain coefficient. In this case, the exposure time is adjusted using the automatic exposure time algorithm. The automatic exposure time algorithm adaptively adjusts the current exposure time and the current gain coefficient according to the brightness value of the current scene.

[0079] In some embodiments, the method further comprises:

[0080] Expose according to the current exposure time and the current gain coefficient to obtain the grayscale statistical histogram of the image;

[0081] Determine a grayscale value corresponding to a first pixel on the image according to a grayscale statistical histogram of the image, determine an adjustment coefficient for the exposure time of a current frame image according to a magnitude relationship between the grayscale value corresponding to the first pixel and a preset grayscale value, and use the adjustment coefficient to adjust the exposure time of the current frame image;

[0082] The grayscale value corresponding to the first pixel is determined according to the following method:

[0083] After arranging the grayscale values ​​of all pixels on the image in order from small to large or from large to small, the number of pixels is counted according to the grayscale value order from large to small. When the ratio of the counted number of pixels to the number of all pixels on the image reaches a preset second ratio, the grayscale value of the current pixel is recorded as the grayscale value corresponding to the first pixel.

[0084] Generally, the original image captured by the image sensor has a resolution of 1024x1024 or 4096x4096. For an image, the brightness value of the pixel on the image is defined as 256 values ​​from 0 to 255. The larger the value, the higher the brightness of the pixel. 0 represents the darkest area of ​​pure black, 255 represents the brightest pure white, and the numbers in between are grays of different brightness. Brightness is generally divided into 5 areas, from dark to bright: black, shadow (also known as dark part), midtone, highlight and white.

[0085] like Figure 3 As shown, the horizontal axis represents the brightness value of 0-255, and the vertical axis represents the number of pixels of the corresponding brightness in the image. This function graph is called a histogram. The height of the column in the histogram represents the brightness value of the corresponding number of pixels in the image corresponding to the horizontal axis where the column is located. Therefore, the distribution and proportion of the brightness of each pixel in the image can be seen through the histogram. When the peak of the histogram is in the middle left position (shadow area), it means that there are many dark gray or dark parts in the image, and the image is dark as a whole; conversely, when the peak of the histogram is in the middle right position (highlight area), it means that there are many white or bright parts in the image, and the image is bright as a whole.

[0086] Preferably, the preset grayscale value is 3700;

[0087] Determining an adjustment coefficient of the exposure time of the current frame image according to a magnitude relationship between the determined grayscale value and the preset grayscale value, and adjusting the exposure time of the current frame image by using the adjustment coefficient includes:

[0088] When it is determined that the grayscale value corresponding to the first pixel is less than or equal to the preset grayscale value, the exposure time of the current frame image is adjusted according to the following formula:

[0089]

[0090]

[0091] Among them, k3 is the adjustment coefficient of the current exposure time, DN1 is the gray value corresponding to the first pixel, and v 上 is the current exposure time increase rate, E t is the exposure time after adjustment;

[0092] When it is determined that the grayscale value corresponding to the first pixel point is greater than the preset grayscale value, the exposure time of the current frame image is adjusted according to the following formula:

[0093]

[0094]

[0095] Among them, k4 is the adjustment coefficient of the current exposure time, DN1 is the gray value corresponding to the first pixel, and v 上 is the down-regulation rate of the current exposure time, E t is the exposure time after adjustment; It represents the ratio of the number of pixels whose grayscale values ​​range from 3700 to DN1 to the number of pixels whose grayscale values ​​change from 0 to DN1.

[0096] Preferably, the adjustment coefficient of the exposure time of the current frame image is determined according to the size relationship between the determined grayscale value and the preset grayscale value, and the exposure time of the current frame image is adjusted by the adjustment coefficient, and further includes: when it is determined that the difference between the grayscale value corresponding to the first pixel and the preset grayscale value is within the preset error range, the adjustment coefficient is constantly set to 1. The preset error range can be set to 50, that is, when the difference between the grayscale value corresponding to the first pixel and the preset grayscale value is within the ±50 threshold range, the exposure time of the current frame is not adjusted, so as to prevent the image from flickering when the image exposure time changes near the preset grayscale threshold during the real-time adjustment process. In the present invention, when the exposure time of the current frame needs to be adjusted by the adjustment coefficient, the corresponding adjustment rate is multiplied during the adjustment process to ensure that the exposure time is adjusted up and down in a balanced manner.

[0097] In the actual adjustment process, the photoelectric performance of the visible light camera was tested and it was found that the noise increased linearly with the increase of grayscale value. The maximum linear full well value was 3700, after which the noise would be blocked. Therefore, only the linear area was retained. For example, if the image was 12 bits, the grayscale value of the pixels on the image ranged from 0 to 4095, and the grayscale value of 3700 corresponded to 10% of the entire grayscale histogram. Based on this, the algorithm discarded the last 10% of the image information in the grayscale histogram and obtained the grayscale value DN1 corresponding to the last 10%. DN1 was compared with the contrast grayscale value threshold of 3700.

[0098] In a second aspect, the present invention further provides a storage medium storing a computer program, which implements the method steps of the first aspect of the present invention when executed by a processor.

[0099] In a third aspect, the present invention further provides an electronic device comprising a processor and a storage medium, wherein the storage medium is the storage medium of the second aspect; the processor is used to execute a computer program stored in the storage medium to implement the method steps of the first aspect.

[0100] In this embodiment, the electronic device is a computer device, including but not limited to: personal computers, servers, general-purpose computers, special-purpose computers, network devices, embedded devices, programmable devices, smart mobile terminals, smart home devices, wearable smart devices, vehicle-mounted smart devices, etc. Storage media include but are not limited to: RAM, ROM, disks, tapes, optical disks, flash memory, USB flash drives, mobile hard disks, memory cards, memory sticks, network server storage, network cloud storage, etc. Processors include but are not limited to CPU (central processing unit), GPU (graphics processing unit), MCU (microprocessor), etc.

[0101] like Figure 2 As shown, the present invention provides a full-color image automatic exposure algorithm for a visible light camera, which can first obtain a target area of ​​interest according to information entropy, and then obtain an image of desired quality by adjusting the gain calculation adjustment weighting coefficient and calculating the adjustment weighting coefficient according to the exposure time. The algorithm implementation steps are as follows:

[0102] (1) Set the initial exposure time and gain to expose the image;

[0103] (2) Obtaining the grayscale statistical histogram of the initial image;

[0104] (31) If the current exposure time is greater than or equal to 90% of the frame period and the gain is less than or equal to 2.5, the weighting coefficient for adjusting the exposure time is calculated by increasing the gain, thereby adjusting the exposure time;

[0105] (32) If the current exposure time is greater than or equal to 90% of the frame period and the gain is greater than 2.5, the exposure time cannot be adjusted by adjusting the gain. The exposure time needs to be adjusted by directly calculating the weighting coefficient based on the exposure time.

[0106] (33) If the current exposure time is less than 90% of the frame period and the gain is greater than or equal to 1.5, the weighting coefficient of the exposure time adjusted is calculated by reducing the gain, thereby adjusting the exposure time;

[0107] (34) If the current exposure time is less than 90% of the frame period and the gain is less than 1.5, the exposure time cannot be adjusted by adjusting the gain. It is necessary to adjust the exposure time by directly calculating the weighting coefficient based on the exposure time.

[0108] In this embodiment, steps (31)-34) may be performed in parallel. The gain coefficients of the image are set to four groups: 1, 1.5, 2, and 2.5.

[0109] When the gain coefficient is greater than or equal to 1.5, it means that the current gain coefficient is 1.5, 2 or 2.5, and the exposure time can be quickly adjusted by reducing the gain coefficient. For example, the gain coefficient can be adjusted from 1.5 to 1, or from 2 to 1.5, or from 2.5 to 2 to achieve rapid adjustment of the exposure time.

[0110] Similarly, when the gain coefficient is less than or equal to 2.5, it means that the current gain coefficient is 1, 1.5, or 2, and the exposure time can be quickly adjusted by increasing the gain coefficient. For example, the gain coefficient can be adjusted from 1 to 1.5, or from 1.5 to 2, or from 2 to 2.5 to achieve rapid adjustment of the exposure time.

[0111] When the gain coefficient is greater than 2.5 or the gain coefficient is less than 1.5, the exposure time cannot be quickly adjusted by the gain coefficient. The method of the present application will further adjust the exposure time by counting the grayscale histogram. Specifically, the grayscale value DN1 corresponding to the last 10% of the grayscale histogram is counted, DN1 is compared with the contrast grayscale value threshold of 3700, and the adjustment coefficient is determined according to the comparison result, and then the current exposure time is adjusted to meet the exposure time requirements of different scenes.

[0112] The present invention has the following advantages:

[0113] (1) The automatic exposure algorithm of 12-bit images is realized. Different weighting values ​​are allocated by double adjustment of gain and exposure time to realize automatic exposure of images, and better image quality can be obtained;

[0114] (2) The automatic exposure of the present invention is relatively fast, and can complete the automatic exposure adjustment within 3 seconds, which can better realize the automatic exposure in real time and stably;

[0115] (3) The present invention calculates the weighting coefficient by grayscale histogram, which has relatively low complexity and is easy to implement in hardware;

[0116] (4) In the method of the present invention, the contrast gray value, the upper and lower thresholds of the contrast gray value, the upper and lower adjustment rates of the exposure time, and the percentage of the histogram are all adjustable parameters, which improves the flexibility of the algorithm.

[0117] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0118] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

[0119] The above specific implementations of the present invention do not constitute a limitation on the protection scope of the present invention. Any other corresponding changes and modifications made based on the technical concept of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. An automatic image exposure method, characterized in that: The method comprises the following steps: S1: determining an adjustment coefficient of the exposure time of the current frame image according to a magnitude relationship between the exposure time of the current frame image and a preset time threshold, and a magnitude relationship between the current gain coefficient and a preset coefficient threshold, and adjusting the exposure time of the current frame image by using the adjustment coefficient; S2: Expose using the adjusted image exposure time to obtain the next frame of exposure image; The preset coefficient threshold includes a first preset coefficient threshold and a second preset coefficient threshold, and the first preset coefficient threshold is greater than the second preset coefficient threshold; In step S1, "determining the adjustment coefficient of the exposure time of the current frame image according to the size relationship between the exposure time of the current frame image and the preset time threshold, and the size relationship between the current gain coefficient and the preset coefficient threshold" includes: If it is determined that the exposure time of the current frame image is greater than or equal to the preset time threshold, and the current gain coefficient is less than or equal to the first preset coefficient threshold, the adjustment coefficient is determined by increasing the current gain coefficient; If it is determined that the exposure time of the current frame image is greater than or equal to the preset time threshold, and the current gain coefficient is greater than the first preset coefficient threshold, then the adjustment coefficient is determined directly according to the exposure time of the current frame image by an automatic exposure time algorithm; If it is determined that the exposure time of the current frame image is less than the preset time threshold, and the current gain coefficient is greater than or equal to the second preset coefficient threshold, the adjustment coefficient is determined by reducing the current gain coefficient; If it is determined that the exposure time of the current frame image is less than the preset time threshold, and the current gain coefficient is less than the second preset coefficient threshold, the adjustment coefficient is determined directly according to the exposure time of the current frame image by an automatic exposure time algorithm; The grayscale value is preset to 3700. The grayscale value DN1 corresponding to the last 10% of the grayscale histogram is counted, and DN1 is compared with the grayscale value threshold of 3700. The adjustment coefficient is determined according to the comparison result. Determining an adjustment coefficient of the exposure time of the current frame image according to a magnitude relationship between the determined grayscale value and the preset grayscale value, and adjusting the exposure time of the current frame image by using the adjustment coefficient includes: When it is determined that the grayscale value corresponding to the first pixel is less than or equal to the preset grayscale value, the exposure time of the current frame image is adjusted according to the following formula: Among them, k3 is the adjustment coefficient of the current exposure time, DN1 is the gray value corresponding to the first pixel, and v 上 is the current exposure time increase rate, E t is the adjusted exposure time, The exposure time of the current frame image; When it is determined that the grayscale value corresponding to the first pixel is greater than the preset grayscale value, the exposure time of the current frame image is adjusted according to the following formula: Among them, k4 is the adjustment coefficient of the current exposure time, DN1 is the gray value corresponding to the first pixel, and v 上 is the down-regulation rate of the current exposure time, E t is the exposure time after adjustment; It represents the ratio of the number of pixels whose grayscale value changes from 3700 to DN1 to the number of pixels whose grayscale value changes from 0 to DN1. The exposure time of the current frame image; The adjustment coefficient is determined by increasing the current gain coefficient according to the following formula, and the exposure time of the current frame image is adjusted by using the adjustment coefficient: Among them, Gain is the current gain coefficient, k1 is the adjustment coefficient, is the exposure time of the current frame image, The exposure time of the current frame image is reduced by the adjustment rate, E t is the adjusted image exposure time; The adjustment coefficient is determined by reducing the current gain coefficient according to the following formula, and the exposure time of the current frame image is adjusted by using the adjustment coefficient: Among them, Gain is the current gain coefficient, k2 is the adjustment coefficient, is the exposure time of the current frame image, The exposure time of the current frame image increases the adjustment rate, E t is the adjusted image exposure time.

2. The automatic image exposure method according to claim 1, characterized in that: The value of the preset time threshold is the first preset ratio multiplied by the frame period size, and the frame period size is equal to the sum of the current frame image exposure time and the image readout time.

3. The automatic image exposure method according to claim 2, characterized in that: The first preset ratio is 90%.

4. The automatic image exposure method according to claim 1, characterized in that: The method further comprises: Expose according to the current exposure time and the current gain coefficient to obtain the grayscale statistical histogram of the image; Determine a grayscale value corresponding to a first pixel on the image according to a grayscale statistical histogram of the image, determine an adjustment coefficient for the exposure time of a current frame image according to a magnitude relationship between the grayscale value corresponding to the first pixel and a preset grayscale value, and use the adjustment coefficient to adjust the exposure time of the current frame image; The grayscale value corresponding to the first pixel is determined according to the following method: After arranging the grayscale values ​​of all pixels on the image in order from small to large or from large to small, the number of pixels is counted according to the grayscale value order from large to small. When the ratio of the counted number of pixels to the number of all pixels on the image reaches a preset second ratio, the grayscale value of the current pixel is recorded as the grayscale value corresponding to the first pixel.

5. The automatic image exposure method according to claim 4, characterized in that: Determining an adjustment coefficient of the exposure time of the current frame image according to a magnitude relationship between the determined grayscale value and the preset grayscale value, and using the adjustment coefficient to adjust the exposure time of the current frame image further includes: When it is determined that the difference between the grayscale value corresponding to the first pixel and the preset grayscale value is within a preset error range, the adjustment coefficient is constantly set to 1.

6. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

7. An electronic device, characterized in that: include: The storage medium is the storage medium as claimed in claim 6; A processor, configured to execute the computer program in the storage medium to implement the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Camera control method for vehicle entramce control system

    US20090160937A1