Real-time Digital Image Exposure Status Detection and Circuit Implementation

—Auto exposure is an important part of digital image signal processing. We studied the detection of the exposure status in this paper, and fast and parallel detection method was presented. The method comprises the following steps: first obtaining the current image, counting the numbers of pixels in bright and dark regions of the image and obtaining these pixels brightness; then determining exposure parameters based on the proportions of the counted numbers of pixels in bright and dark regions with preset value respectively; if the actual proportion is lower than preset value, then continue to adjust exposure parameters until pixel brightness value reaches preset brightness threshold. Experiments show that the computational complexity and operation demand is low, which can quickly determine the exposure status of the image, improving the real-time capability in image exposure control. The proposed method will make the whole digital image signal processing system works smoothly and be reliable. The circuit implementation of this method is simple with high real-time controllability. This method has been applied for China patent successfully.


INTRODUCTION
With the development of digital photography technology, digital video cameras have been used in many different environments.Among them, one function of a digital video camera is automatic exposure.Automatic exposure is the default setting of a digital video camera.The camera will automatically control the image's exposure in the automatic exposure mode and users do not need to do anything.Camera or video camera in the sensor can set exposure parameters such as exposure time, gain, aperture value automatically according to the intensity of light reflected from the object.However, if images from the imaging equipment are underexposed or over-exposed, it will have impact on the subsequent image processing.How to determine the status of current exposure and real-time control imaging equipment by feedback to get an image of higher quality is an important part of image processing tasks [1].As a necessary part, automatic exposure control determines the display quality of the whole image system [2], which is a technology we are very concerned about and is a hot research field.
In general, conventional image exposure status detection methods are calculating luminance histogram of the entire image through software [3,4], determining exposure status based on the distribution of pixels luminance value in the histogram, and then controlling the exposure.However, detection of image exposure state by this method is of high computational complexity with higher hardware performance requirements for running the image processing software, a longer time lag in the exposure state detection and poor realtime performance.It also requires additional storage space and poor real-time performance is harm to the subsequent image processing.As to the hardware implementation method, selecting an area in the image to process not only has high computational complexity, but also involves how to select an region in the image.It will cause the problem of taking a part for the whole and drawback of inaccurate detection as well as long calculation reciprocating cycle [5,6,7].
In view of the above shortcomings, an automatic exposure adjustment system is established in this paper.A fast and parallel image exposure detection algorithm is proposed to adjust brightness of the whole image in real-time with the advantages of simple calculation, accurate detection and high real-time response.The problems of complicated exposure status detection, detection lag and poor real-time response in existing technology [8,9] can be solved.

A. Fast and Parallel Exposure Status Detection Process
The fast parallel image exposure status detection process is as follows: (1) Get current image, and calculate the pixel numbers and their brightness in dark and bright regions of the image, where the bright and dark regions have a preset brightness threshold range; www.ijacsa.thesai.org(2) Calculate the proportions of pixels in bright and dark rejoins respectively based on the above statistical results.Proportions of pixels in bright and dark rejoins are calculated respectively according to the proportions of pixels numbers in the bright and dark regions in the total number of pixels; (3) If either the proportions of pixels in bright & dark regions is larger than or equal to the preset proportion, adjust exposure parameters of the imaging device according to the brightness of the pixels counted in the last step and the preset brightness threshold; (4) If the proportions of pixels in bright & dark regions are lower than the preset proportion, continue to carry out statistics until pixel brightness reach the preset brightness threshold.

B. Design of Fast and Parallel Exposure Status Detection Algorithm
The flow chart of fast parallel image exposure status detection is shown in Fig. 1.
Bright and dark regions in the image should be preset in step 1. Bright regions consist of pixels in values from preset boundary value to 255 while dark regions consist of pixels in values from a minimum 0 to the preset boundary value.Bright and dark regions are consistent with image Poisson distribution theory and can be supposed to account for 10% of the entire image each.So the boundary values of bright regions can be supposed to be 255 to 256 × 90% while dark regions to be 0 to 256 × 10%.Of course, these two boundary values can also be changed.According to the image inputted in real-time, the numbers of pixels whose values are within the ranges of bright and dark regions are counted respectively.
It is indicated in steps 2, 3 and 4 that the algorithm will count the numbers of pixels in bright regions and dark regions of current image after the image is inputted.Different pixel numbers indicates different results: 1) If the number of pixels in bright regions is greater than the preset number of bright regions, and the number of pixels in dark regions is less than or equal to the preset number of dark regions, the current image is supposed to be overexposed, and the pixel values equal to the preset number of bright regions is recorded; 2) If the number of pixels in bright regions is less than or equal to the preset number of bright regions, and the number of pixels in dark regions is greater than the preset number of dark regions, the current image is supposed to be in underexposed, and the pixel values equal to the preset number of dark regions is recorded; 3) If the number of pixels in bright regions is greater than the preset number of bright regions, and the number of pixels in dark regions is greater than the preset number of dark regions, the current image is supposed to be extreme exposed, and the pixel values equal to the preset numbers of dark & bright regions is recorded respectively; Count the numbers of pixels in bright regions and dark regions of current image the number of pixels in bright & dark regions is less than or equal to the preset number Step S3 adjustment Step S1 Step S2 Continue counting until the brightness value of pixels reach the preset brightness threshold Adjust exposure parameters of imaging device based on the brightness of the pixels counted and preset brightness threshold Acquire current image and count the numbers of pixels in bright & dark regions in the image as well as the brightness values of the image.
the number of pixels in bright & dark regions are both less than the preset number Fig. 1.The flow chart of fast parallel image exposure status detection www.ijacsa.thesai.org4) If the number of pixels in bright regions is less than or equal to the preset number of bright regions, and the number of pixels in dark regions is less than or equal to the preset number of dark regions, the current image is supposed to be in normal exposure condition.

C. Exposure Feedback Controlling Method after Fast
Parallel Exposure Status Detection After the above detection is finished, different exposure feedback control methods will be taken based on exposure state.
If it is over-exposed, use the ratio of recorded pixel values equaling to the preset number and the preset boundary value of bright regions as the gain parameter of light in time for adjusting the CMOS image sensor; if it is supposed to be under-exposed, use the ratio of the preset boundary value and recorded pixel values equaling to the preset number and of dark regions as the gain parameter of light in time for adjusting the CMOS image sensor ; if it is supposed to be over-exposed and under-exposed, use the new gain factor calculated through weight processing of the above two ratios as the gain parameter of light in time for adjusting the CMOS image sensor.
After detection factor are set in the above three conditions, continue to calculate the real-time input image adjusted until the image is in normal exposure.

III. HARDWARE ARCHITECTURE DESIGN FOR FAST PARALLELAL EXPOSURE STATUS DETECTION & CONTROL
Hardware architecture for fast parallel image exposure status detection & control is shown in Fig. 2, including system bus interface, system control status register banks, exposure state machine, pixels counter banks, pixel interface as well as control logic and etc.

A. System Bus Interface And System Control Status Register
Banks An AHB interface of common SoC is utilized as the system bus interface for easy system integration and debugging.System control status register banks communicate with host computer primarily through system bus interface to make the configuration and status query of the module by host computer.It includes control registers of automatic exposure control module, such as image resolution, module enable and etc.It also includes some status information of automatic exposure control module such as the exposure status of the current frame.

B. Pixel Interface And Control Logic Module
Pixel interface and control logic module is mainly the luminance component interface for receiving pixels and transfer these pixels to the following bright and dark counter banks of pixel numbers divided by 32 to count the information on bright and dark regions in real-time.Meanwhile, the interface is also responsible for receiving the feedback signals from the system over-exposed, under-exposed and extreme exposure state machine.When status of current frame is overexposed, under-exposed or extreme exposed, the luminance component interface of pixels in subsequent two frame is masked to achieve power saving.Because under normal circumstances, once the current frame is detected in nonnormal exposure state, the state should be reported to the host system and host system will re-adjust the exposure parameters of the image sensor.The processing of subsequent two frames can be temporarily ignored, and this kind of treatment is also reasonable.

C. Division by 32 Counter Banks
Pixel data will be transmitted simultaneously to the bright and dark counter banks of pixel numbers divided by 32.These two modules will independently calculate statistical information of bright and dark regions in parallel, and the results will be sent to the corresponding state machines of over-exposed bright and dark regions.The circuits of these two counter banks are shown in Fig. 3 and Fig. 4 respectively.
As can be seen from Fig. 3 and Fig. 4, two counter groups consist of 33 (since divided by 32) counters of 28 bits, increment in 1.Each counter is responsible for count the number of pixels in corresponding pixel values.
Division by 32 of bright region is corresponded to the maximum brightness of 255 in physical world and the preset lower threshold in bright regions.Division by 32 of dark region is corresponded to the minimum brightness of 0 in physical world and the preset higher threshold in dark regions.
Two counter groups simultaneously count pixels in a frame, and give specific statistical information to the two state machines during frame interval.The statistic results will be transferred simultaneously to over--exposed state machine of bright regions and under-exposed state machine of dark regions to independently determine in parallel whether the current frame is over-exposed or under-exposed.The results will be sent to the next system over-exposed, under-exposed and extreme exposure state machines.

D. System Over-, Under-, and Extreme Exposure State Machines
If pre-stage judgment indicates that neither over-exposed nor underexposed is exist, then conclusion will be that system is in normal exposure condition and no action will be taken.
If pre-stage judgment indicates over-exposure and without under-exposure, then conclusion will be that system is in overexposure condition, the corresponding status and interrupt bits will be reset and actions in the following two frames will be masked.
If pre-stage judgment indicates under-exposure and without over-exposure, then conclusion will be that system is in under-exposure condition, the corresponding status and interrupt bits will be reset and actions in the following two frames will be masked.
If pre-stage judgment indicates under-exposure and overexposure, then conclusion will be that system is in extreme exposure condition, the corresponding status and interrupt bits will be reset and actions in the following two frames will be masked.www.ijacsa.thesai.orgCompared with the traditional image exposure status detection methods, the proposed method count the number of pixels in bright and dark regions and obtain these pixels brightness value ,then calculate the proportions of pixels numbers in bright regions with pixels numbers in dark regions.If the calculated proportion is different with preset value, compensation measures should be taken.The proposed method has lower computational complexity and easy detection process, which can not only quickly determine image exposure state, but also greatly improve the real-time response of image exposure control.
When the proportions of pixels numbers in bright regions or dark regions is larger than or equal to preset value, or the www.ijacsa.thesai.orgcurrent brightness value of pixels counted reaches the preset brightness threshold, the counting process will be automatically stopped, avoiding unnecessary computational steps ,thus reducing the total computational works of the system.

IV. CONCLUSIONS
The paper proposed a fast and real-time parallel exposure status detection and control algorithm with the implementation of detailed hardware circuits.The proposed method explore the maximum luminance value of the bright regions and the minimum luminance value of the dark regions, count the numbers of pixels in bright and dark regions and these pixels bright values.According to the proportions of pixels numbers in bright regions or dark regions, image exposure status can be determined to be as under-exposure, over-exposure or both.Through the compensation of brightness and darkness, the problems of the existing technology are solved such as complicated detection on image exposure status, detection lag, and poor real-time performance in this algorithm.The traditional method limitations on only over-exposure state detection are overcome.With advantages simple calculation, simple structure, strong real-time response, the proposed algorithm is very suitable for applications in intelligent mobile devices.