Image Demosaicking with Contour Stencils
|
Mosaiced contour stencils. More...
Go to the source code of this file.
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... | |
int | DisplayContours (const float *Image, int Width, int Height, int RedX, int RedY, const char *OutputFile) |
Display orientations estimated by mosaiced contour stencils. More... | |
Mosaiced contour stencils.
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 mstencils.h.
int DisplayContours | ( | const float * | Image, |
int | Width, | ||
int | Height, | ||
int | RedX, | ||
int | RedY, | ||
const char * | OutputFile | ||
) |
Display orientations estimated by mosaiced contour stencils.
Image | the input RGB image in planar row-major order |
Width,Height | the image dimensions |
RedX,RedY | the coordinates of the upper-leftmost red pixel |
OutputFile | EPS file to write |
This routine writes an EPS file of Image superimposed with the orientations detected by mosaiced contour stencils at each pixel. This function is called when running the command line program with the -s option.
For visualization purposes, it is recommended to pass an image that has full color information rather than a mosaiced image (i.e., use the original image or a demosaiced image). The estimated contour orientations are the same regardless of whether the input is mosaiced.
Using the Ghostscript program, the EPS output (say, "contours.eps") can be converted to PDF as
Distiller commands are included within the EPS to preserve the bounding box. PDF conversion applies (lossless) deflate compression to the image data, which significantly decreases the file size.
Definition at line 59 of file displaycontours.c.
void FitMosaicedStencils | ( | int * | Stencil, |
const float * | Input, | ||
int | Width, | ||
int | Height, | ||
int | RedX, | ||
int | RedY | ||
) |
Estimate the contour orientations of a mosaiced image.
Stencil | array to store the selected stencils |
Input | the mosaiced image |
Width,Height | dimensions of the image |
RedX,RedY | the 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.