Abstract:
A method and a storage medium for auto exposure control are provided. A desired image is divided into a plurality of sample blocks, each includes red, green, and blue subpixels. A maximum exposure ratio and an average exposure ratio are obtained according to the maximum and average values of each red, green, and blue subpixel retrieved from each sample block and a predetermined desired maximum brightness and a predetermined desired average brightness. It is determined whether the maximum exposure ratio is smaller than the average exposure ratio. If it is, a strobe of the storage medium shines a flashlight based on the average exposure ratio, and, if it is not, the strobe shines a flashlight based on the maximum exposure ratio.

Description:
RELATED APPLICATIONS 
   The application claims priority to Taiwan Application Serial Number 95114682, filed Apr. 25, 2006, which is herein incorporated by reference. 
   BACKGROUND 
   1. Field of Invention 
   The present invention relates to auto exposure. More particularly, the present invention relates to a method to control auto exposure with an image extraction apparatus. 
   2. Description of Related Art 
   Since virtual environments are complex, pictures of objects and backlight that are varied with time, using a digital camera with a flashlight to take the pictures are generally underexposed or overexposed. Thus, in such conditions the pictures are not satisfactory. To overcome this problem conventionally, a reference sample image is taken before the flashlight is turned on. Then, different companies have respectively different designs to calculate and configure parameters to shine the flashlight based on the reference sample image, the parameters such as flashing time period and light brightness. Thus, the flashlight is turned on and shines brightly for illumination based on the calculated flashing parameters. However, the aforementioned method cannot handle or control the resultant exposure of the object after the flashlight is activated. Therefore, underexposing or overexposing problems may still occur in some circumstances. 
   Therefore, there is a need to provide an improved image extraction apparatus and a method to control auto exposure to mitigate or obviate the aforementioned problems. 
   SUMMARY 
   An embodiment of a method to control auto exposure in accordance with the present invention is used for a strobe. The method comprises a step of splitting an image of desired picture into multiple sample blocks, where each of the sample blocks comprises multiple pixels, and each of the pixels comprises a first subpixel, a second subpixel and a third subpixel. The next step is to extract a maximum value between the first subpixels, a maximum value between the second subpixels and a maximum value between the third subpixels between the pixels of each sample block, and extract an average value between the first subpixels, an average value between the second subpixels and an average value between the third subpixels between the pixels of each sample block. The next step is to calculate respectively a first sum of maximum values based on the maximum values of the first subpixels, a second sum of maximum values based on the maximum values of the second subpixels and a third sum of maximum values based on the maximum values of the third subpixels of the sample blocks, and calculate respectively a first sum of average values based on the average values of the first subpixels, a second sum of average values based on the average values of the second subpixels and a third sum of average values based on the average values of the third subpixels of the sample blocks. Thus, a maximum sum exposure value is calculated based on the maximum one of the first sum of maximum values, the second sum of maximum values and the third sum of maximum values, and an average sum exposure value is calculated based on the maximum one of the first sum of average values, the second sum of average values and the third sum of average values. A maximum exposure ratio and an average exposure ratio are calculated based on the maximum sum exposure value, the average sum exposure value, a desired maximum brightness and a desired average brightness where the desired maximum brightness and the desired average brightness are configured by the user. The final step determines whether the maximum exposure ratio is smaller than the average exposure ratio. If the maximum exposure ratio is smaller than the average exposure ratio, the strobe shines the flashlight based on the average exposure ratio. Otherwise, the strobe shines the flashlight based on the maximum exposure ratio if the maximum exposure ratio is not smaller than the average exposure ratio. 
   An embodiment of a storage medium in accordance with the present invention comprises a processing system and a strobe. The processing system splits an image of a desired picture into multiple sample blocks, where each of the sample blocks comprises multiple pixels, and each of the pixels comprises a first subpixel, a second subpixel and a third subpixel. The processing system extracts a maximum value between the first subpixels, a maximum value between the second subpixels and a maximum value between the third subpixels between the pixels of each sample block, and extract an average value between the first subpixels, an average value between the second subpixels and an average value between the third subpixels between the pixels of each sample block. Also, the processing system calculates respectively a first sum of maximum values based on the maximum values of the first subpixels, a second sum of maximum values based on the maximum values of the second subpixels and a sum of maximum values based on the maximum values of the third subpixels of the sample blocks, and calculates respectively a first sum of average values based on the average values of the first subpixels, a second sum of average values based on the average values of the second subpixels and a third sum of average values based on the average values of the third subpixels of the sample blocks. Thus, a maximum sum exposure value is calculated based on the maximum value of the first sum of maximum values, the second sum of maximum values and the third sum of maximum values, and an average sum exposure value is calculated based on the maximum value of the first sum of average values, the second sum of average values and the third sum of average values. A maximum exposure ratio and an average exposure ratio are calculated based on the maximum sum exposure value, the average sum exposure value, a desired maximum brightness and a desired average brightness. Finally, the processing system determines whether the maximum exposure ratio is smaller than the average exposure ratio. If the maximum exposure ratio is smaller than the average exposure ratio, the strobe shines the flashlight based on the average exposure ratio. Otherwise, the strobe shines flashlight based on the maximum exposure ratio if the maximum exposure ratio is not smaller than the average exposure ratio. 

   
     BRIEF DESCRIPTION OF THE DRAWINGS 
     These and other features, aspects, and advantages of the present invention will become better understood with regard to the following description, appended claims, and accompanying drawings where: 
       FIG. 1  is a flowchart of a method to control auto exposure in accordance with an embodiment of the present invention; 
       FIG. 2  is a schematic diagram of an image split into multiple sample blocks; and 
       FIG. 3  is a schematic block diagram of an image extraction apparatus of an embodiment in accordance with the present invention. 
   

   DESCRIPTION OF THE PREFERRED EMBODIMENTS 
   Reference will now be made in detail to the present preferred embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and the description to refer to the same or like parts. 
   An embodiment in accordance with the present invention discloses a method applied to a strobe of a storage medium for auto exposure control. In the embodiment, the method calculates maximum and average values of individual R, G, B subpixel values of each sample block to control auto exposure (AE). The values of the R, G, B subpixel are weighted after the calculation and are made between a desired maximum brightness and a desired average brightness. Wherein the desired maximum brightness is greater than the desired average brightness. The result of the maximum value calculation is treated as a condition for determining auto exposure control. 
   Refer to  FIG. 1 .  FIG. 1  illustrates a flowchart of the embodiment in accordance with the present invention. 
   First, an original image of the desired picture is split into adequate numbers of sample blocks, as shown at step S 1 . In this embodiment, the original image is split into 56 sample blocks with the same sizes as shown in  FIG. 2 . For each sample block, the maximum subpixel R, G, B values of each pixel of the individual sample block are extracted, as shown as step S 2 . Since the pixels in different samples blocks have different parameters, and each pixel comprises three R, G, B subpixels including a R-subpixel, a G-subpixel and a B-subpixel, the maximum values of the R-subpixel, the G-subpixel and the B-subpixel of the pixels of each sample block can be extracted. For instance, a given sample block contains four pixels, and the values of the R-subpixel, the G-subpixel and the B-subpixel of the four pixels are presented as (125, 36, 96), (75, 89, 92), (37, 156, 63) and (56, 78, 122). Thus, the maximum values of the R, G, B subpixels of that sample block are respectively 125 for the R-subpixel, 156 for the G-subpixel and 122 for the B-subpixel. Therefore, the maximum values of the individual R, G, B subpixels of each sample block can be extracted through this way and denoted respectively as rMax 1 , rMax 2 , . . . , rMax 56  for the R-subpixel, gMax 1 , gMax 2 , . . . , gMax 56  for the G-subpixel and bMax 1 , bMax 2 , . . . , bMax 56  f for the G-subpixel. 
   After the values of the R, G, B subpixels have been extracted, average values of each individual R, G, B subpixel of each sample block can be calculated, as shown in step S 3 . Taking the aforementioned example, the average value of all the R-subpixel is (125+75+37+56)/4=73.25, the average value of all the G-subpixel is (36+89+156+78)/4=89.75, and the average value of all the B-subpixel is (95+92+63+122)/4=93 in the sample block. The average values are respectively denoted as rAvg 1 , rAvg 2 , . . . , rAvg 56  for the R-subpixel, gAvg 1 , gAvg 2 , . . . , gAvg 56  for the G-subpixel, and bAvg 1 , bAvg 2 , . . . , bAvg 56  for the B-subpixel. 
   The maximum values of the R, G, B subpixels between all sample blocks are respectively multiplied by weighted values (w i ), and the products are summed to obtain a sum of maximum values for each of the R, G, B subpixels, as shown in step S 4 . Those sums of maximum values are respectively denoted as rSumMax for the R-subpixel, gSumMax for the G-subpixel and B-SumMax for the B-subpixel. Taking the aforementioned example to illustrate, rSumMax=rMax 1 ×w 1 +rMax 2 ×w 2 + . . . +rMax 56 ×w 56 , SumMax=gMax 1 ×w 1 +gMax 2 ×w 2 + . . . +gMax 56 ×w 56 , and bSumMax=bMax 1 ×w 1 +bMax 2 ×w 2 + . . . +bMax 56 ×w 56 . Likewise, The average values of the R, G, B subpixels of all sample blocks are respectively multiplied by weighted values (w i ), and the products are summed to obtain the sum of the average values for each of the R, G, B subpixels, as shown in step S 5 . Those sums of average values are respectively denoted as rSumAvg for the R-subpixel, gSumAvg for the G-subpixel and bSumAvg for the B-subpixel. Taking the aforementioned example to illustrate, rSumAvg=rAvg 1 ×w 1 +rAvg 2 ×w 2 + . . . +rAvg 56 ×w 56 , gSumAvg=gAvg 1 ×w 1 +gAvg 2 ×w 2 + . . . +gAvg 56 ×w 56 , and bSumAvg=bAvg 1 ×w 1  +bAvg 2 ×w 2 + . . . +bAvg 56 ×w 56 . 
   When the values of rSumMax, gSumMax and bSumMax are acquired, the maximum of the three values is divided by the sum of weighted value (w sum )to acquire a maximum sum auto exposure value, maxSumAe, as shown as step S 6 . That means maxSumAe=MAX(rSumMax, gSumMax, bSumMax)/w sum . Likewise, the maximum one of the three sum of average values, rSumAvg, gSumAvg and bSumAvg, is divided by the sum of weighted value (w sum ) to acquire an average sum exposure value, avgSumAe, as shown as step S 7 . That means avgSumAe=MAX (rSumAvg, gSumAvg, bSumAvg)/w sum . The next is to configure a desired maximum brightness and a desired average brightness, as shown in step S 8 . Configuring rules of the desired maximum brightness and the desired average brightness depend on practical demands. After the configuration of the desired brightness, a maximum exposure ratio and an average exposure ratio can be calculated with the maxSumAe and avgSumAe, as shown in step S 9 . The maximum exposure ratio is defined the quotient of dividing the desired maximum brightness by the maximum sum auto exposure value, maxSumAe (i.e. the maximum exposure ratio=the desired maximum brightness/maxSumAe), and is denoted as maxRatio. Likewise, the average exposure ratio is defined the quotient of dividing the desired average brightness by the average sum auto exposure value, avgSumAe (i.e. the average exposure ratio=the desired average brightness/avgSumAe), and is denoted as avgRatio. When the maxRatio and the avgRatio have been obtained, the values of the maxRatio and the avgRatio are compared with each other as shown in step S 10 . If the maxRatio is smaller than the avgRatio, making a flashlight based on the value of the avgRatio, as shown at step S 11 . Otherwise, if the maxRatio is not smaller than the avgRatio, making a flashlight based on the value of the maxRatio, as shown in step S 12 . 
   Refer to  FIG. 3 .  FIG. 3  illustrates an embodiment of a storage medium, for example an image extraction apparatus in accordance with the present invention. The image extraction apparatus  10  comprises a lens module  100 , an image-sensing unit  200 , a motor driving device  500 , a storage unit  600 , a processing system  700  and a strobe  800 . The image-sensing unit  200  senses and captures image information. The processing system  700  comprises a microprocessor  400  and a digital signal processing unit  300 . The microprocessor  400  receives image information, processes the image information and produces control signals. The digital signal processing unit  300  calculates image information data. The motor driving device  500  moves the lens module  100  or the image-sensing unit  200  to positions where the storage medium is focused. The storage unit  600  saves image data. The strobe  800  shines a flashlight based on the control signals of the microprocessor  400 . In this embodiment, the aforementioned auto exposure method uses the digital signal processing unit  300  of the processing unit  700  to calculate image data. Then, the microprocessor  400  determines the calculated result by the digital signal processing unit  300  and configures exposing parameters to shoot the picture with the determined result controlling the auto exposure. The following disclosure describes the operation procedures of the processing unit  700 , and descriptions related to other components are omitted. 
   The digital signal processing unit  300  splits an original image of a desired picture into multiple sample blocks. For conveniently illustrative purpose only, an image is split into  56  sample blocks as shown in  FIG. 2 . For each sample block, the maximum values and average values of individual R, G, B subpixels can be obtained, where the maximum values are respectively denoted as rMax 1 , rMax 2 , . . . , rMax 56 , gMax 1 , gMax 2 , . . . , gMax 56 , and bMax 1 , bMax 2 , . . . , bMax 56 , and the average values are respectively denoted as rAvg 1 , rAvg 2 , . . . , rAvg 56 , gAvg 1 , gAvg 2 , . . . , gAvg 56 , and bAvg 1 , bAvg 2 , . . . , bAvg 56 . Thus, the values of rSumMax, gSumMax, bSumMax, rSumAvg, gSumAvg and bSumAvg can be calculated by multiplication with weighed values w i  and additions of the products as previously described. The digital signal processing unit  300  performs calculations to divide the maximum value of the rSumMax, gSumMax and bSumMax by w sum  and denotes the quotient as maxSumAe that means the maximum sum exposure value. Likewise, the digital signal processing unit  300  performs calculations to divide the maximum value of the rSumAvg, gSumAvg and bSumAvg by the w sum  and denotes the quotient as avgSumAe. The digital signal processing unit  300  calculates respectively based on the maxSumAe, the avgSumAe and a previous configured desired maximum brightness and a desired average brightness to produce the maximum exposure ratio and the average exposure ratio. As previously described, the maximum exposure ratio. is denoted as maxRatio and is defined the quotient of dividing the desired maximum brightness by maxSumAe. Likewise, the average exposure ratio is denoted as avgRatio and is defined the quotient of dividing the desired average brightness by avgSumAe. Thus, the microprocessor  400  compares the two values of the maxRatio and avgRatio. If the value of the maxRatio is smaller than the value of the avgRatio, the microprocessor  400  sends commands so that the strobe  800  shines the flashlight based on the value of the avgRatio for taking a picture. Otherwise, if the maxRatio is not smaller than the value of the avgRatio, the microprocessor  400  sends commands so that the image extraction apparatus shines the flashlight based on the value of the maxRatio for taking a picture. 
   Although this embodiment splits an image into 56 sample blocks of the same size, a person skilled in the art will recognize that the image can also be split into 56 sample blocks of different sizes. The auto exposure method in accordance with the present invention may be applied to any digital image extraction products that use an auto exposure algorithm. The method uses the maximum and the average values of the sample blocks to calculate, and configures the upper limit of the maximum value and the lower limit of the average value. Consequently, the method provides optimal exposure results and prevents exposure errors in some specific conditions. 
   It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.