# Patent

## Title
Method and device for image processing

## Abstract

Embodiments provide a method for processing a first image based on a second image, wherein each pixel in the first image has a plurality of color components and has a corresponding pixel in the second image, and wherein each value of a color component in the first image corresponds to a value of a color component in the second image. The method may include deciding, for each color component of a pixel in the first image, whether to modify the value of the color component dependent on a predetermined criterion. The method may further include determining a similarity index between the pixel in the first image and the corresponding pixel in the second image based on, for each color component of the pixel, the value of the color component of the pixel, or if it is decided that the value of the color component of the pixel is to be modified, the corresponding value of the color component in the second image.

## Background
CROSS-REFERENCE TO RELATED APPLICATIONS
The present application is a U.S. National Stage Application under 35 U.S.C. §371 of International Application No. PCT/SG2011/000264, filed on Jul. 26, 2011, the complete disclosure of which is incorporated herein by reference. The present application claims the benefit of the US provisional patent application 61/367,489 filed on 26 Jul. 2010, the entire contents of which are incorporated herein by reference for all purposes.


TECHNICAL FIELD
Embodiments relate generally to signal processing. Specifically, embodiments relate to a method and a device for image processing.
BACKGROUND
Many natural scenes have wider dynamic ranges than those that can be recorded by conventional low dynamic range (LDR) imaging systems. An LDR image with small exposure time is under-exposed in the dark scene regions but captures the bright areas well. In contrast, an LDR image with large exposure time is saturated in the bright scene regions but captures the dark areas well. In other words, one LDR image is not able to represent the whole scene. A high dynamic range (HDR) image can be produced to represent the whole scene by sequentially capturing multiple differently exposed LDR images using normal cameras.
When an HDR image is synthesized for a scene by using multiple differently exposed LDR images, moving objects in the LDR images may cause ghosting artifacts in the final HDR image. This is often encountered in outdoor settings, wherein moving people, bus, clouds or trees waving, etc. may be captured as moving objects. To remove ghosting artifacts due to moving objects in the scene, the pixels of all LDR images are required to be properly classified into valid and invalid, and only valid pixels are used to generate the HDR image. Due to sensor and electronic noises as well as different exposures in the input LDR images, it is challenging to detect moving objects in the LDR images.
One approach is based on camera response functions (CRF) to remove ghosting artifacts. The predicted value for a pixel in an image can be computed by using the CRFs, the co-located pixel value in its reference image and their exposure times. The pixel is marked as valid if it is well approximated by the predicted value. Otherwise, it is marked as invalid in an error map. The schemes based on CRF are, however, sensitive to the estimate error of CRFs.
Another approach is based on the feature that local entropy is usually not changed much with respect to the exposure times. The local entropy is computed, and all pixels with local entropy variation larger than a threshold may be marked as invalid in an error map. Although the local entropy based method is not sensitive to the estimation error of CRFs, it is not suitable for a situation when two image regions share the same structure but with different intensity.
In another aspect, the invalid regions are usually patched by only using pixels from one single LDR image. Since moving objects usually belong to invalid regions, the dynamic ranges of moving objects in the synthesized HDR image are reduced when their dynamic ranges are inherently high.
It is thus desired to provide a movement detection scheme which is robust with respect to different exposures and variation among pixels caused by sensor and electronic noises, for the synthesis of an HDR image via a set of differently exposed LDR images.
It is also desired to provide a method to better preserve the dynamic range of moving objects in the synthesized HDR image.
SUMMARY
Various embodiments provide a method for processing a first image based on a second image, wherein each pixel in the first image has a plurality of color components and has a corresponding pixel in the second image, and wherein each value of a color component in the first image corresponds to a value of a color component in the second image. The method may include deciding, for each color component of a pixel in the first image, whether to modify the value of the color component dependent on a predetermined criterion. The method may further include determining a similarity index between the pixel in the first image and the corresponding pixel in the second image based on, for each color component of the pixel, the value of the color component of the pixel, or if it is decided that the value of the color component of the pixel is to be modified, the corresponding value of the color component in the second image.



BRIEF DESCRIPTION OF THE DRAWINGS
In the drawings, like reference characters generally refer to the same parts throughout the different views. The drawings are not necessarily to scale, emphasis instead generally being placed upon illustrating the principles of the invention. In the following description, various embodiments are described with reference to the following drawings, in which:
FIG. 1 shows a flow diagram for synthesis of a HDR image according to an embodiment.
FIG. 2 shows a flow diagram for image processing according to various embodiments.
FIG. 3 shows the processing order of a sequence of images according to an embodiment.
FIG. 4 shows a schematic diagram of an image processing device according to various embodiments.
FIG. 5 shows an image sequence with five different exposure time.
FIG. 6 shows experimental results of a bi-directional similarity detection method of an embodiment and a uni-directional similarity detection method carried out on the image sequence of FIG. 5.
FIG. 7 shows an image sequence with seven different exposure time.
FIG. 8 shows experimental results of using an adaptive threshold according to an embodiment and using a fixed threshold for movement detection.
FIG. 9 shows experimental result of an synthesized HDR image based on the image sequence of FIG. 5.
FIG. 10 shows an HDR video generated by the method of an embodiment.
FIG. 11 shows a LDR image sequence with eleven different exposure time.
FIG. 12 shows experimental results of different methods for ghosting artifacts removal.
FIG. 13 shows HDR images generated by PHOTOMATIX and a method of an embodiment.



DESCRIPTION
Various embodiments provide a method for image processing. Various features described below in the context of the image processing method may analogously hold true for the corresponding device, and vice versa.
One embodiment is directed to a method for processing a first image based on a second image, wherein each pixel in the first image has a plurality of color components and has a corresponding pixel in the second image, and wherein each value of a color component in the first image corresponds to a value of a color component in the second image. The method may include deciding, for each color component of a pixel in the first image, whether to modify the value of the color component dependent on a predetermined criterion. The method may further include determining a similarity index between the pixel in the first image and the corresponding pixel in the second image based on, for each color component of the pixel, the value of the color component of the pixel, or if it is decided that the value of the color component of the pixel is to be modified, the corresponding value of the color component in the second image.
In an embodiment, each pixel in the first image and its corresponding pixel in the second image are co-located. The pixel in the first image and its corresponding pixel in the second image are co-located if these two pixels are at the same spatial position in the first and the second images.
In an embodiment, the first image and the second image may be part of a sequence of images with different exposure time, e.g. a sequence of low dynamic range images. The second image may also be referred to as a reference image of the first image.
In an embodiment, the plurality of color components may include a red color component, a green color component, and a blue color component. In another embodiment, the plurality of color components may include other types of color components in accordance with other color space, for example, may include a cyan color component, a magenta color component and a yellow color component if CMYK (cyan, magenta, yellow and key) color space is used.
In an embodiment, the method further includes deciding, for each color component of the corresponding pixel in the second image, whether to modify the value of the color component of the corresponding pixel dependent on a predetermined criterion, wherein each value of a color component in the second image corresponds to a value of a color component in the first image. The method may further include determining the similarity index between the pixel in the first image and the corresponding pixel in the second image based on, for each color component of the corresponding pixel, the value of the color component of the corresponding pixel, or if it is decided that the value of the color component of the corresponding pixel is to be modified, the corresponding value of the color component in the first image.
According to an embodiment, deciding whether to modify the value of the color component is dependent on the value of the color component of the pixel in the first image and the value of the color component of the corresponding pixel in the second image.
According to another embodiment, deciding whether to modify the value of the color component is dependent on a comparison of an exposure level of the color component of the pixel in the first image with an exposure level of the color component of the corresponding pixel in the second image.
In an embodiment, the exposure level of the color component of the pixel in the first image represents a deviation of the value of the color component of the pixel from a predetermined value, and the exposure level of the color component of the corresponding pixel in the second image represents a deviation of the value of the color component of the corresponding pixel from the predetermined value. The predetermined value is a middle value of a value range of the first image and the second image. For example, if the value range of the first image and the second image is [0, 255], the predetermined value may be determined to be the middle value 127.
According to an embodiment, the corresponding value of a color component in the second image is determined to correspond to the value of a color component in the first image based on an intensity mapping function from the first image to the second image, wherein the intensity mapping function is determined based on accumulated histograms of the first image and the second image. For example, the corresponding value of a color component in the second image may be determined to be a value which minimizes the difference between the accumulated histogram of the first image and the accumulated histogram of the second image.
Dependent on the determined similarity index, the pixel of the first image may be determined to be within or out of a moving object region.
Another embodiment is directed to a device for processing a first image based on a second image, wherein each pixel in the first image has a plurality of color components and has a corresponding pixel in the second image, and wherein each value of a color component in the first image corresponds to a value of a color component in the second image. The device may include a decider configured to decide, for each color component of a pixel in the first image, whether to modify the value of the color component dependent on a predetermined criterion. The device may further include a similarity index determiner configured to determine a similarity index between the pixel in the first image and the corresponding pixel in the second image based on, for each color component of the pixel, the value of the color component of the pixel, or if it is decided that the value of the color component of the pixel is to be modified, the corresponding value of the color component in the second image.
Another embodiment is directed to a method for processing a first image based on a second image, wherein the first image and the second image are part of a sequence of images captured with different exposure time. The method may include determining a similarity index between a pixel of the first image and a corresponding pixel of the second image, wherein the similarity index represents a degree of similarity between the pixel and the corresponding pixel. The method may include determining a threshold for the pixel dependent on at least one of exposure time of the first image, exposure time of the second image, a film speed for capturing the sequence of images, and an average exposure value of the sequence of images. The method may further include determining the pixel to be within or out of a moving object region dependent on a comparison of the determined similarity index with the determined threshold.
In an embodiment, the threshold for the pixel is determined dependent on an intensity value of the pixel in the first image and an intensity value of the corresponding pixel in the second image.
In another embodiment, the threshold for the pixel is determined dependent on an exposure level of the pixel in the first image and an exposure level of the corresponding pixel in the second image. The exposure level of the pixel in the first image may represent a deviation of the intensity value of the pixel from a predetermined value, and the exposure level of the corresponding pixel in the second image may represent a deviation of the intensity value of the corresponding pixel from the predetermined value. The predetermined value is a middle value of an intensity value range of the first image and the second image.
In an embodiment, determining the similarity index between the pixel of the first image and the corresponding pixel of the second image may include deciding, for each color component of the pixel in the first image, whether to modify the value of the color component dependent on a predetermined criterion, wherein each value of a color component in the first image corresponds to a value of a color component in the second image. The determination of the similarity index may further include determining the similarity index between the pixel in the first image and the corresponding pixel in the second image based on, for each color component of the pixel, the value of the color component of the pixel, or if it is decided that the value of the color component of the pixel is to be modified, the corresponding value of the color component in the second image.
Another embodiment is directed to a device for processing a first image based on a second image, wherein the first image and the second image are part of a sequence of images captured with different exposure time. The device may include a similarity index determiner configured to determine a similarity index between a pixel of the first image and a corresponding pixel of the second image, wherein the similarity index represents a degree of similarity between the pixel and the corresponding pixel. The device may further include a threshold determiner configured to determine a threshold for the pixel dependent on at least one of exposure time of the first image, exposure time of the second image, a film speed for capturing the sequence of images, and an average exposure value of the sequence of images. The device may further include a moving object region determiner configured to determine the pixel to be within or out of a moving object region dependent on a comparison of the determined similarity index with the determined threshold.
A further embodiment of the invention is directed to a method for processing a first image based on a second image, wherein the first image and the second image are part of a sequence of images captured with different exposure time. The method may include determining a similarity index between a pixel of the first image and a corresponding pixel of the second image, wherein the similarity index represents a degree of similarity between the pixel and the corresponding pixel. The method may further include determining a threshold for the pixel; and determining the pixel to be within or out of a moving object region dependent on a comparison of the determined similarity index with the determined threshold. If the pixel is determined to be within the moving object region, the method include determining a corresponding intensity value in the first image corresponding to an intensity value of the corresponding pixel in the second image or in a third image of the sequence of images based on an intensity mapping function from the second image to the first image, wherein the intensity mapping function is determined based on accumulated histograms of the first image and the second or the third image. The method further include determining an updated intensity value of the pixel in the first image to be the determined corresponding intensity value in the first image.
In one embodiment, if the pixel is determined to be within the moving object region, the corresponding intensity value in the first image may be determined based on the intensity mapping function from the second image to the first image. In other words, the intensity value of the corresponding pixel in the second image is mapped to the first image to determine the corresponding intensity value in the first image.
In another embodiment, if the pixel is determined to be within the moving object region, the method may further include determining whether the corresponding pixel of the second image and the corresponding pixel of the third image is similar. The corresponding pixels of the second image and the third image may be similar if their intensity values are similar. If the corresponding pixel of the second image is not similar to the corresponding pixel of the third image, the corresponding intensity value in the first image may be determined based on the intensity mapping function from the second image to the first image. In other words, the intensity value of the corresponding pixel in the second image is mapped to the first image to determine the corresponding intensity value in the first image.
If the corresponding pixel of the second image is similar to the corresponding pixel of the third image, the corresponding intensity value in the first image may be determined based on the intensity mapping function from the third image to the first image. In other words, the intensity value of the corresponding pixel in the third image is mapped to the first image to determine the corresponding intensity value in the first image.
According to an embodiment, the intensity mapping function may include minimizing a difference between the accumulated histogram of the first image and the accumulated histogram of the second image. The accumulated histogram of the first image may represent a number of pixels in the first image having an intensity value equal to or less than an intensity value to be determined, i.e. the corresponding intensity value in the first image. The accumulated histogram of the second image may represent a number of pixels in the second image having an intensity value equal to or less than the intensity value of the corresponding pixel in the second image. The accumulated histogram of the third image may represent a number of pixels in the third image having an intensity value equal to or less than the intensity value of the corresponding pixel in the third image.
In an embodiment, the intensity mapping function may be an arg min function, such that the corresponding intensity value in the first image is determined to be a value which minimizes the difference between the accumulated histogram of the second image (or the third image) up to the intensity value of the corresponding pixel in the second image (or the third image) and the accumulated histogram of the first image up to the corresponding intensity value in the first image.
In an embodiment, the method may further include applying an average filter to the determined corresponding intensity value using a plurality of neighboring pixels, wherein intensity values of the plurality of neighboring pixels have been processed and updated according to the method above.
According to an embodiment, if the pixel is determined to be out of the moving object region, the updated intensity value of the pixel is determined to be the intensity value of the pixel.
In the above embodiments, the corresponding intensity value in the first image and the updated intensity value of the pixel may be determined for each color component of the pixel separately.
A further embodiment is directed to a device for processing a first image based on a second image, wherein the first image and the second image are part of a sequence of images captured with different exposure time. The device include a similarity index determiner configured to determine a similarity index between a pixel of the first image and a corresponding pixel of the second image, wherein the similarity index represents a degree of similarity between the pixel and the corresponding pixel. The device may further include a threshold determiner configured to determine a threshold for the pixel, and a moving object region determiner configured to determine the pixel to be within or out of a moving object region dependent on a comparison of the determined similarity index with the determined threshold. The device may further include a corresponding intensity value determiner configured to determine a corresponding intensity value in the first image corresponding to an intensity value of the corresponding pixel in the second image based on an intensity mapping function from the second image to the first image, if the pixel is determined to be within the moving object region, wherein the intensity mapping function is determined based on accumulated histograms of the first image and the second image. The device may further include an updater configured to determine an updated intensity value of the pixel in the first image to be the determined corresponding intensity value in the first image.
In this context, the various image processing devices as described in the embodiments may include a memory which is for example used in the processing carried out by the image processing devices. A memory used in the embodiments may be a volatile memory, for example a DRAM (Dynamic Random Access Memory) or a non-volatile memory, for example a PROM (Programmable Read Only Memory), an EPROM (Erasable PROM), EEPROM (Electrically Erasable PROM), or a flash memory, e.g., a floating gate memory, a charge trapping memory, an MRAM (Magnetoresistive Random Access Memory) or a PCRAM (Phase Change Random Access Memory).
In this context, the image processing devices as described in this description may be or may include an image processing circuit.
In an embodiment, a “circuit” may be understood as any kind of a logic implementing entity, which may be special purpose circuitry or a processor executing software stored in a memory, firmware, or any combination thereof. Thus, in an embodiment, a “circuit” may be a hard-wired logic circuit or a programmable logic circuit such as a programmable processor, e.g. a microprocessor (e.g. a Complex Instruction Set Computer (CISC) processor or a Reduced Instruction Set Computer (RISC) processor). A “circuit” may also be a processor executing software, e.g. any kind of computer program, e.g. a computer program using a virtual machine code such as e.g. Java. Any other kind of implementation of the respective functions which will be described in more detail below may also be understood as a “circuit” in accordance with an alternative embodiment.
FIG. 1 shows a flow diagram for synthesis of a HDR image according to an embodiment.
A sequence of images 110, e.g. LDR images, with different exposure time is received as input images. The LDR images 110 may include moving objects.
The sequence of LDR images 110 may be processed at 120. For example, the processing of the LDR images 110 may include detecting moving objects in the LRD images 110, removing the moving objects in the LDR images 110, and generating updated LDR images 130. Various embodiments of the image processing method at 120 will be described in more detail below.
Based on the updated LDR images 130, a camera response function is estimated at 140.
Based on the updated LDR images 130 and the estimated camera response function, an HDR image 160 is synthesized at 150.
FIG. 2 shows a flow diagram for image processing according to various embodiments.
The image processing 120 in FIG. 1 may be performed in accordance with various embodiments described in FIG. 2, in order to process the LDR images to remove moving objects and to use the processed LDR images to synthesize the HDR image.
A sequence of LDR images 110 with different exposure time is received as input images. The sequence of LDR images 110 may be processed in a predetermined order, such that each time one LDR image (also referred to as a first image) is processed based on another LDR image (also referred to as a second image) selected as its reference image. The processing order of the sequence of LDR images 110 according to an embodiment is illustrated in FIG. 3.
According to the embodiment in FIG. 3, a sequence of images 110 indexed by 1, 2, . . . , k0−1, k0, k0+1, . . . , n0 is received as input images. A middle image denoted as Zk0 may be selected as an initial reference image. All pixels in the initial reference image Zk0 are marked as valid. Since the correlations between neighboring images are the strongest, the initial reference image Zk0 may be selected as the reference image for the image Zk0−1 and also for the image Zk0+1. Accordingly, a pixel at location p, Zk0(p), in the reference image Zk0 may be used to determine whether the co-located pixels Zk0−1(p) and Zk0+1(p) in the images Zk0−1 and Zk0+1 are valid, i.e. within or out of a moving objection region, based on the similarity between the reference pixel Zk0(p) and the respective co-located pixels Zk0−1(p) and Zk0+1(p). The intensity values of invalid pixels in the images Zk0−1(p) and Zk0+1(p) may be corrected or updated to obtain an updated image Zk0−1(p)update and an updated image Zk0+1(p)update, in which the moving object is removed. The pixel Zk0(p) in the initial reference image Zk0 may also be applied to detect whether pixels Zk(p)(|k−k0|>1) in other images is valid.
In another embodiment, as correlation between images Zk0 and Zk becomes weaker when the value of |k−k0| is greater than 1, the reference image for each image to be processed is updated progressively. For example, after the image Zk0−1 is processed based on the initial reference image Zk0 to obtain the updated image Zk0−1(p)update, the updated image Zk0−1(p)update is used as the reference image for the next image Zk0−2 for the processing of the image Zk0−2.
According to an embodiment, the sequence of images may be processed in the order of Zk0−1, Zk0−2, . . . , Z1, Zk0+1, Zk0+2, . . . , Zn0 as demonstrated in FIG. 3.
For simplicity, for an image Zk to be processed, its reference image is denoted as Zk′. The value of k′ corresponds to the exposure time Δtk of image Zk′ and its value is updated as




  
    k
    ′
  
  =
  
    {
    
      
        
          
            
              k
              +
              1
            
            ;
          
        
        
          
            
              if
              ⁢
              
                
              
              ⁢
              k
            
            <
            
              k
              0
            
          
        
      
      
        
          
            
              k
              -
              1
            
            ;
          
        
        
          
            
              if
              ⁢
              
                
              
              ⁢
              k
            
            >
            
              
                k
                0
              
              .
            
          
        
      
    
  




In this context, the reference image denoted by Zk′ has been updated or processed to remove the moving object in the original image indexed by k′. If k′=k0, Zk′=Zk0.
A pixel in an image Zk(k≠k0) is marked as valid if it is similar to the co-located pixel in its reference image Zk′, and is marked as invalid otherwise.
When moving objects exist in the images Zk(1≦k≦n0), there may be ghosting artifacts in the final HDR image if images Zk(1≦k≦n0) are directly adopted to synthesize the final HDR image. To remove ghosting artifacts from the final HDR image, it is necessary to detect moving objects in images Zk(1≦k≦n0). In the following, the similarity determination between an image and its reference image, the similarity threshold determination, the moving object region determination, and the image updating according to various embodiments are described in detail. For simplicity, these embodiments are described in the context of a first image Zk and a second image Zk′, and it is understood that the various embodiments may be applied to all the images in the sequence 110 in the order illustrated in FIG. 3 to obtain an updated or processed sequence of images.
Let Zk(p)=[Zk,1(p), Zk,2(p), Zk,3(p)]T denote the image intensity vector of the position p in image Zk, wherein Zk,l(p) represents the intensity value of a color component l, for example, for one of RGB (red, green, blue) color components or one of CMYK (cyan, magenta, yellow and key) color components. p represents a spatial position in the image Zk, k(1≦k≦n0) indexes LDR images with different exposures and indexes over exposure time Δtk, and n0 is the total number of input LDR images. These differently exposed LDR images may be referred to as a Wyckoff set of images, from which a HDR image may be generated. Let Ek(p)=[Ek,1(p), Ek,2(p), Ek,3(p)]T denote the irradiance vector corresponding to Zk(p). The relationship between Ek(p) and Zk(p) is given as

Zk(p)=ƒ(Ek(p)Δtk+ηq,k(p))+ηƒ,k(p),   (1)

wherein ƒ(·)(=[ƒ1(·), ƒ2(·), ƒ3(·)]T) represents the camera response function (CRF) vector, ηq,k(p)(=[ηq,k,1(p), ηq,k,2(p), ηq,k,3(p)]T) represents sensor noise vector, and ηƒ,k(p)(=[ηƒ,k,1(p), ηƒ,k,2(p), ηƒ,k,3(p)]T) represents electronics noise vector. ƒl(·) is monotonically increasing and its inverse function is denoted as ƒl−1(·), wherein l indexes the color component.

If there is no moving object in the scene and all LDR images are well aligned, equation (1) may become:

Zk(p)=ƒ(E(p)Δtk+ηq,k(p))+ηƒ,k(p).   (2)

One feature of differently exposed LDR images Zk and Zk′ is that there is possibly large intensity change between two co-located pixels Zk(p) and Zk′(p) due to different exposures.
Consider two pixels Zk(p) and Zk(p′) with the same color component value of Zk,l(p) and Zk,l(p′). The other feature of differently exposed images is that there is possibly large variation between the values of Zk′,l(p) and Zk′,l(p′) in the reference image due to the sensor and electronic noises. It is shown from Equation (1) that the values of Zk′,l(p) and Zk′,l(p′) are the same in the ideal case that there is neither sensor noise nor electronic noise. However, the values of ηq,k,l(p), ηƒ,k,l(p′), ηq,k′,l(p) and ηƒ,k′,l(p′) are usually not zeros. There is variation between the values of Zk′,l(p) and Zk′,l(p′) caused by the sensor noise. The variation could be large in the presence of the electronic noise, especially when Zk,l(p) and Zk,l(p′) are saturated or under-exposed.
At 210, a similarity index for differently exposed LDR images is determined according to various embodiments. The similarity index is determined based on an intensity mapping function (IMF), taking the above two features of differently exposed LDR images into consideration.
Since there is possible large intensity change between two co-located pixels Zk(p) and Zk′(p) in the first image Zk and the second image Zk′, the original intensity values Zk(p) and Zk′(p) may not be directly used to determine the similarity index. According to an embodiment, a decision may be performed to determine whether the intensity values of the pixels Zk(p) and Zk′(p) need to be modified dependent on a predetermined criterion, so as to obtain a pair of updated pixels {hacek over (Z)}k(p) and {hacek over (Z)}k′(p). The similarity index for the pixels p is determined based on the updated intensity values {hacek over (Z)}k(p) and {hacek over (Z)}k′(p).
According to an embodiment, the decision may be performed for each color component Zk,l(p) and Zk′,l(p) of the pixels Zk(p) and Zk′(p). In an embodiment, the decision is performed dependent on the values of the color component Zk,l(p) and Zk′,l(p). In another embodiment, the decision is performed dependent on the exposure level of the color component Zk,l(p) and the exposure level of the color component Zk′,l(p).
According to an embodiment, the updated pair of pixels {hacek over (Z)}k(p) and {hacek over (Z)}k′(p) are generated by using a bi-directional mapping method as




  
    
      
        
          
            
              Z
              ⋓
            
            
              k
              ,
              l
            
          
          ⁡
          
            (
            p
            )
          
        
        =
        
          {
          
            
              
                
                  
                    
                      
                        
                          Z
                          
                            k
                            ,
                            l
                          
                        
                        ⁡
                        
                          (
                          p
                          )
                        
                      
                      ;
                    
                  
                  
                    
                      
                        if
                        ⁢
                        
                          
                        
                        ⁢
                        
                          w
                          ⁡
                          
                            (
                            
                              
                                Z
                                
                                  k
                                  ,
                                  l
                                
                              
                              ⁡
                              
                                (
                                p
                                )
                              
                            
                            )
                          
                        
                      
                      ≤
                      
                        w
                        ⁡
                        
                          (
                          
                            
                              Z
                              
                                
                                  k
                                  ′
                                
                                ,
                                l
                              
                            
                            ⁡
                            
                              (
                              p
                              )
                            
                          
                          )
                        
                      
                    
                  
                
                
                  
                    
                      
                        
                          Λ
                          
                            k
                            ,
                            
                              k
                              ′
                            
                            ,
                            l
                          
                        
                        ⁡
                        
                          (
                          
                            
                              Z
                              
                                k
                                ,
                                l
                              
                            
                            ⁡
                            
                              (
                              p
                              )
                            
                          
                          )
                        
                      
                      ;
                    
                  
                  
                    
                      otherwise
                      ,
                    
                  
                
              
              ⁢
              
                

              
              ⁢
              
                
                  
                    Z
                    ⋓
                  
                  
                    
                      k
                      ′
                    
                    ,
                    l
                  
                
                ⁡
                
                  (
                  p
                  )
                
              
            
            =
            
              {
              
                
                  
                    
                      
                        
                          Λ
                          
                            
                              k
                              ′
                            
                            ,
                            k
                            ,
                            l
                          
                        
                        ⁡
                        
                          (
                          
                            
                              Z
                              
                                
                                  k
                                  ′
                                
                                ,
                                l
                              
                            
                            ⁡
                            
                              (
                              p
                              )
                            
                          
                          )
                        
                      
                      ;
                    
                  
                  
                    
                      
                        if
                        ⁢
                        
                          
                        
                        ⁢
                        
                          w
                          ⁡
                          
                            (
                            
                              
                                Z
                                
                                  k
                                  ,
                                  l
                                
                              
                              ⁡
                              
                                (
                                p
                                )
                              
                            
                            )
                          
                        
                      
                      ≤
                      
                        w
                        ⁡
                        
                          (
                          
                            
                              Z
                              
                                
                                  k
                                  ′
                                
                                ,
                                l
                              
                            
                            ⁡
                            
                              (
                              p
                              )
                            
                          
                          )
                        
                      
                    
                  
                
                
                  
                    
                      
                        
                          Z
                          
                            
                              k
                              ′
                            
                            ,
                            l
                          
                        
                        ⁡
                        
                          (
                          p
                          )
                        
                      
                      ;
                    
                  
                  
                    
                      otherwise
                      ,
                    
                  
                
              
            
          
        
      
    
    
      
        (
        3
        )
      
    
  




wherein ω(z) represents the exposure level of a pixel determined based on the intensity value z of the pixel, and Λ(z) represents an intensity mapping function as described in detail below. ω(z) may be determined in accordance with the following equation:





  
    
      
        
          w
          ⁡
          
            (
            z
            )
          
        
        =
        
          {
          
            
              
                
                  
                    
                      (
                      
                        z
                        +
                        1
                      
                      )
                    
                    /
                    128
                  
                  ;
                
              
              
                
                  
                    if
                    ⁢
                    
                      
                    
                    ⁢
                    z
                  
                  ≤
                  127
                
              
            
            
              
                
                  
                    
                      (
                      
                        256
                        -
                        z
                      
                      )
                    
                    /
                    128
                  
                  ;
                
              
              
                
                  otherwise
                  .
                
              
            
          
        
      
    
    
      
        (
        4
        )
      
    
  




In the above embodiment, the exposure level ω(z) represents a deviation of the intensity value z from a predetermined value 127. The predetermined value is a middle value 127 of a value range [0, 255] in the above example of equation (4). In another embodiment wherein the intensity value of the first image and the second image is in a range of [0, 65535], the predetermined value may be determined to be 32767. In other embodiments wherein the first image and the second image are 32-bit or 64 bit images, the predetermined value may be determined to be the middle value of the intensity range accordingly.
In equation (3), Λk,k′(z) represents a corresponding value in the reference image Zk′ determined by mapping the intensity value z in the image Zk to the reference image Zk′ based on an intensity mapping function (IMF), and may be referred to as a forward IMF. Similarly, Λk′,k(z) represents a corresponding value in the image Zk determined by mapping the intensity value z in the reference image Zk′ to the image Zk based on an intensity mapping function, and may be referred to as a backward IMF. Λk,k′(z) may be represented in the form of an IMF vector as Λk,k′(z)(=[Λk,k′,1(z), Λk,k′,2(z), Λk,k′,3(z)]T), and Λk′,k(z) may be represented as an IMF vector Λk′,k(z)(=[Λk′,k,1(z), Λk′,k,2(z), Λk′,k,3(z)]T), in which the corresponding values Λk,k′,l(z) and Λk,k′,l(z) of each color component l is determined.
According to an embodiment, the corresponding values Λk,k′(z) and Λk′,k(z) may be determined based on a respective intensity mapping function, wherein the intensity mapping function is determined based on accumulated histograms Hk(z) and Hk′(z) of the images Zk and Zk′. The accumulated histogram Hk(z) represents the cardinality of a set including all the pixels of the image Zk having an intensity value not larger than z, and Hk′(z) may be similarly determined.
In an embodiment, for the value z of a color component in the image Zk, the corresponding value Λk,k′(z) may be determined by finding an intensity value m which minimize the difference between Hk(z) and Hk′(m). In an exemplary embodiment, the corresponding value Λk,k′(z) may be determined in accordance with the equation below:




  
    
      
        
          
            
              Λ
              
                k
                ,
                
                  k
                  ′
                
                ,
                l
              
            
            ⁡
            
              (
              z
              )
            
          
          =
          
            arg
            ⁢
            
              
            
            ⁢
            
              
                min
                
                  m
                  ∈
                  
                    [
                    
                      
                        
                          Λ
                          
                            k
                            ,
                            
                              k
                              ′
                            
                            ,
                            l
                          
                        
                        ⁡
                        
                          (
                          
                            z
                            -
                            1
                          
                          )
                        
                      
                      ,
                      255
                    
                    ]
                  
                
              
              ⁢
              
                {
                
                  
                  
                    
                      
                        H
                        
                          k
                          ,
                          l
                        
                      
                      ⁡
                      
                        (
                        z
                        )
                      
                    
                    -
                    
                      
                        H
                        
                          
                            k
                            ′
                          
                          ,
                          l
                        
                      
                      ⁡
                      
                        (
                        m
                        )
                      
                    
                  
                  
                
                }
              
            
          
        
        ,
      
    
    
      
        (
        5
        )
      
    
  
  
    
      
        
          
            
              H
              
                k
                ,
                l
              
            
            ⁡
            
              (
              z
              )
            
          
          =
          
            
              ∑
              
                n
                =
                0
              
              z
            
            ⁢
            
              
              
                
                  Θ
                  k
                
                ⁡
                
                  (
                  n
                  )
                
              
              
            
          
        
        ,
        
          

        
        ⁢
        
          
            
              Θ
              k
            
            ⁡
            
              (
              z
              )
            
          
          =
          
            {
            
              
                
                  (
                  
                    i
                    ,
                    j
                  
                  )
                
                ❘
                
                  
                    Z
                    
                      k
                      ,
                      l
                    
                  
                  ⁡
                  
                    (
                    
                      i
                      ,
                      j
                    
                    )
                  
                
              
              =
              z
            
            }
          
        
      
    
    
      
        (
        6
        )
      
    
  




wherein |Θk(z)| is the cardinality of the set Θk(z), and represents the number of pixels in image Zk with the value of Zk,l(p) being equal to or less than z. Λk,k′,l(0)=0, and Λk,k′,l(z) is a monotonic increasing function of z.

The corresponding value Λk′,k(z) for the value z of a color component in the reference image Zk′ may be determined analogously.
The determination of the corresponding values Λk,k′,l(z) and Λk,k′,l(z) using the intensity mapping function according to equations (5) and (6) above does not require estimation of a camera response function, and thereby is robust to the estimation error of the camera response function.
According to the embodiments and equations (3)-(6) above, depending on a comparison of the exposure level of the color component Zk,l(p) with the exposure level of the color component Zk′,l(p), it is decided whether the value of the color component of the pixel Zk,l(p) is to be modified. If yes, the updated value {hacek over (Z)}k(p) is determined to be the corresponding value Λk,k′,l(z). If not, the updated value {hacek over (Z)}k(p) is identical to the original value Zk,l(p) of the pixel. The same decision process is performed to determine the updated value {hacek over (Z)}k′(p) for the corresponding pixel in the reference image Zk′. Since the updated value {hacek over (Z)}k(p) and {hacek over (Z)}k′(p) can be determined using a more reliable value from either the original image or the reference image, the determination of the updated value is referred to as a bi-directional mapping method.
The updated values {hacek over (Z)}k(p) and {hacek over (Z)}k′(p) may be used to determine the similarity index at 210. In an embodiment, the similarity index S(Zk(p), Zk′(p)) may be determined in accordance with the following equation:




  
    
      
        
          S
          ⁡
          
            (
            
              
                
                  Z
                  k
                
                ⁡
                
                  (
                  p
                  )
                
              
              ,
              
                
                  Z
                  
                    k
                    ′
                  
                
                ⁡
                
                  (
                  p
                  )
                
              
            
            )
          
        
        =
        
          
            
              
                2
                ⁢
                
                  
                    ∑
                    
                      l
                      =
                      1
                    
                    3
                  
                  ⁢
                  
                    
                      
                        
                          Z
                          ⋓
                        
                        
                          k
                          ,
                          l
                        
                      
                      ⁡
                      
                        (
                        p
                        )
                      
                    
                    ⁢
                    
                      
                        
                          Z
                          ⋓
                        
                        
                          
                            k
                            ′
                          
                          ,
                          l
                        
                      
                      ⁡
                      
                        (
                        p
                        )
                      
                    
                  
                
              
              +
              1
            
            
              
                
                  ∑
                  
                    l
                    =
                    1
                  
                  3
                
                ⁢
                
                  [
                  
                    
                      
                        
                          Z
                          ⋓
                        
                        
                          k
                          ,
                          l
                        
                        2
                      
                      ⁡
                      
                        (
                        p
                        )
                      
                    
                    +
                    
                      
                        
                          Z
                          ⋓
                        
                        
                          
                            k
                            ′
                          
                          ,
                          l
                        
                        2
                      
                      ⁡
                      
                        (
                        p
                        )
                      
                    
                  
                  ]
                
              
              +
              1
            
          
          .
        
      
    
    
      
        (
        7
        )
      
    
  




According to equation (7), the value of S(Zk(p), Zk′(p)) is 1 when {hacek over (Z)}k(p) and {hacek over (Z)}k′,l(p) are the same for each color component l. The more similar these two updated values {hacek over (Z)}k(p) and {hacek over (Z)}k′(p), the closer the value of S(Zk(p), Zk′(p)) to 1.
In another embodiment, the similarity index Sl(Zk(p), Zk′(p)) for each color component l may be determined in accordance with the following equation:




  
    
      S
      l
    
    ⁡
    
      (
      
        
          
            Z
            k
          
          ⁡
          
            (
            p
            )
          
        
        ,
        
          
            Z
            
              k
              ′
            
          
          ⁡
          
            (
            p
            )
          
        
      
      )
    
  
  =
  
    
      
        2
        ⁢
        
          
        
        ⁢
        
          
            
              Z
              ⋓
            
            
              k
              ,
              l
            
          
          ⁡
          
            (
            p
            )
          
        
        ⁢
        
          
            
              Z
              ⋓
            
            
              
                k
                ′
              
              ,
              l
            
          
          ⁡
          
            (
            p
            )
          
        
      
      +
      1
    
    
      
        
          
            Z
            ⋓
          
          
            k
            ,
            l
          
          2
        
        ⁡
        
          (
          p
          )
        
      
      +
      
        
          
            Z
            ⋓
          
          
            
              k
              ′
            
            ,
            l
          
          2
        
        ⁡
        
          (
          p
          )
        
      
      +
      1
    
  




Based on the IMF vectors Λk,k′(z) and Λk′,k(z) and the bi-directional mapping approach, the robustness of the similarity index of the various embodiments, e.g. in accordance with equation (7), may be significantly improved.
The updated values {hacek over (Z)}k(p) and {hacek over (Z)}k′(p) determined using Λk,k′(z) and Λk′,k(z) may unify the intensity values of Zk(p) and Zk′(p) before the determination of the similarity index.
Table 1 shows the intensity difference between original intensity values Zk(p) and Zk′(p) and between the updated intensity values {hacek over (Z)}k(p) and {hacek over (Z)}k′(p). The LDR image sequence shown in FIG. 5 and the first five images in FIG. 7 below are used to calculate



  
    
      ∑
      p
    
    ⁢
    
      
        
          
            
              Z
              
                k
                ,
                l
              
            
            ⁡
            
              (
              p
              )
            
          
          +
          1
        
        
          
            
              Z
              
                
                  k
                  ′
                
                ,
                l
              
            
            ⁡
            
              (
              p
              )
            
          
          +
          1
        
      
      ⁢
      
        
      
      ⁢
      and
    
  




  
    
      
        ∑
        p
      
      ⁢
      
        
          
            
              
                
                  Z
                  ⋓
                
                
                  k
                  ,
                  l
                
              
              ⁡
              
                (
                p
                )
              
            
            +
            1
          
          
            
              
                
                  Z
                  ⋓
                
                
                  
                    k
                    ′
                  
                  ,
                  l
                
              
              ⁡
              
                (
                p
                )
              
            
            +
            1
          
        
        .
      
    
    ⁢
    
      
    
  



As shown in Table 1, the value of




  
    ∑
    p
  
  ⁢
  
    
      
        
          Z
          
            k
            ,
            1
          
        
        ⁡
        
          (
          p
          )
        
      
      +
      1
    
    
      
        
          Z
          
            
              k
              ′
            
            ,
            1
          
        
        ⁡
        
          (
          p
          )
        
      
      +
      1
    
  




shows a large intensity change between Zk(p) and Zk′(p) of two differently exposed images.

Based on the updated intensity values {hacek over (Z)}k(p) and {hacek over (Z)}k′(p) determined using the IMF vectors Λk,k′(z) and Λk′,k(z), the intensities of the pixels in the two images are unified. Thus, the robustness of the similarity index of the various embodiments with respect to intensity changes between images Zk and Zk′ due to different exposure times are improved. The IMF vectors can also be used to smooth the variation caused by the sensor noise. Therefore, the robustness of the similarity index of various embodiments with respect to the sensor noise is also improved. Meanwhile, a bi-directional mapping approach according to equation (3) is provided to improve the robustness of the similarity index with respect to the electronic noise.
In an illustrative example of a pair of pixels Zk(p) and Zk′(p), Zk,1(p) and Zk,2(p) are well exposed but Zk,3(p) is saturated. Zk′,1(p) and Zk′,2(p) are under-exposed but Zk,3(p) is well exposed. By using the proposed bi-directional mapping approach according to equations (3) and (4) above, pixels {hacek over (Z)}k(p) and {hacek over (Z)}k′(p) are determined to be [Λk,k′,1(Zk,1(p)), Λk,k′,2(Zk,2(p)), Zk,3(p)]T and [Zk′,1(p), Zk′,2(p), Λk′,k,3(Zk′,k,3(p)]T, respectively. Accordingly, a more accurate similarity index is determined using {hacek over (Z)}k(p) and {hacek over (Z)}k′(p) in which each color component of the pair of pixels are evaluated, compared to using three pairs of (Zk(p), Zk′(p), (Zk(p), Λk′,k(Zk′(p))) and (Λk,k′(Zk(p)), Zk′(p)) in which the pair of pixels are evaluated at pixel level without considering each color component.







TABLE 1











  Comparison
  ⁢
  
    
  
  ⁢
  of
  ⁢
  
    
  
  ⁢
  
    
      
        
      
      ∑
    
    p
  
  ⁢
  
    
      
        
          
            Z
            
              k
              ,
              1
            
          
          ⁢
          
            (
            p
            )
          
        
        +
        1
      
      
        
          
            Z
            
              
                k
                ′
              
              ,
              1
            
          
          ⁡
          
            (
            p
            )
          
        
        +
        1
      
    
    ⁢
    
      
    
    ⁢
    and
    ⁢
    
      
        
          
        
        ∑
      
      p
    
    ⁢
    
      
        
          
            
              Z
              ⋓
            
            
              k
              ,
              1
            
          
          ⁡
          
            (
            p
            )
          
        
        +
        1
      
      
        
          
            
              Z
              ⋓
            
            
              
                k
                ′
              
              ,
              1
            
          
          ⁡
          
            (
            p
            )
          
        
        +
        1
      
    
  














      Image sequence




  
    Δ
    ⁢
    
      
    
    ⁢
    
      t
      k
    
  
  
    Δ
    ⁢
    
      
    
    ⁢
    
      t
      
        k
        ′
      
    
  








  
    ∑
    p
  
  ⁢
  
    
      
        
          Z
          
            k
            ,
            1
          
        
        ⁢
        
          (
          p
          )
        
      
      +
      1
    
    
      
        
          Z
          
            
              k
              ′
            
            ,
            1
          
        
        ⁡
        
          (
          p
          )
        
      
      +
      1
    
  








  
    ∑
    p
  
  ⁢
  
    
      
        
          
            Z
            ⋓
          
          
            k
            ,
            1
          
        
        ⁡
        
          (
          p
          )
        
      
      +
      1
    
    
      
        
          
            Z
            ⋓
          
          
            
              k
              ′
            
            ,
            1
          
        
        ⁡
        
          (
          p
          )
        
      
      +
      1
    
  

















In FIG. 5
2  
1.5586
1.1127



4  
2.7178
1.2499



8  
4.3744
1.2107



16  
7.1194
1.1671


In FIG. 7
1.5
1.1471
1.0107



 1.52
1.4592
1.0333



 1.53
2.043
1.1229



 1.54
3.4392
1.3636









The determined similarity index S(Zk(p), Zk′(p)) at 210 may be used to detect moving objects in a set of differently exposed LDR images for HDR imaging.
At 220, a threshold for a pixel in the image Zk is determined using the LDR images 110. The threshold may be used to determined whether the pixel is valid or invalid, in other words, whether the pixel is within or out of a moving object region.
According to an embodiment, the threshold for the pixel is determined dependent on at least one of exposure time of the first image, exposure time of the second image, a film speed for capturing the sequence of images, and an average exposure value of the sequence of images. In another embodiment, the threshold for the pixel is also determined dependent on the exposure level of the pixel.
According to one embodiment, the threshold is determined based on the values of Zk,l(p), Zk′,l(p), exposure time Δtk of the image Zk and exposure time Δtk′ of the reference image Zk′ in accordance with the equation blow




  
    
      
        
          
            Thr
            
              k
              ,
              
                k
                ′
              
            
          
          ⁡
          
            (
            p
            )
          
        
        =
        
          
            2
            ⁢
            
              (
              
                1
                -
                
                  
                    ξ
                    
                      k
                      ,
                      
                        k
                        ′
                      
                    
                  
                  ⁡
                  
                    (
                    p
                    )
                  
                
              
              )
            
          
          
            1
            +
            
              
                (
                
                  1
                  -
                  
                    
                      ξ
                      
                        k
                        ,
                        
                          k
                          ′
                        
                      
                    
                    ⁡
                    
                      (
                      p
                      )
                    
                  
                
                )
              
              2
            
          
        
      
    
    
      
        (
        8
        )
      
    
  




wherein in one embodiment




  
    
      
        ξ
        
          k
          ,
          
            k
            ′
          
        
      
      ⁡
      
        (
        p
        )
      
    
    =
    
      
        15
        16
      
      -
      
        max
        ⁢
        
          {
          
            
              ɛ
              ⁡
              
                (
                
                  
                    
                      Z
                      )
                    
                    
                      k
                      ,
                      l
                    
                  
                  ⁡
                  
                    (
                    p
                    )
                  
                
                )
              
            
            ,
            
              ɛ
              ⁡
              
                (
                
                  
                    
                      Z
                      )
                    
                    
                      
                        k
                        ′
                      
                      ,
                      l
                    
                  
                  ⁡
                  
                    (
                    p
                    )
                  
                
                )
              
            
          
          }
        
        ⁢
        
          ρ
          ⁡
          
            (
            
              k
              ,
              
                k
                ′
              
            
            )
          
        
      
    
  




  
    
      ɛ
      ⁡
      
        (
        z
        )
      
    
    =
    
      {
      
        
          
            
              
                
                  
                    
                      1
                      128
                    
                    ⁢
                    
                      
                        (
                        
                          1
                          -
                          
                            
                              2
                              ⁢
                              z
                            
                            255
                          
                        
                        )
                      
                      
                        
                          (
                          
                            z
                            17
                          
                          )
                        
                        16
                      
                    
                  
                  ;
                
              
              
                
                  
                    if
                    ⁢
                    
                      
                    
                    ⁢
                    z
                  
                  >
                  127
                
              
            
            
              
                
                  
                    
                      1
                      16
                    
                    ⁢
                    
                      
                        (
                        
                          1
                          -
                          
                            
                              2
                              ⁢
                              z
                            
                            255
                          
                        
                        )
                      
                      
                        
                          (
                          
                            50
                            -
                            
                              
                                10
                                ⁢
                                z
                              
                              51
                            
                          
                          )
                        
                        16
                      
                    
                  
                  ;
                
              
              
                otherwise
              
            
          
          ⁢
          
            

          
          ⁢
          
            ρ
            ⁡
            
              (
              
                k
                ,
                
                  k
                  ′
                
              
              )
            
          
        
        =
        
          
            
              max
              ⁡
              
                (
                
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    
                      t
                      k
                    
                  
                  ,
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    
                      t
                      
                        k
                        ′
                      
                    
                  
                
                )
              
            
            
              min
              ⁡
              
                (
                
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    
                      t
                      k
                    
                  
                  ,
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    
                      t
                      
                        k
                        ′
                      
                    
                  
                
                )
              
            
          
        
      
    
  



wherein a threshold for each color component l is determined.

In another embodiment



  
    
      
        ξ
        
          k
          ,
          
            k
            ′
          
        
      
      ⁡
      
        (
        p
        )
      
    
    =
    
      
        max
        
          1
          ≤
          l
          ≤
          3
        
      
      ⁢
      
        {
        
          
            α
            1
          
          +
          
            max
            ⁢
            
              {
              
                
                  ɛ
                  ⁡
                  
                    (
                    
                      
                        
                          Z
                          )
                        
                        
                          k
                          ,
                          l
                        
                      
                      ⁡
                      
                        (
                        p
                        )
                      
                    
                    )
                  
                
                ,
                
                  ɛ
                  ⁡
                  
                    (
                    
                      
                        
                          Z
                          )
                        
                        
                          
                            k
                            ′
                          
                          ,
                          l
                        
                      
                      ⁡
                      
                        (
                        p
                        )
                      
                    
                    )
                  
                
              
              }
            
            ⁢
            
              ρ
              ⁡
              
                (
                
                  k
                  ,
                  
                    k
                    ′
                  
                
                )
              
            
          
        
        }
      
    
  




  
    
      ɛ
      ⁡
      
        (
        z
        )
      
    
    =
    
      {
      
        
          
            
              
                
                  
                    
                      
                        α
                        2
                      
                      ⁡
                      
                        (
                        
                          1
                          -
                          
                            
                              2
                              ⁢
                              z
                            
                            255
                          
                        
                        )
                      
                    
                    
                      
                        (
                        
                          
                            13
                            ⁢
                            z
                          
                          255
                        
                        )
                      
                      16
                    
                  
                  ;
                
              
              
                
                  
                    if
                    ⁢
                    
                      
                    
                    ⁢
                    z
                  
                  >
                  127
                
              
            
            
              
                
                  
                    
                      
                        α
                        3
                      
                      ⁡
                      
                        (
                        
                          1
                          -
                          
                            
                              2
                              ⁢
                              z
                            
                            255
                          
                        
                        )
                      
                    
                    
                      
                        (
                        
                          50
                          -
                          
                            
                              10
                              ⁢
                              z
                            
                            51
                          
                        
                        )
                      
                      16
                    
                  
                  ;
                
              
              
                otherwise
              
            
          
          ⁢
          
            

          
          ⁢
          
            ρ
            ⁡
            
              (
              
                k
                ,
                
                  k
                  ′
                
              
              )
            
          
        
        =
        
          
            
              
                max
                ⁢
                
                  {
                  
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      
                        t
                        k
                      
                    
                    ,
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      
                        t
                        
                          k
                          ′
                        
                      
                    
                  
                  }
                
              
              
                min
                ⁢
                
                  {
                  
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      
                        t
                        k
                      
                    
                    ,
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      
                        t
                        
                          k
                          
                            ′
                            ⁢
                            
                              
                            
                          
                        
                      
                    
                  
                  }
                
              
            
          
          .
        
      
    
  



wherein ε(z) represents the exposure level determined based on the intensity value z. αi(i=1,2,3) are three constants, which may be selected as 1⁄8, 1/64 and 1⁄4, respectively. In other embodiments, the value of αi(i=1,2,3) may be selected as other suitable values. For example, when there is overlapping between the same moving object in images with different exposure times or when the background and the moving object are similar, the value of αi(i=1,2,3) may be selected as 1/16, 1/128 and 1/16, respectively. In this embodiment, a threshold is determined at the pixel level.

According to another embodiment, the threshold may be determined based on the values of Zk,l(p), Zk′,l(p), exposure time Δtk of the image Zk, exposure time Δtk′ of the reference image Zk′, a value υ representing a film speed for capturing the sequence of images, and an average exposure value ĒV of the sequence of images, in accordance with the equation (8) above. In this embodiment,




  
    
      
        
          
            
              
                ξ
                
                  k
                  ,
                  
                    k
                    ′
                  
                
              
              ⁡
              
                (
                p
                )
              
            
            =
            
              
                (
                
                  
                    α
                    1
                  
                  +
                  
                    
                      max
                      
                        1
                        ≤
                        l
                        ≤
                        3
                      
                    
                    ⁢
                    
                      {
                      
                        
                          ɛ
                          ⁡
                          
                            (
                            
                              
                                
                                  Z
                                  )
                                
                                
                                  k
                                  ,
                                  l
                                
                              
                              ⁡
                              
                                (
                                p
                                )
                              
                            
                            )
                          
                        
                        ,
                        
                          ɛ
                          ⁡
                          
                            (
                            
                              
                                
                                  Z
                                  )
                                
                                
                                  
                                    k
                                    ′
                                  
                                  ,
                                  l
                                
                              
                              ⁡
                              
                                (
                                p
                                )
                              
                            
                            )
                          
                        
                      
                      }
                    
                  
                
                )
              
              ⁢
              
                h
                ⁡
                
                  (
                  
                    
                      
                        Δ
                        ⁢
                        
                          
                        
                        ⁢
                        
                          t
                          a
                          M
                        
                      
                      
                        Δ
                        ⁢
                        
                          
                        
                        ⁢
                        
                          t
                          
                            k
                            ,
                            k
                          
                          M
                        
                      
                    
                    ,
                    
                      
                        Δ
                        ⁢
                        
                          
                        
                        ⁢
                        
                          t
                          
                            k
                            ,
                            
                              k
                              ′
                            
                          
                          M
                        
                      
                      
                        Δ
                        ⁢
                        
                          
                        
                        ⁢
                        
                          t
                          
                            k
                            ,
                            
                              k
                              
                                ′
                                ⁢
                                
                                  
                                
                              
                            
                          
                          m
                        
                      
                    
                    ,
                    
                      
                        E
                        _
                      
                      ⁢
                      V
                    
                    ,
                    v
                  
                  )
                
              
            
          
          ⁢
          
            

          
          ⁢
          
            
          
          ⁢
          
            ɛ
            ⁡
            
              (
              z
              )
            
          
        
        =
        
          {
          
            
              
                
                  
                    
                      0
                      ;
                    
                  
                  
                    
                      
                        if
                        ⁢
                        
                          
                        
                        ⁢
                        z
                      
                      >
                      127
                    
                  
                
                
                  
                    
                      
                        
                          
                            α
                            2
                          
                          ⁡
                          
                            (
                            
                              1
                              -
                              
                                
                                  2
                                  ⁢
                                  z
                                
                                255
                              
                            
                            )
                          
                        
                        
                          
                            (
                            
                              50
                              -
                              
                                
                                  10
                                  ⁢
                                  z
                                
                                51
                              
                            
                            )
                          
                          16
                        
                      
                      ;
                    
                  
                  
                    
                      otherwise
                      .
                    
                  
                
              
              ⁢
              
                

              
              ⁢
              
                
              
              ⁢
              
                h
                ⁡
                
                  (
                  
                    
                      x
                      1
                    
                    ,
                    
                      x
                      2
                    
                    ,
                    
                      x
                      3
                    
                    ,
                    
                      x
                      4
                    
                  
                  )
                
              
            
            =
            
              {
              
                
                  
                    
                      
                        
                          10
                          ⁢
                          
                            
                              (
                              
                                
                                  x
                                  1
                                
                                ⁢
                                
                                  x
                                  4
                                
                              
                              )
                            
                            
                              1
                              /
                              8
                            
                          
                        
                        
                          
                            
                              (
                              
                                10
                                ⁢
                                
                                  
                                    log
                                    2
                                  
                                  ⁡
                                  
                                    (
                                    
                                      x
                                      2
                                    
                                    )
                                  
                                
                              
                              )
                            
                            
                              1
                              /
                              4
                            
                          
                          ⁢
                          
                            
                            
                              x
                              3
                            
                            
                          
                        
                      
                      ;
                    
                  
                  
                    
                      
                        if
                        ⁢
                        
                          
                        
                        ⁢
                        
                          x
                          3
                        
                      
                      ⁢
                      
                        
                      
                      <
                      10
                    
                  
                
                
                  
                    
                      
                        
                          
                            (
                            
                              
                                x
                                1
                              
                              ⁢
                              
                                x
                                4
                              
                            
                            )
                          
                          
                            1
                            /
                            8
                          
                        
                        
                          
                            
                              (
                              
                                
                                  log
                                  2
                                
                                ⁡
                                
                                  (
                                  
                                    x
                                    2
                                  
                                  )
                                
                              
                              )
                            
                            
                              1
                              /
                              4
                            
                          
                          ⁢
                          
                            
                              (
                              
                                10
                                ⁢
                                
                                  x
                                  3
                                
                              
                              )
                            
                            
                              1
                              /
                              8
                            
                          
                        
                      
                      ;
                    
                  
                  
                    
                      otherwise
                      .
                    
                  
                
              
            
          
        
      
    
    
      
        (
        9
        )
      
    
  




wherein αi(i=1,2) are two constants, and may, in one example, be determined as 3/64 and 1/32, respectively. The values of αi(i=1,2) may be determined as other suitable values in other embodiments. ΔtαM is the maximal value of all exposure times. Δti,jM and Δti,jm are the maximal and minimal values of two exposure times Δti and Δtj, respectively. υ representing a film speed for capturing the sequence of images, and may also be referred to as an ISO value. ĒV is the average exposure value of all LDR images and is defined as log2(100ω2/(υΔ t)), wherein υ, ω and Δ t are the ISO value, the aperture value and the geometrical mean value of all exposure times, respectively.

According to above embodiment, the component




  (
  
    
      α
      1
    
    +
    
      
        max
        
          1
          ≤
          l
          ≤
          3
        
      
      ⁢
      
        {
        
          
            ɛ
            ⁡
            
              (
              
                
                  
                    Z
                    )
                  
                  
                    k
                    ,
                    l
                  
                
                ⁡
                
                  (
                  p
                  )
                
              
              )
            
          
          ,
          
            ɛ
            ⁡
            
              (
              
                
                  
                    Z
                    )
                  
                  
                    
                      k
                      ′
                    
                    ,
                    l
                  
                
                ⁡
                
                  (
                  p
                  )
                
              
              )
            
          
        
        }
      
    
  
  )




forms the basis of the adaptive threshold in equation (9), while the component





  h
  (
  
    
      
        Δ
        ⁢
        
          
        
        ⁢
        
          t
          a
          M
        
      
      
        Δ
        ⁢
        
          
        
        ⁢
        
          t
          
            k
            ,
            
              k
              ′
            
          
          M
        
      
    
    ,
    
      
        Δ
        ⁢
        
          
        
        ⁢
        
          t
          
            k
            ,
            
              k
              ′
            
          
          M
        
      
      
        Δ
        ⁢
        
          
        
        ⁢
        
          t
          
            k
            ,
            
              k
              
                ′
                ⁢
                
                  
                
              
            
          
          m
        
      
    
    ,
    
      
        E
        _
      
      ⁢
      
        
      
      ⁢
      V
    
    ,
  




v) is provided to refine the adaptive threshold. There are two parts in the definition of ξk,k′(p) in equation (9). The former one,





  
    α
    1
  
  ⁢
  
    h
    (
    
      
        
          Δ
          ⁢
          
            
          
          ⁢
          
            t
            a
            M
          
        
        
          Δ
          ⁢
          
            
          
          ⁢
          
            t
            
              k
              ,
              
                k
                
                  ′
                  ⁢
                  
                    
                  
                
              
            
            m
          
        
      
      ,
      
        
          Δ
          ⁢
          
            
          
          ⁢
          
            t
            
              k
              ,
              
                k
                ′
              
            
            M
          
        
        
          Δ
          ⁢
          
            
          
          ⁢
          
            t
            
              k
              ,
              
                k
                
                  ′
                  ⁢
                  
                    
                  
                
              
            
            m
          
        
      
      ,
    
  




ĒV, v), is to address the variation of image intensity values due to the sensor noise. The latter one,





  
    max
    
      1
      ≤
      l
      ≤
      3
    
  
  ⁢
  
    
      {
      
        
          ɛ
          ⁡
          
            (
            
              
                
                  Z
                  )
                
                
                  k
                  ,
                  l
                
              
              ⁡
              
                (
                p
                )
              
            
            )
          
        
        ,
        
          ɛ
          ⁡
          
            (
            
              
                
                  Z
                  )
                
                
                  
                    k
                    ′
                  
                  ,
                  l
                
              
              ⁡
              
                (
                p
                )
              
            
            )
          
        
      
      }
    
    ⁢
    
      h
      (
      
        
          
            Δ
            ⁢
            
              
            
            ⁢
            
              t
              a
              M
            
          
          
            Δ
            ⁢
            
              
            
            ⁢
            
              t
              
                k
                ,
                
                  k
                  ′
                
              
              m
            
          
        
        ,
        
          
            Δ
            ⁢
            
              
            
            ⁢
            
              t
              
                k
                ,
                
                  k
                  ′
                
              
              M
            
          
          
            Δ
            ⁢
            
              
            
            ⁢
            
              t
              
                k
                ,
                
                  k
                  
                    ′
                    ⁢
                    
                      
                    
                  
                
              
              M
            
          
        
        ,
      
    
  




ĒV, v), is for the variation of image intensity values caused by the electronic noise.

The threshold may be determined for each color component in accordance with the above embodiments. The threshold for each color component may be used to compare with the similarity index determined for the respective color component. The threshold may also be determined at the pixel level in accordance with the above embodiments. The threshold at the pixel level may be used to compare with the similarity index determined for the pixel.
Based on the similarity index determined at 210 and the threshold determined at 220, one or more moving object regions may be determined at 230. The one or more moving object regions include pixels which are determined to be invalid according to various embodiments.
A pixel in the image Zk(k≠k0) may be marked as valid if it is similar to the co-located pixel in the reference image Zk′, i.e. if the similarity index S(Zk(p), Zk′(p)) is larger than the determined threshold. The set of valid pixels in image Zk may be denoted as Ck, which may be determined by using the intra pixel criterion: a pixel Zk(p) is in the set Ck if the similarity between pixels Zk(p) and Zk′(p) is high. Otherwise, it belongs to a set Ck including invalid pixels in image Zk. Ck may be represented by

Ck={p|S(Zk(p), Zk′(p))>Thrk,k′(p)}  (10)

Here, Ck0 is composed of all pixels in image Zk0 and

Z(k0+1)′(p)=Z(k0−1)′(p)=Zk0(p)   (11)

The comparison of the similarity index and the threshold in accordance with equation (10) may be performed at the pixel level or may be performed for each color component. For example, in an embodiment wherein a threshold is determined for each color component Zk,l(p) of the pixel Zk(p), the pixel Zk(p) is determined to be out of the moving object regions if the similarities between all color components of the pixel and those of its co-located pixel in the second image are higher than the respective threshold.
The above detection results may be further used to initialize a weighting matrix ωk, wherein the value of ωk(p) is 1 if Zk(p) is valid and is 0 otherwise. To reduce the effects of noise, the value of ωk(p) may be filtered over a window of 3×3.
The signal-to-noise ratio (SNR) of image Zk may be represented by




  
    
      
        
          
            
              SNR
              k
            
            ⁡
            
              (
              p
              )
            
          
          =
          
            Ψ
            ⁡
            
              (
              
                
                  
                    
                      E
                      2
                    
                    ⁡
                    
                      (
                      p
                      )
                    
                  
                  ⁢
                  Δ
                  ⁢
                  
                    
                  
                  ⁢
                  
                    t
                    k
                    2
                  
                
                
                  
                    
                      E
                      ⁡
                      
                        (
                        p
                        )
                      
                    
                    ⁢
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    
                      t
                      k
                    
                  
                  +
                  
                    
                      σ
                      read
                      2
                    
                    ⁡
                    
                      (
                      p
                      )
                    
                  
                  +
                  
                    κ
                    ⁢
                    
                      
                    
                    ⁢
                    
                      
                        σ
                        ADC
                        2
                      
                      ⁡
                      
                        (
                        p
                        )
                      
                    
                  
                
              
              )
            
          
        
        ,
      
    
    
      
        (
        12
        )
      
    
  




wherein κ is the sensor gain, σread(p) is the noise from sensor readout, σADC(p) is the combined effect of analog-to-digital conversion (ADC) including amplifier noise and quantization, and Ψ( ) is an unknown monotonic increasing function. It can be observed from equation (12) that σread(p) and σADC(p) are dominant for a dark pixel p and E(p)Δtk is dominant for a bright one.

After determining one or more moving object regions in image Zk at 230, the image Zk are updated at 240 to correct the invalid pixels within these regions.
As described above, if k=k0, the image Zk is the initial reference image and does not need to be updated. When k≠k0, the invalid pixel in the image Zk may be updated to be a corresponding intensity value in the image Zk. The corresponding intensity value in the image Zk corresponds to an intensity value of the co-located pixel in the reference image Zk′, and is determined based on an intensity mapping function from the reference image Zk′ to the image Zk.
In an embodiment, the pixels of the image Zk may be updated in accordance with the following equation:




  
    
      
        
          
            
              Z
              k
            
            ⁡
            
              (
              p
              )
            
          
          update
        
        =
        
          {
          
            
              
                
                  
                    
                      
                        Z
                        →
                      
                      k
                    
                    ⁡
                    
                      (
                      p
                      )
                    
                  
                  ;
                
              
              
                
                  
                    if
                    ⁢
                    
                      
                    
                    ⁢
                    p
                  
                  ∈
                  
                    
                      C
                      _
                    
                    k
                  
                
              
            
            
              
                
                  
                    
                      Z
                      k
                    
                    ⁡
                    
                      (
                      p
                      )
                    
                  
                  ;
                
              
              
                otherwise
              
            
          
        
      
    
    
      
        (
        13
        )
      
    
  




From the above equation (13), it is seen that the value of valid pixels are maintained, while the value of invalid pixels are modified.
The value of {right arrow over (Z)}k(p) for filling in the valid regions may be determined based on the inter position criterion: Suppose Zk(p) and Zk(p′) are similar to Zk′(p) and Zk′(p′) respectively, for two pixels p and p′ at two positions. Then,

Zk′,l(p)=Zk′,l(p′)Zk,l(p)=Zk,l(p′)

if there is neither sensor noise nor electronic noise with both pairs of pixels.

For a pixel p ∈ Ck, suppose that there exists another pixel p′ ∈ Ck such that Zk′,l(p′) and Zk′,l(p) are equal. According to the above inter pixel criterion, {right arrow over (Z)}k,l(p) may be updated as Zk,l(p′). In a situation having both sensor noise and electronic noise associated with both pairs of pixels, it is desired to reduce the effects of both types of noises.
According to an embodiment, an IMF based method may be provided to reduce the effect of the sensor noise. It is noted that there may exist a plurality of pixels in the region Ck that satisfy the above condition. The number of such pixels is denoted as ξk,l(p). The updated value {right arrow over (Z)}k(p) may be determined in accordance with the following equation:

{right arrow over (Z)}k(p)=Λk′,k(Zk′(p))   (14)

Accordingly, an updated pixel {right arrow over (Z)}k(p)=[{right arrow over (Z)}k,1(p), {right arrow over (Z)}k,2(p), {right arrow over (Z)}k,3(p)]T is synthesized by using Zk′(p) and Λk′,k(z) in accordance with the equation (14).
The variances of noises can be reduced by factors of 1/√{square root over (ξk,l(p))} (l=1,2,3) in accordance with the embodiments above.
In another embodiment, the effect of electronic noise may be reduced by applying an average filter to {right arrow over (Z)}k(p) using a plurality of neighboring pixels, wherein the plurality of neighboring pixels have been updated in accordance with equations (13) and (14) above. The average filter may be referred to as a spatial average filter, wherein {right arrow over (Z)}k(p) determined according to equation (14) may be further filtered by a weighted filter as




  
    
      
        
          
            
              Z
              →
            
            k
          
          ⁡
          
            (
            p
            )
          
        
        =
        
          
            
              
                
                  Z
                  →
                
                k
              
              ⁡
              
                (
                p
                )
              
            
            2
          
          +
          
            
              ∑
              
                i
                =
                1
              
              4
            
            ⁢
            
              
                
                  Z
                  
                    k
                    ′
                  
                
                ⁡
                
                  (
                  
                    p
                    i
                  
                  )
                
              
              8
            
          
        
      
    
    
      
        (
        15
        )
      
    
  




wherein pi(1≦i≦4) are four neighboring pixels of p in the reference image Zk′ that having been scanned and updated before the pixel p.

In another embodiment, the updated value {right arrow over (Z)}k(p) may be reconstructed using pixels from the next image to be processed and the IMFs from the next image to be processed to the current image being processed, wherein the reference image Zk′ of the current image Zk is used as the reference image to check whether the co-located pixel in the next image to be processed and Zk′(p) are similar. If they are similar, the updated value {right arrow over (Z)}k(p) can be constructed by mapping the co-located pixel from the next image to be processed to the current image Zk, based on an intensity mapping function from the next image to be processed to the current image Zk similar to the embodiments above. This is a bi-directional reconstruction method.
According to the above embodiments, the image Zk is updated at 240 by updating the values of each pixel classified to be invalid pixel, and accordingly the moving object is removed from the updated image Zk update. A sequence of updated LDR images 130 is output from the image updater 240, and is used for synthesis of an HDR image 160 according to FIG. 1.
In the above embodiments of updating the pixels of invalid regions, the spatial correlation among pixels in images Zk and Zk′ is utilized. Different from the existing method wherein all invalid regions are filled in by pixels from a single selected image such that dynamic ranges of moving objects may be reduced, the above embodiments fill in invalid regions using pixel information from all LDR images. Since moving objects belong to invalid regions, the above embodiments may be applied to preserve the dynamic ranges of moving objects better when the inherent ranges of the moving objects are high. In addition, the above embodiments for image updating is fast in the sense that all pixels in image Zk are only scanned once in the raster scan order.
According to the various embodiments described with regard to FIG. 2 above, an intensity based similarity index is provided by using the intensity mapping functions (IMFs) between two differently exposed images being compared. There are possibly large intensity changes between two co-located pixels due to different exposures and variation among pixels in an image caused by sensor and electronic noises. The IMFs between these two images are adopted to unify the intensities of co-located pixels in the two images and to reduce the effect of sensor noise. Meanwhile, a bi-directional mapping method is provided to reduce the effect of electronic noise. As a result, the similarity index determined in accordance with the embodiments is robust with respect to different exposures between the two images and the sensor and electronics noises in the two images.
The similarity index is applied to detect moving objects in a set of differently exposed LDR images. A pixel in an image is valid if the similarity between its reference pixel and itself is larger than a threshold, and is invalid otherwise. The threshold is adaptive to at least one of the intensity values of two pixels, the exposure times of two images, the ISO value for capturing the images and the average exposure value of all LDR images. This adaptive threshold of various embodiments is able to improve the robustness of the moving object detection scheme with respect to the sense and electronics noises. Since the correlation between two successive images is usually the strongest, after checking all pixels in the current image, the current image is updated and used as the reference image for the subsequent image. All valid pixels are adopted to update the current image.
An IMF based approach, together with a spatial average filter, is provided to synthesize pixels for the patching of invalid regions. The movement detection of the embodiments is robust with respect to different exposures of input images as well as the sensor and electronic noises in the input images. Moreover, a method is also provided to fill in invalid regions by using the spatial correlation among pixels in the current and reference images. All input images can be used to patch the invalid regions, instead of using only one input image as in existing methods. Therefore, the dynamic range of the final HDR image may be preserved better according to various embodiments.
The image processing method described in various embodiments above may be carried out by an image processing device.
FIG. 4 shows a schematic diagram of an image processing device according to various embodiments.
The image processing device 400 may be implemented by a computer system. In various embodiments, the decider, the similarity determiner, the threshold determiner, the moving object region determiner, the corresponding intensity value determiner and the updater may also be implemented as modules executing on one or more computer systems. The computer system may include a CPU 401 (central processing unit), a processor 403, a memory 405, a network interface 407, input interface/devices 409 and output interface/devices 411. All the components 401, 403, 405, 407, 409, 411 of the computer system 400 are connected and communicating with each other through a computer bus 413.
The memory 405 may be used as for storing images, similarity indexes, thresholds, pixels belonging to moving object regions, and updated images used and determined according to the method of the embodiments. The memory 405 may include more than one memory, such as RAM, ROM, EPROM, hard disk, etc. wherein some of the memories are used for storing data and programs and other memories are used as working memories.
In an embodiment, the memory 405 may be configured to store instructions for processing an image according to various embodiments above. The instructions, when executed by the CPU 401, may cause the CPU 401 to determine a similarity index, determine a threshold, determine a moving object region, determine a corresponding intensity value, and determine an updated intensity value. The instruction may also cause the CPU 401 to store similarity indexes, thresholds, pixels belonging to moving object regions, and updated images determined according to the method of the embodiments in the memory 405.
In another embodiment, the processor 403 may be a special purpose processor, in this example, a image processor, for executing the instructions described above.
The CPU 401 or the processor 403 may be used as the image processing device as described in various embodiments below, and may be connected to an internal network (e.g. a local area network (LAN) or a wide area network (WAN) within an organization) and/or an external network (e.g. the Internet) through the network interface 407.
The Input 409 may include a keyboard, a mouse, etc. The output 411 may include a display for display the images processed in the embodiments below.
The embodiments above may be combined with the method in “P. Debevec and J. Malik, Recovering high dynamic range radiance maps from photograph, In Proceedings SIGGRAPH 1997, pp. 369-378, 1997” for the synthesis of HDR images. The updated LDR images may be provided as the inputs of the method in “P. Debevec and J. Malik”, to produce an HDR image without any ghosting artifact.
In the following, the updated reference images are represented by {circumflex over (Z)}k(1≦k≦n0), and are used as the inputs of the method in“P. Debevec and J. Malik”. The value of E(p) is computed by




  
    
      
        
          log
          ⁡
          
            (
            
              E
              ⁡
              
                (
                p
                )
              
            
            )
          
        
        =
        
          
            
              
                ∑
                k
              
              ⁢
              
                
                  w
                  ⁡
                  
                    (
                    
                      
                        
                          Z
                          ^
                        
                        k
                      
                      ⁡
                      
                        (
                        p
                        )
                      
                    
                    )
                  
                
                ⁢
                
                  (
                  
                    
                      log
                      ⁡
                      
                        (
                        
                          
                            f
                            
                              -
                              1
                            
                          
                          ⁡
                          
                            (
                            
                              
                                
                                  Z
                                  ^
                                
                                k
                              
                              ⁡
                              
                                (
                                p
                                )
                              
                            
                            )
                          
                        
                        )
                      
                    
                    -
                    
                      log
                      ⁡
                      
                        (
                        
                          Δ
                          ⁢
                          
                            
                          
                          ⁢
                          
                            t
                            
                              
                                k
                                ′
                              
                              )
                            
                          
                        
                        )
                      
                    
                  
                  )
                
              
            
            
              
                ∑
                k
              
              ⁢
              
                w
                ⁡
                
                  (
                  
                    
                      
                        Z
                        ^
                      
                      k
                    
                    ⁡
                    
                      (
                      p
                      )
                    
                  
                  )
                
              
            
          
          .
        
      
    
    
      
        (
        16
        )
      
    
  




Sufficient condition and necessary condition on the acceptable quality of the final HDR image may be derived by using all sets Ck's as follows:
Proposition 1: The final synthesized HDR image is acceptable at pixel p if there exists a pixel Zk(p) in the set Ck such that the following two Wyckoff signal/noise criteria (17) and (18) are satisfied for all color channel l.

ƒl−1(Zk,l(p))>>ηq,k,l(p),   (17)

ω(Zk,l(p))>>ω(ηƒ,k,l(p)).   (18)

Proof: From equation (16), the value of El(p) may be computed by




  
    log
    ⁡
    
      (
      
        
          E
          l
        
        ⁡
        
          (
          p
          )
        
      
      )
    
  
  =
  
    
      
        
          ∑
          
            k
            ,
            
              p
              ∈
              
                C
                
                  k
                  ′
                
              
            
          
        
        ⁢
        
          
            w
            ⁡
            
              (
              
                
                  Z
                  
                    
                      k
                      ′
                    
                    ,
                    l
                  
                
                ⁡
                
                  (
                  p
                  )
                
              
              )
            
          
          ⁢
          
            (
            
              
                log
                ⁡
                
                  (
                  
                    
                      f
                      l
                      
                        -
                        1
                      
                    
                    ⁡
                    
                      (
                      
                        
                          Z
                          
                            
                              k
                              ′
                            
                            ,
                            l
                          
                        
                        ⁡
                        
                          (
                          p
                          )
                        
                      
                      )
                    
                  
                  )
                
              
              -
              
                log
                ⁡
                
                  (
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    
                      t
                      
                        k
                        ′
                      
                    
                  
                  )
                
              
            
            )
          
        
      
      
        
          
            ∑
            
              
                k
                ′
              
              ,
              
                p
                ∈
                
                  C
                  
                    k
                    ′
                  
                
              
            
          
          ⁢
          
            w
            ⁡
            
              (
              
                
                  Z
                  
                    
                      k
                      ′
                    
                    ,
                    l
                  
                
                ⁡
                
                  (
                  p
                  )
                
              
              )
            
          
        
        +
        
          
            ∑
            
              k
              ,
              
                p
                ∈
                
                  C
                  
                    τ
                    ⁡
                    
                      (
                      k
                      )
                    
                  
                
              
            
          
          ⁢
          
            w
            ⁡
            
              (
              
                
                  
                    Z
                    →
                  
                  
                    
                      k
                      ′
                    
                    ,
                    l
                  
                
                ⁡
                
                  (
                  p
                  )
                
              
              )
            
          
        
      
    
    +
    
      
        
          
            ∑
            
              k
              ,
              
                p
                ∈
                
                  
                    C
                    _
                  
                  
                    k
                    ′
                  
                
              
            
          
          ⁢
          
            
              w
              ⁡
              
                (
                
                  
                    
                      Z
                      →
                    
                    
                      
                        k
                        ′
                      
                      ,
                      l
                    
                  
                  ⁡
                  
                    (
                    p
                    )
                  
                
                )
              
            
            ⁢
            
              (
              
                
                  log
                  ⁡
                  
                    (
                    
                      
                        f
                        l
                        
                          -
                          1
                        
                      
                      ⁡
                      
                        (
                        
                          
                            
                              Z
                              →
                            
                            
                              
                                k
                                ′
                              
                              ,
                              l
                            
                          
                          ⁡
                          
                            (
                            p
                            )
                          
                        
                        )
                      
                    
                    )
                  
                
                -
                
                  log
                  ⁡
                  
                    (
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      
                        t
                        
                          k
                          ′
                        
                      
                    
                    )
                  
                
              
              )
            
          
        
        
          
            
              ∑
              
                k
                ,
                
                  p
                  ∈
                  
                    C
                    
                      k
                      ′
                    
                  
                
              
            
            ⁢
            
              w
              ⁡
              
                (
                
                  
                    Z
                    
                      
                        k
                        ′
                      
                      ,
                      l
                    
                  
                  ⁡
                  
                    (
                    p
                    )
                  
                
                )
              
            
          
          +
          
            
              ∑
              
                k
                ,
                
                  p
                  ∈
                  
                    C
                    
                      k
                      ′
                    
                  
                
              
            
            ⁢
            
              w
              ⁡
              
                (
                
                  
                    
                      Z
                      →
                    
                    
                      
                        k
                        ′
                      
                      ,
                      l
                    
                  
                  ⁡
                  
                    (
                    p
                    )
                  
                
                )
              
            
          
        
      
      .
    
  




It is shown from the inequalities (17) and (18) and the above equation that the final synthesized HDR image is acceptable at pixel p.
Proposition 2: The final synthesized HDR image is not acceptable at pixel p if all Zk(p)'s (k≠k0) are invalid and there exists a color channel l such that Zk0,l(p) does not satisfy the inequalities (17) and (18).
Proof: Similar to the proof of Proposition 1, it is determined that




  
    log
    ⁡
    
      (
      
        
          E
          l
        
        ⁡
        
          (
          p
          )
        
      
      )
    
  
  =
  
    
      
        
          w
          ⁡
          
            (
            
              
                Z
                
                  
                    k
                    0
                  
                  ,
                  l
                
              
              ⁡
              
                (
                p
                )
              
            
            )
          
        
        ⁢
        
          (
          
            
              log
              ⁡
              
                (
                
                  
                    f
                    l
                    
                      -
                      1
                    
                  
                  ⁡
                  
                    (
                    
                      
                        Z
                        
                          
                            k
                            0
                          
                          ,
                          l
                        
                      
                      ⁡
                      
                        (
                        p
                        )
                      
                    
                    )
                  
                
                )
              
            
            -
            
              log
              ⁡
              
                (
                
                  Δ
                  ⁢
                  
                    
                  
                  ⁢
                  
                    t
                    
                      k
                      0
                    
                  
                
                )
              
            
          
          )
        
      
      
        
          w
          ⁡
          
            (
            
              
                Z
                
                  
                    k
                    0
                  
                  ,
                  l
                
              
              ⁡
              
                (
                p
                )
              
            
            )
          
        
        +
        
          
            ∑
            
              k
              ≠
              
                k
                0
              
            
          
          ⁢
          
            w
            ⁡
            
              (
              
                
                  
                    Z
                    →
                  
                  k
                
                ⁡
                
                  (
                  p
                  )
                
              
              )
            
          
        
      
    
    +
    
      
        
          
            ∑
            
              k
              ≠
              
                k
                0
              
            
          
          ⁢
          
            
              w
              ⁡
              
                (
                
                  
                    
                      Z
                      →
                    
                    k
                  
                  ⁡
                  
                    (
                    p
                    )
                  
                
                )
              
            
            ⁢
            
              (
              
                
                  log
                  ⁡
                  
                    (
                    
                      
                        f
                        l
                        
                          -
                          1
                        
                      
                      ⁡
                      
                        (
                        
                          
                            
                              Z
                              →
                            
                            k
                          
                          ⁡
                          
                            (
                            p
                            )
                          
                        
                        )
                      
                    
                    )
                  
                
                -
                
                  log
                  ⁡
                  
                    (
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      
                        t
                        k
                      
                    
                    )
                  
                
              
              )
            
          
        
        
          
            w
            ⁡
            
              (
              
                
                  Z
                  
                    
                      k
                      0
                    
                    ,
                    l
                  
                
                ⁡
                
                  (
                  p
                  )
                
              
              )
            
          
          +
          
            
              ∑
              
                k
                ≠
                
                  k
                  0
                
              
            
            ⁢
            
              w
              ⁡
              
                (
                
                  
                    
                      Z
                      →
                    
                    k
                  
                  ⁡
                  
                    (
                    p
                    )
                  
                
                )
              
            
          
        
      
      .
    
  




Since Zk0,l(p) does not satisfy the inequalities (17) and (18), the values of all {right arrow over (Z)}k(p) (k≠k0) are not reliable. Therefore, the final synthesized HDR image is not acceptable at pixel p.
According to the above embodiments, the moving object detection is independent of CRFs (camera response functions), and is thus robust with respect to the estimation error of CRFs. As shown in FIG. 1, The CRFs are estimated at 140 after the moving object is detected and removed from the LDR images 110. Accordingly, pixels with high similarity among the differently exposed LDR images are used to estimate the CRFs. Therefore, the estimated CRFs at 140 is more accurate.
In other embodiments, the various embodiments may be used to generate an HDR video. All images between two shot boundaries may be put together to form a group, and each image in the group may be selected as the initial reference image to generate the corresponding HDR image. Subsequently, an HDR video sequence is generated.
Experimental results are described in the following section. The image processing method according to various embodiments above is verified by using it to synthesize HDR images. The synthesized HDR images usually cannot be displayed directly by existing digital displaying system. To this end, tone mapping schemes were designed for the visualization of HDR images.
First, the method for similarity determination based on bi-directional mapping method is compared with the similarity determination based on the conventional uni-directional method. The testing sequence is composed of five images with movement in head and body of a girl as shown in FIG. 5, and the experimental results are shown in FIG. 6. FIG. 6(a) shows a HDR image synthesized using the bi-directional mapping method of the various embodiments, and FIG. 6(b) shows a HDR image synthesized using the uni-directional method. It can be seen from FIG. 6 that the bi-directional method can be used to improve the quality of bright parts in the synthesized HDR image.
The efficiency of the adaptive threshold according to various embodiments is evaluated by comparing with the situation in which the threshold is fixed as 1⁄4. The testing sequence consists of seven images with movement in head and body of a man as illustrated in FIG. 7, and the experimental results are shown in FIG. 8. FIG. 8(a) shows the resulting image using the adaptive threshold of the embodiments, and FIG. 8(b) shows the resulting image using the fixed threshold of 1⁄4. From FIG. 8, it is illustrated that using the adaptive threshold of the embodiments can remove ghosting artifacts in the area corresponding to the neck of the man, whereas using the fixed threshold cannot remove the ghosting artifacts in this area.
Proposition 2 above may be verified by testing the LDR image sequence in FIG. 5. An example of the verification is shown in FIG. 9. The basis image is selected as the first one. It is shown in FIG. 9 that the area in a box 901 in the synthesized HDR image is not acceptable.
The various embodiments described with regard to FIGS. 1 and 2 may also be applied to produce a HDR video. All images between two shot boundaries are put together to form a group. Each image in the group is selected as the initial reference image to generate the corresponding HDR image. Subsequently, an HDR video sequence is generated. Four of the HDR images synthesized based on the testing sequence of FIG. 7 are shown in FIG. 10.
The method of various embodiments is also compared with existing methods. The method of the embodiments is firstly compared with the schemes in “T. Grosch, Fast and robust high dynamic range image generation with camera and object movement, In Vision, Modeling and Visualization, pp. 277-284, 2006” and “K. Jacobs, C. Loscos, and G. Ward, Automatic high dynamic range image generation for dynamic scenes”, IEEE Computer Graphics and Applications, Vol. 128, No. 2, pp. 84-93, 2008”, by considering a numerical example with three input LDR images {Z1, Z2, Z3}. Z2 is selected as the initial reference image in the proposed scheme. Suppose that there are two clusters of pixels {Z1(p1), Z2(p1), Z3(p1)} {Z1(p2), Z2(p2), Z3(p2)} that are affected by movement in “T. Grosch” and “K. Jacobs”. The values of E2(p1) and E3(p1) are the same while the values of E1(p1) and E2(p1) are different. The value of E1(p2) and E2(p2) are the same while the values of E2(p2) and E3(p2) are different. With the method of the embodiments, Z2(p1) and Z3(p1) are marked as valid and Z1(p1) is marked as invalid. A new pixel, {right arrow over (Z)}1(p1), is reconstructed by using the correlation between images Z1 and Z2 and used to replace Z1(p1). Similarly, Z2(p2) and Z1(p2) are marked as valid and Z3(p2) is marked as invalid. A new pixel, {right arrow over (Z)}3(p2), is reconstructed to replace Z3(p2). By using the methods in “T. Grosch” and “K. Jacobs”, both clusters of pixels are marked as moving clusters and all pixels in a cluster are replaced by one of pixels in the cluster. It is seen that the dynamic range of the final HDR image is preserved better by using the method of the embodiments, compared with the schemes in “T. Grosch” and “K. Jacobs”.
The method of various embodiments is also compared with three commercial software FDRTools (htto://fdrtools.com/front_e.php), Photomatix (http://www.hdrsoft.com/) and Qtpfsgui (http://qtpfsgui.sourceforge.net/). The testing sequence is composed of 11 images with waiving leafs as demonstrated in FIG. 11. FIG. 12(a), (b), (c), (d) show the results of FDRTools, Photomatix, Qtpfsgui and the method of the embodiments, respectively. It is shown in the results in FIG. 12 that 1) ghosting artifacts, due to waving leafs, are not removed by using these commercial softwares, especially by Qtpfsgui; 2) the ghosting artifacts are removed via the method of the embodiments.
The method of the embodiments and Photomatix are further compared by testing the image sequence in FIG. 7. FIG. 13(a) shows the HDR image generated using Photomatix, and FIG. 13(b) shows the HDR image generated using the method of the embodiments. It is shown in FIG. 13 that the quality of the human subject is poor and his black cloth is not smooth by using the Photomatix, while the quality of the human subject is high by using the method of the embodiments.
According to the method of various embodiments, ghosting artifacts are removed from the final HDR image even though there are moving objects in a scene.
The movement detection according to various embodiments may be speed up via a sub-sampling method. In other words, instead of detecting moving objects in the original input images, the input images are first sampled by half at both horizontal and vertical directions. Moving objects are then detected on the sub-sampled images. Additional detection is conducted on the original input images if necessary. The movement detection of various embodiments may be used in various applications. For example, the movement detection of various embodiments, together with image inpainting, can be used to produce HDR videos without any reduction of frame rate.
While the invention has been particularly shown and described with reference to specific embodiments, it should be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. The scope of the invention is thus indicated by the appended claims and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced.

## Claims

1. A method for processing a first image based on a second image, each pixel in the first image having a plurality of color components and having a corresponding pixel in the second image, wherein each value of a color component in the first image corresponds to a value of a color component in the second image, the method comprising:
deciding, for each color component of a pixel in the first image, whether to modify the value of the color component dependent on a predetermined criterion; and
determining a similarity index between the pixel in the first image and the corresponding pixel in the second image based on, for each color component of the pixel, the value of the color component of the pixel, or if it is decided that the value of the color component of the pixel is to be modified, the corresponding value of the color component in the second image,
wherein deciding whether to modify the value of the color component is dependent on a comparison of an exposure level of the color component of the pixel in the first image with an exposure level of the color component of the corresponding pixel in the second image, and
wherein the exposure level of the color component of the pixel in the first image represents a deviation of the value of the color component of the pixel from a predetermined value, and the exposure level of the color component of the corresponding pixel in the second image represents a deviation of the value of the color component of the corresponding pixel from the predetermined value, wherein the predetermined value is a middle value of a value range of the first image and the second image.

2. The method of claim 1, wherein each pixel in the first image and its corresponding pixel in the second image are co-located.

3. The method of claim 1, wherein the plurality of color components comprises a red color component, a green color component, and a blue color component.

4. The method of claim 1, further comprising
deciding, for each color component of the corresponding pixel in the second image, whether to modify the value of the color component of the corresponding pixel dependent on a predetermined criterion, wherein each value of a color component in the second image corresponds to a value of a color component in the first image; and
determining the similarity index between the pixel in the first image and the corresponding pixel in the second image based on, for each color component of the corresponding pixel, the value of the color component of the corresponding pixel, or if it is decided that the value of the color component of the corresponding pixel is to be modified, the corresponding value of the color component in the first image.

5. The method of claim 1, wherein the corresponding value of a color component in the second image is determined to correspond to the value of a color component in the first image based on an intensity mapping function from the first image to the second image, wherein the intensity mapping function is determined based on accumulated histograms of the first image and the second image.

6. The method of claim 1, further comprising
determining the pixel of the first image to be within or out of a moving object region dependent on the determined similarity index.

7. A method for processing a first image based on a second image, the first image and the second image being part of a sequence of images captured with different exposure time, the method comprising:
determining a similarity index between a pixel of the first image and a corresponding pixel of the second image, the similarity index representing a degree of similarity between the pixel and the corresponding pixel;
determining a threshold for the pixel dependent on at least one of exposure time of the first image, exposure time of the second image, a film speed for capturing the sequence of images, and an average exposure value of the sequence of images; and
determining the pixel to be within or out of a moving object region dependent on a comparison of the determined similarity index with the determined threshold,
wherein said determining a threshold for the pixel further comprises determining the threshold for the pixel dependent on an intensity value of the pixel in the first image and an intensity value of the corresponding pixel in the second image.

8. The method of claim 7, wherein said determining the threshold for the pixel dependent on an intensity value of the pixel in the first image and an intensity value of the corresponding pixel in the second image comprises determining the threshold for the pixel dependent on an exposure level of the pixel in the first image and an exposure level of the corresponding pixel in the second image.

9. The method of claim 8, wherein the exposure level of the pixel in the first image represents a deviation of the intensity value of the pixel from a predetermined value, and the exposure level of the corresponding pixel in the second image represents a deviation of the intensity value of the corresponding pixel from the predetermined value, wherein the predetermined value is a middle value of an intensity value range of the first image and the second image.

10. The method of claim 7, wherein determining the similarity index between the pixel of the first image and the corresponding pixel of the second image comprises:
deciding, for each color component of the pixel in the first image, whether to modify the value of the color component dependent on a predetermined criterion, wherein each value of a color component in the first image corresponds to a value of a color component in the second image; and
determining the similarity index between the pixel in the first image and the corresponding pixel in the second image based on, for each color component of the pixel, the value of the color component of the pixel, or if it is decided that the value of the color component of the pixel is to be modified, the corresponding value of the color component in the second image.

11. A method for processing a first image based on a second image, the first image and the second image being part of a sequence of images captured with different exposure time, the method comprising:
determining a similarity index between a pixel of the first image and a corresponding pixel of the second image, the similarity index representing a degree of similarity between the pixel and the corresponding pixel;
determining a threshold for the pixel;
determining the pixel to be within or out of a moving object region dependent on a comparison of the determined similarity index with the determined threshold;
if the pixel is determined to be within the moving object region, determining a corresponding intensity value in the first image corresponding to an intensity value of the corresponding pixel in the second image or in a third image of the sequence of images based on an intensity mapping function from the second image or the third image to the first image, wherein the intensity mapping function is determined based on accumulated histograms of the first image and the second or the third image;
if the pixel is determined to be within the moving object region, determining whether the corresponding pixel of the second image and the corresponding pixel of the third image is similar;
if the corresponding pixel of the second image is not similar to the corresponding pixel of the third image, determining the corresponding intensity value in the first image based on an intensity mapping function from the second image to the first image;
if the corresponding pixel of the second image is similar to the corresponding pixel of the third image, determining the corresponding intensity value in the first image based on an intensity mapping function from the third image to the first image; and
determining an updated intensity value of the pixel in the first image to be the determined corresponding intensity value in the first image.

12. The method of claim 11, wherein the corresponding intensity value in the first image and the updated intensity value of the pixel in the first image are determined for each color component of a plurality of color components of the pixel separately.

13. The method of claim 11, wherein the intensity mapping functions comprise minimizing a difference between the accumulated histogram of the first image and the accumulated histogram of the second image or the third image, wherein the accumulated histogram of the first image represents a number of pixels in the first image having an intensity value equal to or less than the corresponding intensity value in the first image to be determined, the accumulated histogram of the second image represents a number of pixels in the second image having an intensity value equal to or less than the intensity value of the corresponding pixel in the second image, and the accumulated histogram of the third image represents a number of pixels in the third image having an intensity value equal to or less than the intensity value of the corresponding pixel in the third image.

14. The method of claim 11, further comprising
applying an average filter to the determined corresponding intensity value using a plurality of neighboring pixels, wherein intensity values of the plurality of neighboring pixels have been processed according to claim 11.

15. The method of claim 11, wherein if the pixel is determined to be out of the moving object region, the updated intensity value of the pixel is determined to be the intensity value of the pixel.