Digital Photography with Flash and No-Flash Image Pairs                        

               
                A report by Gabriela Martínez December 2005.


This project is based on the paper "Digital Photography with Flash and No-Flash Image Pairs" . Petschnigg et al.ACM. 2004


  RED EYES DETECTION MASK

                                                   

Red eye is a common problem in flash photography and is due to light reflection by a well vascularized retina. The classical approach to solve this problem is assume a single image as input. Once the pupil mask has been detected the techniques darken the pixels within the mask to make the image appear more natural.

     ALGORITHM


They have developed a red eye removal algorithm that considers the change in pupil color between the ambient image (where it is usually very dark) and the flash image (where it may be red). They convert the image pair into YCbCr space to decorrelate luminance from chrominance and compute a relative redness measure as follows:
  1. Calculate:  R=FCr-ACr , where F is the flash image and A is the ambient image.
  2. Segmentation starts with: R > teye . They set teye to 0.05 so that the resulting segmentation defines regions where flash image is redder than ambient image.
  3. Look for seed pixels: R > max[0.6 mR + 3sigmaR] and Al < tdark
     IMPLEMENTATION

Using Matlab:
  1. Convert the space color image using rgb2ycbcr command<>
  2. Create detection mask (step 1): mask = flash_ycbcr(:,:,3) - noflash_ycbcr(:,:,3); mask = mask - min(mask(:)); mask = mask / max(max(mask));
  3. Find seed pixels and mark them (step 2,3): TLower = max([ 0.4 mean(mask(:)) + var(mask(:)) ^ 0.5]); low = mask > TLower; TUpper = min([0.8 mean(mask(:)) + 6 * var(mask(:)) ^ 0.5]); high = mask > TUpper; [r, c] = find(high); low = bwlabel(low, 8); final_c = bwselect(low,c,r,8);
  4. Red eyes mask result:
                                                                       

     RESULTS

                
                  




    DENOISING AND DETAIL TRANSFER

Reducing noise in photographic images has been a long standing problem in image processing and computer vision. One common solution is to apply an edge-preserving smoothing filter to the image such as bilateral filter (Tomasi and Manduchi 1998).
The image denoising technique presented by the authors consist in builds on the bilateral filter. Let's summarize Tomasi and Manduchi's basic bilateral filter and then show the generalization done.
     ALGORITHM
  1. Bilateral filter, compute: A_base, F_base.
  2. Joint Bilateral filter, compute: A_nr.
  3. Compute F_detail=(F+0.02)/(F_base+0.02).
  4. Transfer detail to A_nr: A_nr*F_detail.
  5. Create shadows mask M : diff(F,A) < tshadows
  6. Result: (1-M)A_nrF_detail+MA_base
     RESULTS


 

     REFERENCES