Image Demosaicking with Contour Stencils
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions
mstencils.c File Reference

Mosaiced contour stencils. More...

#include <math.h>
Include dependency graph for mstencils.c:

Go to the source code of this file.

Macros

#define TVEDGE(x1, y1, x2, y2)
 Compute the absolute difference between (x1,y1) and (x2,y2) More...
 
#define NUMSTENCILS   8
 Number of contour stencils. More...
 
#define NEIGHRADIUS   2
 Radius of the stencil neighborhood. More...
 
#define WEIGHT_AXIAL   4.545454545454546e-02
 
#define WEIGHT_PI_8   1.181325147609750e-02
 
#define WEIGHT_GREEN_MU   1.111167799007432e+00
 
#define WEIGHT_GREEN_DIAGONAL   5.050762722761053e-02
 
#define WEIGHT_REDBLUE_MU   1.111167799007432e+00
 
#define WEIGHT_REDBLUE_DIAGONAL   5.050762722761053e-02
 

Functions

void FitMosaicedStencils (int *Stencil, const float *Input, int Width, int Height, int RedX, int RedY)
 Estimate the contour orientations of a mosaiced image. More...
 

Detailed Description

Mosaiced contour stencils.

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

Definition in file mstencils.c.

Macro Definition Documentation

#define NEIGHRADIUS   2

Radius of the stencil neighborhood.

Definition at line 20 of file mstencils.c.

#define NUMSTENCILS   8

Number of contour stencils.

Definition at line 17 of file mstencils.c.

#define TVEDGE (   x1,
  y1,
  x2,
  y2 
)
Value:
fabs(Input[HorizontalOffset[x1] + VerticalOffset[y1]] \
- Input[HorizontalOffset[x2] + VerticalOffset[y2]])

Compute the absolute difference between (x1,y1) and (x2,y2)

Definition at line 12 of file mstencils.c.

#define WEIGHT_AXIAL   4.545454545454546e-02

Definition at line 23 of file mstencils.c.

#define WEIGHT_GREEN_DIAGONAL   5.050762722761053e-02

Definition at line 26 of file mstencils.c.

#define WEIGHT_GREEN_MU   1.111167799007432e+00

Definition at line 25 of file mstencils.c.

#define WEIGHT_PI_8   1.181325147609750e-02

Definition at line 24 of file mstencils.c.

#define WEIGHT_REDBLUE_DIAGONAL   5.050762722761053e-02

Definition at line 28 of file mstencils.c.

#define WEIGHT_REDBLUE_MU   1.111167799007432e+00

Definition at line 27 of file mstencils.c.

Function Documentation

void FitMosaicedStencils ( int *  Stencil,
const float *  Input,
int  Width,
int  Height,
int  RedX,
int  RedY 
)

Estimate the contour orientations of a mosaiced image.

Parameters
Stencilarray to store the selected stencils
Inputthe mosaiced image
Width,Heightdimensions of the image
RedX,RedYthe coordinates of the upper-leftmost red pixel

Mosaiced contour stencils are applied to estimate the contour orientation at each pixel. The output array Stencil holds the index of the selected stencil at each point. The orientation estimate at the ith pixel is Stencil[i]*M_PI/8 radians:

       5  4  3
     6,   |   ,2
    7  `, | ,`  1
    0-----+-----0
Orientations described
    by Stencil[i]

The same enumeration of orientations is used internally for the TV array.

Definition at line 51 of file mstencils.c.

Here is the caller graph for this function: