Image Interpolation with Contour Stencils
Functions

fitsten.h File Reference

Select the best-fitting contour stencils. More...

#include "basic.h"
Include dependency graph for fitsten.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int FitStencils (int *Stencil, int32_t *Image, int Width, int Height, int StencilMul)
 Select the best-fitting contour stencils.

Detailed Description

Select the best-fitting contour stencils.

Author:
Pascal Getreuer <getreuer@gmail.com>

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 fitsten.h.


Function Documentation

int FitStencils ( int *  Stencil,
int32_t *  Image,
int  Width,
int  Height,
int  StencilMul 
)

Select the best-fitting contour stencils.

Parameters:
Stencilpointer to array of size Width by Height to be filled with the best-fitting stencil for each pixels
Imagethe input RGB image
Width,Heightimage dimensions
StencilMulmultiply the stencil index by this factor

FitStencils finds the best-fitting stencil at each pixel of the input image

\[ \mathcal{S}^\star(k) = \arg\min_{\mathcal{S}\in\Sigma} \tfrac{1}{|\mathcal{S}|} (\mathcal{S} \star [v])(k) \]

to estimate the local contour orientation. The result Stencil is a two-dimensional array with the index (0, 1, ..., or 7) of the best-fitting stencil for each pixel. The stencil TV estimates $(\mathcal{S} \star [v])(k)$ are filtered by [1,2,1; 2,4,2; 1,2,1]/16 to improve reliability.

For efficiency in CWFirstPass and CWCorrectionPass, the stencil indices are multiplied by StencilMul (so that the index may be used directly as an offset into the samples table).

Definition at line 70 of file fitsten.c.

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines