#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <cmath>
Go to the source code of this file.
Functions | |
void | low_pass_filter (float *input, float *out, float sigma, int niter, int width, int height) |
Low Pass filter L_sigma f The low pass filter is approximated by L = Id - (Id - G_sigma)^{n *} That is, the difference between f and G_sigma(f) is convolved again with G_sigma, and the result of this convolution is put back to f This approach is iterated niter times. | |
float | WeightingFunction (float r1, float r2) |
Weighting function w(lambda(x)) being lambda(x) = (r1 - r2) / r1 and w(x) the linear ramp going from 0 to 1 between lambda=0.25 and lambda=0.5. | |
void | non_linear_cartoon (float *input, float *out, float sigma, int width, int height) |
Cartoon + texture decomposition for a single channel image. | |
void | non_linear_cartoon (float *ired, float *igreen, float *iblue, float *ored, float *ogreen, float *oblue, float sigma, int width, int height) |
Cartoon + texture decomposition for a color image. | |
void | fpCopy (float *fpI, float *fpO, int iLength) |
Copy vector. | |
void | fpCombine (float *u, float a, float *v, float b, float *w, int size) |
Linear combination of two vectors: a * u + b * v. | |
void | fiComputeImageGradient (float *tpI, float *tpGrad, float *tpOri, int iWidth, int iHeight) |
Compute gradient magnitude and orientation of an image. | |
float * | fiFloatGaussKernel (float std, int &size) |
Build a 1D Gauss kernel of standard deviation std Length of vector is calculated depending on std. | |
void | fiSepConvol (float *u, float *v, int width, int height, float *xkernel, int xksize, float *ykernel, int yksize) |
Separable convolution by rows and columns with respective filters xkernel and ykernel. |
void fiComputeImageGradient | ( | float * | tpI, | |
float * | tpGrad, | |||
float * | tpOri, | |||
int | iWidth, | |||
int | iHeight | |||
) |
Compute gradient magnitude and orientation of an image.
[in] | tpI | input image |
[out] | tpGrad | output gradient magnitude |
[out] | tpOri | output gradient orientation |
[in] | iWidth,iHeight | size of the image |
Definition at line 427 of file libcartoon.cpp.
float* fiFloatGaussKernel | ( | float | std, | |
int & | size | |||
) |
Build a 1D Gauss kernel of standard deviation std Length of vector is calculated depending on std.
[in] | std | Gaussian standard deviation |
[out] | size | length of Gaussian vector |
Definition at line 478 of file libcartoon.cpp.
void fiSepConvol | ( | float * | u, | |
float * | v, | |||
int | width, | |||
int | height, | |||
float * | xkernel, | |||
int | xksize, | |||
float * | ykernel, | |||
int | yksize | |||
) |
Separable convolution by rows and columns with respective filters xkernel and ykernel.
[in] | u | input image |
[out] | v | output image |
[in] | xksize | length of kernel for row convolution |
[in] | xkernel | input kernel for row convolution |
[in] | yksize | length of kernel for column convolution |
[in] | ykernel | input kernel for column convolution |
[in] | width,height | size of the image |
Definition at line 683 of file libcartoon.cpp.
void fpCombine | ( | float * | u, | |
float | a, | |||
float * | v, | |||
float | b, | |||
float * | w, | |||
int | size | |||
) |
Linear combination of two vectors: a * u + b * v.
[in] | u | input vector |
[in] | v | input vector |
[in] | a | value |
[in] | b | value |
[out] | w | output vector |
[in] | size | length of vector |
Definition at line 406 of file libcartoon.cpp.
void fpCopy | ( | float * | fpI, | |
float * | fpO, | |||
int | iLength | |||
) |
Copy vector.
Auxiliar functions
[in] | fpI | input vector |
[out] | fpO | output vector |
[in] | iLength | length of vector |
[in] | fpI | input vector |
[out] | fpO | output vector |
[in] | iLength | length of vector |
Definition at line 384 of file libcartoon.cpp.
void low_pass_filter | ( | float * | input, | |
float * | out, | |||
float | sigma, | |||
int | niter, | |||
int | width, | |||
int | height | |||
) |
Low Pass filter L_sigma f The low pass filter is approximated by L = Id - (Id - G_sigma)^{n *} That is, the difference between f and G_sigma(f) is convolved again with G_sigma, and the result of this convolution is put back to f This approach is iterated niter times.
[in] | input | input image |
[out] | out | output vector |
[in] | sigma | standard deviation of the low pass filter |
[in] | niter | number of iterations |
[in] | width,height | size of the image |
Definition at line 261 of file libcartoon.cpp.
void non_linear_cartoon | ( | float * | ired, | |
float * | igreen, | |||
float * | iblue, | |||
float * | ored, | |||
float * | ogreen, | |||
float * | oblue, | |||
float | sigma, | |||
int | width, | |||
int | height | |||
) |
Cartoon + texture decomposition for a color image.
[in] | ired,igreen,iblue | input image |
[out] | ored,ogreen,oblue | output vector |
[in] | sigma | standard deviation of the low pass filter |
[in] | width,height | size of the image |
Definition at line 129 of file libcartoon.cpp.
void non_linear_cartoon | ( | float * | input, | |
float * | out, | |||
float | sigma, | |||
int | width, | |||
int | height | |||
) |
Cartoon + texture decomposition for a single channel image.
[in] | input | input image |
[out] | out | output vector |
[in] | sigma | standard deviation of the low pass filter |
[in] | width,height | size of the image |
Definition at line 51 of file libcartoon.cpp.
float WeightingFunction | ( | float | r1, | |
float | r2 | |||
) |
Weighting function w(lambda(x)) being lambda(x) = (r1 - r2) / r1 and w(x) the linear ramp going from 0 to 1 between lambda=0.25 and lambda=0.5.
[in] | r1 | G_sigma * |Df| |
[in] | r2 | G*|D(L_sigma*f)| |
Definition at line 334 of file libcartoon.cpp.