Abstract:
A method of generating a high dynamic range image and an electronic device using the same are described. The method includes loading a brightness adjustment model created by a neural network algorithm; obtaining an original image; acquiring a pixel characteristic value, a first characteristic value in a first direction, and a second characteristic value in a second direction of the original image; and generating an HDR image through the brightness adjustment model according to the pixel characteristic value, the first characteristic value, and the second characteristic value of the original image. The electronic device includes a brightness adjustment model, a characteristic value acquisition unit, and a brightness adjustment procedure. The electronic device acquires a pixel characteristic value, a first characteristic value, and a second characteristic value of an original image through the characteristic value acquisition unit, and generates an HDR image from the original image through the brightness adjustment model.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This non-provisional application claims priority under 35 U.S.C. §119(a) on Patent Application No(s). 098109806 filed in Taiwan, R.O.C. on Mar. 25, 2009, the entire contents of which are hereby incorporated by reference. 
       BACKGROUND OF THE INVENTION 
       [0002]    1. Field of Invention 
         [0003]    The present invention relates to an image processing method and an electronic device using the same, and more particularly to a method of generating a high dynamic range (HDR) image and an electronic device using the same. 
         [0004]    2. Related Art 
         [0005]    When sensing the lights, the visual system of the human eye adjusts its sensitiveness according to the distribution of the ambient lights. Therefore, the human eye may be adapted to a too-bright or too-dark environment after a few minutes&#39; adjustment. Currently, the working principles of the image pickup apparatus, such as video cameras, cameras, single-lens reflex cameras, and Web cameras, are similar, in which a captured image is projected via a lens to a sensing element based on the principle of pinhole imaging. However, the photo-sensitivity ranges of a photo-sensitive element such as a film, a charge coupled device sensor (CCD sensor), and a complementary metal-oxide semiconductor sensor (CMOS sensor) are different from that of the human eye, and cannot be automatically adjusted with the image. Therefore, the captured image usually has a part being too bright or too dark.  FIG. 1  is a schematic view of an image with an insufficient dynamic range. The image  10  is an image with an insufficient dynamic range captured by an ordinary digital camera. In  FIG. 1 , an image block  12  at the bottom left corner is too dark, while an image block  14  at the top right corner is too bright. In such a case, the details of the trees and houses in the image block  12  at the bottom left corner cannot be clearly seen as this area is too dark. 
         [0006]    In the prior art, in order to solve the above problem, a high dynamic range (HDR) image is adopted. The HDR image is formed by capturing images of the same area with different photo-sensitivities by using different exposure settings, and then synthesizing those captured images into an image comfortable to be seen by the human eye.  FIG. 2  is a schematic view of synthesizing a plurality of images into an HDR image. The HDR image  20  is formed by synthesizing a plurality of images  21 ,  23 ,  25 ,  27 , and  29  with different photo-sensitivities. This method achieves a good effect, but also has apparent disadvantages. First, the position of each captured image must be accurate, and any error may result in difficulties of the synthesis. Besides, when the images are captured, the required storage space rises from a single frame to a plurality of frames. Moreover, the time taken for the synthesis is also considered. Therefore, this method is time-consuming, wastes the storage space, and easy to practice mistakes. 
       SUMMARY OF THE INVENTION 
       [0007]    In order to solve the above problems, the present invention is a method of generating a high dynamic range (HDR) image, capable of generating an HDR image from an original image through a brightness adjustment model trained by a neural network algorithm. 
         [0008]    The present invention provides a method of generating an HDR image. The method comprises: loading a brightness adjustment model created by a neural network algorithm; obtaining an original image; acquiring a pixel characteristic value, a first characteristic value in a first direction, and a second characteristic value in a second direction of the original image; and generating an HDR image through the brightness adjustment model according to the pixel characteristic value, the first characteristic value, and the second characteristic value of the original image. 
         [0009]    The first direction is different from the second direction, the first direction is a horizontal direction, and the second direction is a vertical direction. 
         [0010]    The pixel characteristic value of the original image is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 1 
               
               = 
               
                 
                   Y 
                   ij 
                 
                 
                   
                     ∑ 
                     
                       i 
                       = 
                       1 
                     
                     N 
                   
                    
                   
                     
                       ∑ 
                       
                         j 
                         = 
                         1 
                       
                       M 
                     
                      
                     
                       
                         Y 
                         ij 
                       
                       
                         N 
                         × 
                         M 
                       
                     
                   
                 
               
             
             , 
           
         
       
     
         [0000]    where C 1  is the pixel characteristic value of the original image, N is a total number of pixels in the horizontal direction of the original image, M is a total number of pixels in the vertical direction of the original image, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of the original image, and N, M, i, and j are positive integers. 
         [0011]    The first characteristic value of the original image is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   x 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       
                         ( 
                         
                           i 
                           + 
                           x 
                         
                         ) 
                       
                        
                       j 
                     
                   
                 
                 x 
               
             
             , 
           
         
       
     
         [0000]    where C 2     x    is the first characteristic value of the original image, x is a number of pixels in the first direction of the original image, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of the original image, Y (i+x)j  is a brightness value of an (i+x) th  pixel in the first direction and the j th  pixel in the second direction of the original image, and i, j, and x are positive integers. 
         [0012]    The second characteristic value of the original image is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   y 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       i 
                        
                       
                         ( 
                         
                           j 
                           + 
                           y 
                         
                         ) 
                       
                     
                   
                 
                 y 
               
             
             , 
           
         
       
     
         [0000]    where C 2     y    is the second characteristic value of the original image, y is a number of pixels in the second direction of the original image, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of the original image, Y i(j+y)  is a brightness value of an i th  pixel in the first direction and a (j+y) th  pixel in the second direction of the original image, and i, j, and y are positive integers. 
         [0013]    The brightness adjustment model is created in an external device. The creation process comprises: loading a plurality of training images; and acquiring a pixel characteristic value, a first characteristic value in a first direction, and a second characteristic value in a second direction of each of the training images, and creating the brightness adjustment model through the neural network algorithm. 
         [0014]    The first direction is different from the second direction, the first direction is a horizontal direction, and the second direction is a vertical direction. 
         [0015]    The pixel characteristic value of each of the training images is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 1 
               
               = 
               
                 
                   Y 
                   ij 
                 
                 
                   
                     ∑ 
                     
                       i 
                       = 
                       1 
                     
                     N 
                   
                    
                   
                     
                       ∑ 
                       
                         j 
                         = 
                         1 
                       
                       M 
                     
                      
                     
                       
                         Y 
                         ij 
                       
                       
                         N 
                         × 
                         M 
                       
                     
                   
                 
               
             
             , 
           
         
       
     
         [0000]    where C 1  is the pixel characteristic value of each of the training images, N is a total number of pixels in the horizontal direction of each of the training images, M is a total number of pixels in the vertical direction of each of the training images, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of each of the training images, and N, M, i, and j are positive integers. 
         [0016]    The first characteristic value of each of the training images is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   x 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       
                         ( 
                         
                           i 
                           + 
                           x 
                         
                         ) 
                       
                        
                       j 
                     
                   
                 
                 x 
               
             
             , 
           
         
       
     
         [0000]    where C 2     x    is the first characteristic value of each of the training images, x is a number of pixels in the first direction of each of the training images, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of each of the training images, Y (i+x)j  is a brightness value of an (i+x) th  pixel in the first direction and the j th  pixel in the second direction of each of the training images, and i, j, and x are positive integers. 
         [0017]    The second characteristic value of each of the training images is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   y 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       i 
                        
                       
                         ( 
                         
                           j 
                           + 
                           y 
                         
                         ) 
                       
                     
                   
                 
                 y 
               
             
             , 
           
         
       
     
         [0000]    where C 2     y    is the second characteristic value of each of the training images, y is a number of pixels in the second direction of each of the training images, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of each of the training images, Y i(j+y)  is a brightness value of an i th  pixel in the first direction and a (j+y) th  pixel in the second direction of each of the training images, and i, j, and y are positive integers. 
         [0018]    The neural network algorithm is a back-propagation neural network (BNN), radial basis function (RBF), or self-organizing map (SOM) algorithm. 
         [0019]    An electronic device for generating an HDR image is adapted to perform brightness adjustment on an original image through a brightness adjustment model. The electronic device comprises a brightness adjustment model, a characteristic value acquisition unit, and a brightness adjustment procedure. The brightness adjustment model is created by a neural network algorithm. The characteristic value acquisition unit acquires a pixel characteristic value, a first characteristic value in a first direction, and a second characteristic value in a second direction of the original image. The brightness adjustment procedure is connected to the brightness adjustment model and the characteristic value acquisition unit, for generating an HDR image through the brightness adjustment model according to the pixel characteristic value, the first characteristic value, and the second characteristic value of the original image. 
         [0020]    The first direction is different from the second direction, the first direction is a horizontal direction, and the second direction is a vertical direction. 
         [0021]    The pixel characteristic value of the original image is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 1 
               
               = 
               
                 
                   Y 
                   ij 
                 
                 
                   
                     ∑ 
                     
                       i 
                       = 
                       1 
                     
                     N 
                   
                    
                   
                     
                       ∑ 
                       
                         j 
                         = 
                         1 
                       
                       M 
                     
                      
                     
                       
                         Y 
                         ij 
                       
                       
                         N 
                         × 
                         M 
                       
                     
                   
                 
               
             
             , 
           
         
       
     
         [0000]    where C 1  is the pixel characteristic value of the original image, N is a total number of pixels in the horizontal direction of the original image, M is a total number of pixels in the vertical direction of the original image, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of the original image, and N, M, i, and j are positive integers. 
         [0022]    The first characteristic value of the original image is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   x 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       
                         ( 
                         
                           i 
                           + 
                           x 
                         
                         ) 
                       
                        
                       j 
                     
                   
                 
                 x 
               
             
             , 
           
         
       
     
         [0000]    where C 2     x    is the first characteristic value of the original image, x is a number of pixels in the first direction of the original image, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of the original image, Y (i+x)j  is a brightness value of an (i+x) th  pixel in the first direction and the j th  pixel in the second direction of the original image, and i, j, and x are positive integers. 
         [0023]    The second characteristic value of the original image is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   y 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       i 
                        
                       
                         ( 
                         
                           j 
                           + 
                           y 
                         
                         ) 
                       
                     
                   
                 
                 y 
               
             
             , 
           
         
       
     
         [0000]    where C 2     y    is the second characteristic value of the original image, y is a number of pixels in the second direction of the original image, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of the original image, Y i(j+y)  is a brightness value of an i th  pixel in the first direction and a (j+y) th  pixel in the second direction of the original image, and i, j, and y are positive integers. 
         [0024]    The brightness adjustment model is created in an external device. The creation process comprises: loading a plurality of training images; and acquiring a pixel characteristic value, a first characteristic value in a first direction, and a second characteristic value in a second direction of each of the training images, and creating the brightness adjustment model through the neural network algorithm. 
         [0025]    The first direction is different from the second direction, the first direction is a horizontal direction, and the second direction is a vertical direction. 
         [0026]    The pixel characteristic value of each of the training images is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 1 
               
               = 
               
                 
                   Y 
                   ij 
                 
                 
                   
                     ∑ 
                     
                       i 
                       = 
                       1 
                     
                     N 
                   
                    
                   
                     
                       ∑ 
                       
                         j 
                         = 
                         1 
                       
                       M 
                     
                      
                     
                       
                         Y 
                         ij 
                       
                       
                         N 
                         × 
                         M 
                       
                     
                   
                 
               
             
             , 
           
         
       
     
         [0000]    where C 1  is the pixel characteristic value of each of the training images, N is a total number of pixels in the horizontal direction of each of the training images, M is a total number of pixels in the vertical direction of each of the training images, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of each of the training images, and N, M, i, and j are positive integers. 
         [0027]    The first characteristic value of each of the training images is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   x 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       
                         ( 
                         
                           i 
                           + 
                           x 
                         
                         ) 
                       
                        
                       j 
                     
                   
                 
                 x 
               
             
             , 
           
         
       
     
         [0000]    where C 2     x    is the first characteristic value of each of the training images, x is a number of pixels in the first direction of each of the training images, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of each of the training images, Y (i+x)j  is a brightness value of an (i+x) th  pixel in the first direction and the j th  pixel in the second direction of each of the training images, and i, j, and x are positive integers. 
         [0028]    The second characteristic value of each of the training images is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   y 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       i 
                        
                       
                         ( 
                         
                           j 
                           + 
                           y 
                         
                         ) 
                       
                     
                   
                 
                 y 
               
             
             , 
           
         
       
     
         [0000]    where C 2     y    is the second characteristic value of each of the training images, y is a number of pixels in the second direction of each of the training images, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of each of the training images, Y i(j+y)  is a brightness value of an i th  pixel in the first direction and a (j+y) th  pixel in the second direction of each of the training images, and i, j, and y are positive integers. 
         [0029]    The neural network algorithm is a BNN, RBF, or SOM algorithm. 
         [0030]    According to the method of generating an HDR image and the electronic device of the present invention, an HDR image can be generated from a single image through a brightness adjustment model trained by a neural network algorithm. Thereby, the time taken for capturing a plurality of images is shortened and the space for storing the captured images is reduced. Meanwhile, the time for synthesizing a plurality of images into a single image is reduced. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0031]    The present invention will become more fully understood from the detailed description given herein below for illustration only, and thus are not limitative of the present invention, and wherein: 
           [0032]      FIG. 1  is a schematic view of an image with an insufficient dynamic range; 
           [0033]      FIG. 2  is a schematic view of synthesizing a plurality of images into an HDR image; 
           [0034]      FIG. 3  is a flow chart of a method of generating an HDR image according to an embodiment of the present invention; 
           [0035]      FIG. 4  is a flow chart of creating a brightness adjustment model according to an embodiment of the present invention; 
           [0036]      FIG. 5  is a schematic architectural view of an electronic device for generating an HDR image according to another embodiment of the present invention; 
           [0037]      FIG. 6  is a flow chart of creating a brightness adjustment model according to another embodiment of the present invention; and 
           [0038]      FIG. 7  is a schematic view illustrating a BNN algorithm according to an embodiment of the present invention. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0039]    The method of generating an HDR image of the present invention is applied to an electronic device capable of capturing an image. This method can be built in a storage unit of the electronic device in the form of a software or firmware program, and implemented by a processor of the electronic device in the manner of executing the built-in software or firmware program while using its image capturing function. The electronic device may be, but not limited to, a digital camera, a computer, a mobile phone, or a personal digital assistant (PDA) capable of capturing an image. 
         [0040]      FIG. 3  is a flow chart of a method of generating an HDR image according to an embodiment of the present invention. The method comprises the following steps. 
         [0041]    In step S 100 , a brightness adjustment model created by a neural network algorithm is loaded. 
         [0042]    In step S 110 , an original image is obtained. 
         [0043]    In step S 120 , a pixel characteristic value, a first characteristic value in a first direction, and a second characteristic value in a second direction of the original image are acquired. 
         [0044]    In step S 130 , an HDR image is generated through the brightness adjustment model according to the pixel characteristic value, the first characteristic value, and the second characteristic value of the original image. 
         [0045]    In the step S 120 , the first direction is different from the second direction, the first direction is a horizontal direction, and the second direction is a vertical direction. Here, the first direction and the second direction can be adjusted according to actual requirements. For example, the two directions may respectively be positive 45° and positive 135° intersected with an X-axis, or positive 30° and positive 150° intersected with the X-axis. However, the acquisition direction of the characteristic value of the original image must be consistent with the acquisition direction of the characteristic value of the training image (i.e., being the same direction). 
         [0046]    In the step S 120 , the pixel characteristic value of the original image is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 1 
               
               = 
               
                 
                   Y 
                   ij 
                 
                 
                   
                     ∑ 
                     
                       i 
                       = 
                       1 
                     
                     N 
                   
                    
                   
                     
                       ∑ 
                       
                         j 
                         = 
                         1 
                       
                       M 
                     
                      
                     
                       
                         Y 
                         ij 
                       
                       
                         N 
                         × 
                         M 
                       
                     
                   
                 
               
             
             , 
           
         
       
     
         [0000]    where C 1  is the pixel characteristic value of the original image, N is a total number of pixels in the horizontal direction of the original image, M is a total number of pixels in the vertical direction of the original image, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of the original image, and N, M, i, and j are positive integers. 
         [0047]    In the step S 120 , the first characteristic value of the original image is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   x 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       
                         ( 
                         
                           i 
                           + 
                           x 
                         
                         ) 
                       
                        
                       j 
                     
                   
                 
                 x 
               
             
             , 
           
         
       
     
         [0000]    where C 2     x    is the first characteristic value of the original image, x is a number of pixels in the first direction of the original image, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of the original image, Y (i+x)j  is a brightness value of an (i+x) th  pixel in the first direction and the j th  pixel in the second direction of the original image, and i, j, and x are positive integers. 
         [0048]    In the step S 120 , the second characteristic value of the original image is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   y 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       i 
                        
                       
                         ( 
                         
                           j 
                           + 
                           y 
                         
                         ) 
                       
                     
                   
                 
                 y 
               
             
             , 
           
         
       
     
         [0000]    where C 2     x    is the second characteristic value of the original image, y is a number of pixels in the second direction of the original image, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of the original image, Y i(j+y)  is a brightness value of an i th  pixel in the first direction and a (j+y) th  pixel in the second direction of the original image, and i, j, and y are positive integers. 
         [0049]    Further, in the step S 100 , the brightness adjustment model is created in an external device. The external device may be, but not limited to, a computer device of the manufacturer or a computer device in a laboratory.  FIG. 4  is a flow chart of creating a brightness adjustment model according to an embodiment of the present invention. The creation process comprises the following steps. 
         [0050]    In step S 200 , a plurality of training images is loaded. 
         [0051]    In step S 210 , a pixel characteristic value, a first characteristic value in a first direction, and a second characteristic value in a second direction of each of the training images are acquired, and the brightness adjustment model is created through the neural network algorithm. 
         [0052]    In the step S 210 , the first direction is different from the second direction, the first direction is a horizontal direction, and the second direction is a vertical direction. Here, the first direction and the second direction can be adjusted according to actual requirements. For example, the two directions may respectively be positive 45° and positive 135° intersected with an X-axis, or positive 30° and positive 150° intersected with the X-axis. However, the acquisition direction of the characteristic value of the original image must be consistent with the acquisition direction of the characteristic value of the training image (i.e., being the same direction). 
         [0053]    In the step S 210 , the pixel characteristic value of each of the training images is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 1 
               
               = 
               
                 
                   Y 
                   ij 
                 
                 
                   
                     ∑ 
                     
                       i 
                       = 
                       1 
                     
                     N 
                   
                    
                   
                     
                       ∑ 
                       
                         j 
                         = 
                         1 
                       
                       M 
                     
                      
                     
                       
                         Y 
                         ij 
                       
                       
                         N 
                         × 
                         M 
                       
                     
                   
                 
               
             
             , 
           
         
       
     
         [0000]    where C 1  is the pixel characteristic value of each of the training images, N is a total number of pixels in the horizontal direction of each of the training images, M is a total number of pixels in the vertical direction of each of the training images, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of each of the training images, and N, M, i, and j are positive integers. 
         [0054]    In the step S 210 , the first characteristic value of each of the training images is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   x 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       
                         ( 
                         
                           i 
                           + 
                           x 
                         
                         ) 
                       
                        
                       j 
                     
                   
                 
                 x 
               
             
             , 
           
         
       
     
         [0000]    where C 2     x    is the first characteristic value of each of the training images, x is a number of pixels in the first direction of each of the training images, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of each of the training images, Y (i+x)j  is a brightness value of an (i+x) th  pixel in the first direction and the j th  pixel in the second direction of each of the training images, and i, j, and x are positive integers. 
         [0055]    In the step S 210 , the second characteristic value of each of the training images is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   y 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       i 
                        
                       
                         ( 
                         
                           j 
                           + 
                           y 
                         
                         ) 
                       
                     
                   
                 
                 y 
               
             
             , 
           
         
       
     
         [0000]    where C 2     y    is the second characteristic value of each of the training images, y is a number of pixels in the second direction of each of the training images, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of each of the training images, Y i(j+y)  is a brightness value of an i th  pixel in the first direction and a (j+y) th  pixel in the second direction of each of the training images, and i, j, and y are positive integers. 
         [0056]    The neural network algorithm is a back-propagation neural network (BNN), radial basis function (RBF), or self-organizing map (SOM) algorithm. 
         [0057]      FIG. 5  is a schematic architectural view of an electronic device for generating an HDR image according to another embodiment of the present invention. The electronic device  30  comprises a storage unit  32 , a processing unit  34 , and an output unit  36 . The storage unit  32  stores an original image  322 , and may be, but not limited to, a random access memory (RAM), a dynamic random access memory (DRAM), or a synchronous dynamic random access memory (SDRAM). 
         [0058]    The processing unit  34  is connected to the storage unit  32 , and comprises a brightness adjustment model  344 , a characteristic value acquisition unit  342 , and a brightness adjustment procedure  346 . The characteristic value acquisition unit  342  acquires a pixel characteristic value, a first characteristic value in a first direction, and a second characteristic value in a second direction of the original image  322 . The brightness adjustment model  344  is created by a neural network algorithm. The brightness adjustment procedure  346  generates an HDR image through the brightness adjustment model  344  according to the pixel characteristic value, the first characteristic value, and the second characteristic value of the original image  322 . The processing unit  34  may be, but not limited to, a central processing unit (CPU) or a micro control unit (MCU). The output unit  36  is connected to the processing unit  34 , for displaying the generated HDR image on a screen of the electronic device  30 . 
         [0059]    The first direction is different from the second direction, the first direction is a horizontal direction, and the second direction is a vertical direction. Here, the first direction and the second direction can be adjusted according to actual requirements. For example, the two directions may respectively be positive 45° and positive 135° intersected with an X-axis, or positive 30° and positive 150° intersected with the X-axis. However, the acquisition direction of the characteristic value of the original image must be consistent with the acquisition direction of the characteristic value of the training image (i.e., being the same direction). 
         [0060]    The pixel characteristic value of the original image  322  is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 1 
               
               = 
               
                 
                   Y 
                   ij 
                 
                 
                   
                     ∑ 
                     
                       i 
                       = 
                       1 
                     
                     N 
                   
                    
                   
                     
                       ∑ 
                       
                         j 
                         = 
                         1 
                       
                       M 
                     
                      
                     
                       
                         Y 
                         ij 
                       
                       
                         N 
                         × 
                         M 
                       
                     
                   
                 
               
             
             , 
           
         
       
     
         [0000]    where C 1  is the pixel characteristic value of the original image  322 , N is a total number of pixels in the horizontal direction of the original image  322 , M is a total number of pixels in the vertical direction of the original image  322 , Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of the original image  322 , and N, M, i, and j are positive integers. 
         [0061]    The first characteristic value of the original image is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   x 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       
                         ( 
                         
                           i 
                           + 
                           x 
                         
                         ) 
                       
                        
                       j 
                     
                   
                 
                 x 
               
             
             , 
           
         
       
     
         [0000]    where C 2     x    is the first characteristic value of the original image  322 , x is a number of pixels in the first direction of the original image  322 , Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of the original image  322 , Y (i+x)j  is a brightness value of an (i+x) th  pixel in the first direction and the j th  pixel in the second direction of the original image  322 , and i, j, and x are positive integers. 
         [0062]    The second characteristic value of the original image  322  is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   y 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       i 
                        
                       
                         ( 
                         
                           j 
                           + 
                           y 
                         
                         ) 
                       
                     
                   
                 
                 y 
               
             
             , 
           
         
       
     
         [0000]    where C 2     y    is the second characteristic value of the original image  322 , y is a number of pixels in the second direction of the original image  322 , Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of the original image  322 , Y i(j+y)  is a brightness value of an i th  pixel in the first direction and a (j+y) th  pixel in the second direction of the original image  322 , and i, j, and y are positive integers. 
         [0063]    The brightness adjustment model is created in an external device. The external device may be, but not limited to, a computer device of the manufacturer or a computer device in a laboratory.  FIG. 6  is a flow chart of creating a brightness adjustment model according to another embodiment of the present invention. The creation process comprises the following steps. 
         [0064]    In step S 300 , a plurality of training images is loaded. 
         [0065]    In step S 310 , a pixel characteristic value, a first characteristic value in a first direction, and a second characteristic value in a second direction of each of the training images are acquired, and the brightness adjustment model is created through the neural network algorithm. 
         [0066]    In the step S 310 , the first direction is different from the second direction, the first direction is a horizontal direction, and the second direction is a vertical direction. Here, the first direction and the second direction can be adjusted according to actual requirements. For example, the two directions may respectively be positive 45° and positive 135° intersected with an X-axis, or positive 30° and positive 150° intersected with the X-axis. However, the acquisition direction of the characteristic value of the original image must be consistent with the acquisition direction of the characteristic value of the training image (i.e., being the same direction). 
         [0067]    In the step S 310 , the pixel characteristic value of each of the training images is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 1 
               
               = 
               
                 
                   Y 
                   ij 
                 
                 
                   
                     ∑ 
                     
                       i 
                       = 
                       1 
                     
                     N 
                   
                    
                   
                     
                       ∑ 
                       
                         j 
                         = 
                         1 
                       
                       M 
                     
                      
                     
                       
                         Y 
                         ij 
                       
                       
                         N 
                         × 
                         M 
                       
                     
                   
                 
               
             
             , 
           
         
       
     
         [0000]    where C 1  is the pixel characteristic value of each of the training images, N is a total number of pixels in the horizontal direction of each of the training images, M is a total number of pixels in the vertical direction of each of the training images, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of each of the training images, and N, M, i, and j are positive integers. 
         [0068]    In the step S 310 , the first characteristic value of each of the training images is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   x 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       
                         ( 
                         
                           i 
                           + 
                           x 
                         
                         ) 
                       
                        
                       j 
                     
                   
                 
                 x 
               
             
             , 
           
         
       
     
         [0000]    where C 2     x    is the first characteristic value of each of the training images, x is a number of pixels in the first direction of each of the training images, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of each of the training images, Y (i+x)j  is a brightness value of an (i+x) th  pixel in the first direction and the j th  pixel in the second direction of each of the training images, and i, j, and x are positive integers. 
         [0069]    In the step S 310 , the second characteristic value of each of the training images is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 C 
                 
                   2 
                   y 
                 
               
               = 
               
                 
                   
                     Y 
                     ij 
                   
                   - 
                   
                     Y 
                     
                       i 
                        
                       
                         ( 
                         
                           j 
                           + 
                           y 
                         
                         ) 
                       
                     
                   
                 
                 y 
               
             
             , 
           
         
       
     
         [0000]    where C 2     y    is the second characteristic value of each of the training images, y is a number of pixels in the second direction of each of the training images, Y ij  is a brightness value of an i th  pixel in the first direction and a j th  pixel in the second direction of each of the training images, Y i(j+y)  is a brightness value of an i th  pixel in the first direction and a (j+y) th  pixel in the second direction of each of the training images, and i, j, and y are positive integers. 
         [0070]    The neural network algorithm is a BNN, RBF, or SOM algorithm. 
         [0071]      FIG. 7  is a schematic view illustrating the BNN algorithm according to an embodiment of the present invention. The BNN  40  comprises an input layer  42 , a hidden layer  44 , and an output layer  46 . Each of the training images has altogether M*N pixels, and each pixel further has three characteristic values (i.e., a pixel characteristic value, a first characteristic value, and a second characteristic value). The input layer respectively inputs the characteristic values of the pixels in each training image, so that a total number of nodes (X 1 , X 2 , X 3 , . . . , X α ) in the input layer  42  is α=3*M*N. A number of nodes (P 1 , P 2 , P 3 , . . . , P β ) in the hidden layer  44  is β, a number of nodes (Y 1 , Y 2 , Y 3 , . . . , Y γ ) in the output layer  46  is γ, and α β γ. After the BNN algorithm trains and determines the convergence of all the training images, a brightness adjustment model is obtained. A first group of weight values W αβ  are obtained between the input layer  42  and the hidden layer  44  of the brightness adjustment model, and a second group of weight values W βγ  are obtained between the hidden layer  44  and the output layer  46  of the brightness adjustment model. 
         [0072]    The value of each node in the hidden layer  44  is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 P 
                 j 
               
               = 
               
                 
                   
                     ∑ 
                     
                       i 
                       = 
                       1 
                     
                     α 
                   
                    
                   
                     ( 
                     
                       
                         X 
                         i 
                       
                       × 
                       
                         W 
                         ij 
                       
                     
                     ) 
                   
                 
                 + 
                 
                   b 
                   j 
                 
               
             
             , 
           
         
       
     
         [0000]    where P j  is a value of a j th  node in the hidden layer  44 , X i  is a value of an i th  node in the input layer  42 , W ij  is a weight value between the i th  node in the input layer  42  and the j th  node in the hidden layer  44 , b j  is an offset of the j th  node in the hidden layer  44 , and α, i, and j are positive integers. 
         [0073]    Further, the value of each node in the output layer  46  is calculated by the following formula: 
         [0000]    
       
         
           
             
               
                 Y 
                 k 
               
               = 
               
                 
                   
                     ∑ 
                     
                       j 
                       = 
                       1 
                     
                     β 
                   
                    
                   
                     ( 
                     
                       
                         P 
                         j 
                       
                       × 
                       
                         W 
                         jk 
                       
                     
                     ) 
                   
                 
                 + 
                 
                   c 
                   k 
                 
               
             
             , 
           
         
       
     
         [0000]    where Y k  is a value of a k th  node in the output layer  46 , P j  is the value of the j th  node in the hidden layer  44 , W jk  is a weight value between the j th  node in the hidden layer  44  and the k th  node in the output layer  46 , c k  is an offset of the k th  node in the output layer  46 , and β, j, and k are positive integers. 
         [0074]    In addition, the convergence is determined by mean squared error (MSE): 
         [0000]    
       
         
           
             
               
                 M 
                  
                 
                     
                 
                  
                 S 
                  
                 
                     
                 
                  
                 E 
               
               = 
               
                 
                   
                     1 
                     
                       λ 
                       × 
                       γ 
                     
                   
                   × 
                   
                     
                       ∑ 
                       s 
                       λ 
                     
                      
                     
                       
                         ∑ 
                         k 
                         γ 
                       
                        
                       
                         
                           ( 
                           
                             
                               T 
                               k 
                               s 
                             
                             - 
                             
                               Y 
                               k 
                               s 
                             
                           
                           ) 
                         
                         2 
                       
                     
                   
                 
                 &lt; 
                 
                   10 
                   
                     - 
                     10 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    where λ is a total number of the training images, γ is a total number of the nodes in the output layer, T k   s  is a target output value of the k th  node in an s th  training image, Y k   s  is a deducted output value of the k th  node in the s th  training image, and λ, γ, s, and k are positive integers.