Zhang-Wu Directional LMMSE Image Demosaicking
|
Zhang-Wu LMMSE Image Demosaicking. More...
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... | |
Zhang-Wu LMMSE Image Demosaicking.
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.
float AxialAverage | ( | const float * | Image, |
int | Width, | ||
int | Height, | ||
int | x, | ||
int | y | ||
) |
Compute the average value of four axial neighbors.
Image | an image in row major order |
Width,Height | dimensions of Image |
x,y | location 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.
float DiagonalAverage | ( | const float * | Image, |
int | Width, | ||
int | Height, | ||
int | x, | ||
int | y | ||
) |
Compute the average value of four diagonal neighbors.
Image | an image in row major order |
Width,Height | dimensions of Image |
x,y | location 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.
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.
Output | pointer to memory to store the demosaiced image |
Input | the input image as a flattened 2D array |
Width,Height | the image dimensions |
RedX,RedY | the coordinates of the upper-rightmost red pixel |
UseZhangCodeEst | flag 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.