Zhang-Wu Directional LMMSE Image Demosaicking
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
dmzhangwu.c File Reference

Zhang-Wu LMMSE Image Demosaicking. More...

#include "basic.h"
#include "conv.h"
#include "dmzhangwu.h"
Include dependency graph for dmzhangwu.c:

Go to the source code of this file.

Functions

float DiagonalAverage (const float *Image, int Width, int Height, int x, int y)
 Compute the average value of four diagonal neighbors. More...
 
float AxialAverage (const float *Image, int Width, int Height, int x, int y)
 Compute the average value of four axial neighbors. More...
 
int ZhangWuDemosaic (float *Output, const float *Input, int Width, int Height, int RedX, int RedY, int UseZhangCodeEst)
 Demosaicing using the LMMSE method of Zhang et al. More...
 

Detailed Description

Zhang-Wu LMMSE Image Demosaicking.

Author
Pascal Getreuer getre.nosp@m.uer@.nosp@m.gmail.nosp@m..com

This file implements Zhang-Wu image demosaicking, introduced in

Lei Zhang and Xiaolin Wu, "Color demosaicking via directional linear minimum mean square-error estimation," IEEE Transactions on Image Processing, vol. 14, no. 12, pp. 2167-2178, 2005.

A MATLAB implementation of the method is available at

http://www4.comp.polyu.edu.hk/~cslzhang/code/dlmmse.m

Copyright (c) 2010-2011, Pascal Getreuer All rights reserved.

This program is free software: you can use, modify and/or redistribute it under the terms of the simplified BSD License. You should have received a copy of this license along this program. If not, see http://www.opensource.org/licenses/bsd-license.html.

Definition in file dmzhangwu.c.

Function Documentation

float AxialAverage ( const float *  Image,
int  Width,
int  Height,
int  x,
int  y 
)

Compute the average value of four axial neighbors.

Parameters
Imagean image in row major order
Width,Heightdimensions of Image
x,ylocation in the image

Computes the average of the four axial neighbors of (x,y). For (x,y) near the boundary, whole-sample symmetry is applied.

Definition at line 318 of file dmzhangwu.c.

Here is the caller graph for this function:

float DiagonalAverage ( const float *  Image,
int  Width,
int  Height,
int  x,
int  y 
)

Compute the average value of four diagonal neighbors.

Parameters
Imagean image in row major order
Width,Heightdimensions of Image
x,ylocation in the image

Computes the average of the diagonal axial neighbors of (x,y). For (x,y) near the boundary, whole-sample symmetry is applied.

Definition at line 273 of file dmzhangwu.c.

Here is the caller graph for this function:

int ZhangWuDemosaic ( float *  Output,
const float *  Input,
int  Width,
int  Height,
int  RedX,
int  RedY,
int  UseZhangCodeEst 
)

Demosaicing using the LMMSE method of Zhang et al.

Parameters
Outputpointer to memory to store the demosaiced image
Inputthe input image as a flattened 2D array
Width,Heightthe image dimensions
RedX,RedYthe coordinates of the upper-rightmost red pixel
UseZhangCodeEstflag to determine how to estimate local signal mean

The Input image is a 2D float array of the input RGB values of size Width*Height in row-major order. RedX, RedY are the coordinates of the upper-rightmost red pixel to specify the CFA pattern.

If UseZhangCodeEst is zero, then LMMSE is performed as described in Zhang and Wu's paper. If it is nonzero, then LMMSE is performed consistently with Zhang's reference MATLAB implementation

http://www4.comp.polyu.edu.hk/~cslzhang/code/dlmmse.m

The difference is in the estimation of the local signal mean.

In the paper, the denoising estimates the signal mean as the value of the smoothed signal averaged over a window. In the MATLAB code, the smoothed signal is used directly as the estimate of the signal mean.

Definition at line 60 of file dmzhangwu.c.

Here is the call graph for this function:

Here is the caller graph for this function: