GuidedFilter  1.2.0
 Hosted by GitHub
Functions | Variables
GF Namespace Reference

Functions

bool setProfilingFlag (int argc, char **argv)
 Checks the command line arguments for the profiling flag, --profiling. More...
 
template<typename T >
uint64_t nextPow2 (T num)
 Returns the first power of 2 greater than or equal to the input. More...
 
template<typename T >
void printBuffer (const char *title, T *ptr, uint32_t width, uint32_t height)
 Prints an array of an integer type to standard output. More...
 
template<typename T >
void printBufferF (const char *title, T *ptr, uint32_t width, uint32_t height, uint32_t prec)
 Prints an array of floating-point type to standard output. More...
 
template<typename T1 , typename T2 >
void cpuTranspose (T1 *in, T2 *out, uint32_t width, uint32_t height)
 Performs a matrix transposition. More...
 
template<typename T >
void cpuSeparateRGB (T *in, T *r, T *g, T *b, uint32_t pixels)
 Performs a matrix transposition. More...
 
template<typename T2 >
void cpuSeparateRGB_N_Norm (unsigned char *in, T2 *r, T2 *g, T2 *b, uint32_t pixels)
 Performs a matrix transposition. More...
 
template<typename T >
void cpuCombineRGB (T *r, T *g, T *b, T *out, uint32_t pixels)
 Performs a matrix transposition. More...
 
template<typename T1 >
void cpuTranspose_N_Scale (T1 *r, T1 *g, T1 *b, unsigned char *out, uint32_t pixels)
 Performs a matrix transpose. More...
 
template<typename T >
void cpuDepthTo3D (T *depth, cl_float4 *pCloud, uint32_t width, uint32_t height, float f)
 Transforms a depth image to a point cloud. More...
 
template<typename T >
void cpuRGBDTo8D (T *D, T *R, T *G, T *B, cl_float8 *points, uint32_t width, uint32_t height, float f, bool rgbNorm)
 Fuses geometry and color values into 8D feature points. More...
 
template<typename T >
void cpuSplitPC8D (T *pc8d, T *pc4d, T *rgba, uint32_t n)
 Splits an 8-D point cloud into 4-D geometry points and RGBA color points. More...
 
template<typename T >
void cpuRGBNorm (T *in, T *out, uint32_t width, uint32_t height)
 Performs RGB color normalization. More...
 
template<typename T >
void cpuScan (T *in, T *out, uint32_t width, uint32_t height)
 Performs a scan operation. More...
 
template<typename T >
void cpuSAT (T *in, T *out, uint32_t width, uint32_t height)
 Constructs a Summed Area Table (SAT). More...
 
template<typename T >
void cpuBoxFilter (T *in, T *out, int width, int height, int radius)
 Performs a blurring effect (mean filtering) on an array. More...
 
template<typename T >
void cpuMult (T *a, T *b, T *out, int width, int height)
 Performs an element-wise array multiplication. More...
 
template<typename T >
void cpuPown (T *in, T *out, int width, int height, int n)
 Performs a raise to an integer power. More...
 
template<typename T >
void cpuGuidedFilter (T *p, T *q, int width, int height, int radius, float eps)
 Performs edge preserving smoothing on an array. More...
 

Variables

std::function< unsigned char()> rNum_0_255 = std::bind (distribution1, generator)
 Uniform number generator in the range \([0, 255]\). More...
 
std::function< unsigned short()> rNum_0_10000 = std::bind (distribution2, generator)
 Uniform number generator in the range \([0, 10000]\). More...
 
std::function< float()> rNum_R_0_1 = std::bind (distributionR1, generator)
 Uniform number generator in the range \([0.0, 1.0)\). More...
 
std::function< float()> rNum_R_1_255_E__6 = std::bind (distributionR2, generator)
 Uniform number generator in the range \([1e-6, 255*1e-6)\). More...
 

Function Documentation

template<typename T >
void GF::cpuBoxFilter ( T *  in,
T *  out,
int  width,
int  height,
int  radius 
)

Performs a blurring effect (mean filtering) on an array.

It is just a naive serial implementation.

Parameters
[in]ininput array.
[out]outoutput (blurred) array.
[in]widthwidth of the array.
[in]heightheight of the array.
[in]radiusradius of the square filter window.
template<typename T >
void GF::cpuCombineRGB ( T *  r,
T *  g,
T *  b,
T *  out,
uint32_t  pixels 
)

Performs a matrix transposition.

It is just a naive serial implementation.

Parameters
[in]rinput image with channel r.
[in]ginput image with channel g.
[in]binput image with channel b.
[out]outinput image.
[in]pixelsnumber of pixels in the input array.
template<typename T >
void GF::cpuDepthTo3D ( T *  depth,
cl_float4 *  pCloud,
uint32_t  width,
uint32_t  height,
float  f 
)

Transforms a depth image to a point cloud.

It is just a naive serial implementation.

Parameters
[in]depthdepth image (for Kinect, type: uint16, unit: mm).
[out]pCloudpoint cloud.
[in]widthwidth of the array.
[in]heightheight of the array.
[in]ffocal length (for Kinect: 595.f).
template<typename T >
void GF::cpuGuidedFilter ( T *  p,
T *  q,
int  width,
int  height,
int  radius,
float  eps 
)

Performs edge preserving smoothing on an array.

It is just a naive serial implementation.

Parameters
[in]pinput array.
[out]qoutput (smoothed) array.
[in]widthwidth of the array.
[in]heightheight of the array.
[in]radiusradius of the square filter window.
[in]epsregularization parameter \( \epsilon \).
template<typename T >
void GF::cpuMult ( T *  a,
T *  b,
T *  out,
int  width,
int  height 
)

Performs an element-wise array multiplication.

It is just a naive serial implementation.

Parameters
[in]ainput array with the first operand.
[in]binput array with the second operand.
[out]outoutput array.
[in]widthwidth of the array.
[in]heightheight of the array.
template<typename T >
void GF::cpuPown ( T *  in,
T *  out,
int  width,
int  height,
int  n 
)

Performs a raise to an integer power.

It is just a naive serial implementation.

Parameters
[in]ininput array.
[out]outoutput array.
[in]widthwidth of the array.
[in]heightheight of the array.
[in]npower.
template<typename T >
void GF::cpuRGBDTo8D ( T *  D,
T *  R,
T *  G,
T *  B,
cl_float8 *  points,
uint32_t  width,
uint32_t  height,
float  f,
bool  rgbNorm 
)

Fuses geometry and color values into 8D feature points.

It is just a naive serial implementation.

Parameters
[in]Ddepth image.
[in]Rchannel R of RGB image.
[in]Gchannel G of RGB image.
[in]Bchannel B of RGB image.
[out]pointsarray of 8D feature points.
[in]widthwidth of the input arrays.
[in]heightheight of the input arrays.
[in]ffocal length (for Kinect: 595.f).
[in]rgbNormflag to indicate whether to perform RGB normalization.
template<typename T >
void GF::cpuRGBNorm ( T *  in,
T *  out,
uint32_t  width,
uint32_t  height 
)

Performs RGB color normalization.

That is $$ \hat{p}.i = \frac{p.i}{p.r + p.g + p.b},\ \ i=\{r,g,b\} $$

Template Parameters
Ttype of the data to be handled.
Parameters
[in]ininput data.
[out]outoutput (RGB normalized) data.
[in]widthwidth of the array.
[in]heightheight of the array.
template<typename T >
void GF::cpuSAT ( T *  in,
T *  out,
uint32_t  width,
uint32_t  height 
)

Constructs a Summed Area Table (SAT).

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]ininput data.
[out]outoutput (SAT) data.
[in]widthwidth of the array.
[in]heightheight of the array.
template<typename T >
void GF::cpuScan ( T *  in,
T *  out,
uint32_t  width,
uint32_t  height 
)

Performs a scan operation.

It is just a naive serial implementation.

Template Parameters
Ttype of the data to be handled.
Parameters
[in]ininput data.
[out]outoutput (scan) data.
[in]widthwidth of the array.
[in]heightheight of the array.
template<typename T >
void GF::cpuSeparateRGB ( T *  in,
T *  r,
T *  g,
T *  b,
uint32_t  pixels 
)

Performs a matrix transposition.

It is just a naive serial implementation.

Parameters
[in]ininput image.
[out]routput image with channel r.
[out]goutput image with channel g.
[out]boutput image with channel b.
[in]pixelsnumber of pixels in the input array.
template<typename T2 >
void GF::cpuSeparateRGB_N_Norm ( unsigned char *  in,
T2 *  r,
T2 *  g,
T2 *  b,
uint32_t  pixels 
)

Performs a matrix transposition.

It is just a naive serial implementation.

Parameters
[in]ininput image.
[out]routput image with channel r.
[out]goutput image with channel g.
[out]boutput image with channel b.
[in]pixelsnumber of pixels in the input array.
template<typename T >
void GF::cpuSplitPC8D ( T *  pc8d,
T *  pc4d,
T *  rgba,
uint32_t  n 
)

Splits an 8-D point cloud into 4-D geometry points and RGBA color points.

It is just a naive serial implementation.

Parameters
[in]pc8darray with 8-D points (homogeneous coordiates + RGBA values).
[out]pc4darray with 4-D geometry points.
[out]rgbaarray with 4-D color points.
[in]nnumber of points in the 8-D point cloud.
template<typename T1 , typename T2 >
void GF::cpuTranspose ( T1 *  in,
T2 *  out,
uint32_t  width,
uint32_t  height 
)

Performs a matrix transposition.

It is just a naive serial implementation.

Parameters
[in]ininput image.
[out]outoutput (transpose) image.
[in]widthwidth of the input array.
[in]heightheight of the input array.
template<typename T1 >
void GF::cpuTranspose_N_Scale ( T1 *  r,
T1 *  g,
T1 *  b,
unsigned char *  out,
uint32_t  pixels 
)

Performs a matrix transpose.

It is just a naive serial implementation.

Parameters
[in]rinput image with channel r.
[in]ginput image with channel g.
[in]binput image with channel b.
[out]outoutput (transpose) image.
[in]pixelsnumber of pixels in the input array.
template<typename T >
uint64_t GF::nextPow2 ( num)

Returns the first power of 2 greater than or equal to the input.

Parameters
[in]numinput data.
Returns
The first power of 2 >= num.
template<typename T >
void GF::printBuffer ( const char *  title,
T *  ptr,
uint32_t  width,
uint32_t  height 
)

Prints an array of an integer type to standard output.

Template Parameters
Ttype of the data to be printed.
Parameters
[in]titlelegend for the output.
[in]ptrarray that is to be displayed.
[in]widthwidth of the array.
[in]heightheight of the array.
template<typename T >
void GF::printBufferF ( const char *  title,
T *  ptr,
uint32_t  width,
uint32_t  height,
uint32_t  prec 
)

Prints an array of floating-point type to standard output.

Template Parameters
Ttype of the data to be printed.
Parameters
[in]titlelegend for the output.
[in]ptrarray that is to be displayed.
[in]widthwidth of the array.
[in]heightheight of the array.
[in]precthe number of decimal places to print.
bool GF::setProfilingFlag ( int  argc,
char **  argv 
)

Checks the command line arguments for the profiling flag, --profiling.

Parameters
[in]argccommand line argument count
[in]argvcommand line arguments
Returns
A flag to indicate whether a command line argument for profiling was provided.

Variable Documentation

std::function< unsigned short()> GF::rNum_0_10000 = std::bind (distribution2, generator)

Uniform number generator in the range \([0, 10000]\).

std::function< unsigned char()> GF::rNum_0_255 = std::bind (distribution1, generator)

Uniform number generator in the range \([0, 255]\).

std::function< float()> GF::rNum_R_0_1 = std::bind (distributionR1, generator)

Uniform number generator in the range \([0.0, 1.0)\).

std::function< float()> GF::rNum_R_1_255_E__6 = std::bind (distributionR2, generator)

Uniform number generator in the range \([1e-6, 255*1e-6)\).