#include <typeinfo>
#include <cstring>
#include <cmath>
#include <cassert>
#include "tpimage.h"
Go to the source code of this file.
Typedefs | |
typedef double(* | DoubleFunc1 )(double) |
typedef double(* | DoubleFunc2 )(double, double) |
Functions | |
template<int dw> | |
void | GaussLowPass (SImage< float > &limg, SImage< float > &oimg, float variance) |
Gaussian low-pass filtering, with computational cost proportional to dw. | |
template<class T > | |
void | DericheLowPass (SImage< T > &src, SImage< T > &dst, double sigma, bool zeroboard) |
Low-pass filtering using Deriche's recursive method, with constant cost for all filter sizes. Suitable for up to about 5. For floating point images, an assembly implementation is used. | |
template<class S , class T > | |
void | RGBToGrey (SImage< S > &src, SImage< T > &dst) |
Convert from RGB (three value per pixel) to grey-level image. | |
template<class S , class T > | |
void | YUVToGrey (SImage< S > &src, SImage< T > &dst) |
Convert from UYVY (two value per pixel) to grey-level image. | |
template<class S , class T > | |
void | RGBToYUV (SImage< S > &src, SImage< T > &yimg, SImage< T > &uimg, SImage< T > &vimg) |
Convert from RGB to YUV. | |
template<class S , class T > | |
void | YUVToRGB (SImage< T > &yimg, SImage< T > &uimg, SImage< T > &vimg, SImage< S > &dst) |
Convert from YUV to RGB. | |
template<class T > | |
void | operator*= (SImage< T > &dst, SImage< T > &src) |
Point-wise multiply two images. | |
template<class T > | |
void | operator/= (SImage< T > &dst, SImage< T > &src) |
Point-wise divide two images. | |
template<class T > | |
void | operator+= (SImage< T > &dst, SImage< T > &src) |
Point-wise add two images. | |
template<class T > | |
void | operator-= (SImage< T > &dst, SImage< T > &src) |
Point-wise subtract two images. | |
template<class T > | |
void | Laplace (SImage< T > &src, SImage< T > &dst) |
Compute Laplacian of image. | |
template<class T > | |
void | AbsDiff (SImage< T > &src, SImage< T > &dst) |
Compute absolute difference between two images. | |
template<class T > | |
void | Abs (SImage< T > &src, SImage< T > &dst) |
Compute absolute value of image. | |
template<class T > | |
void | RotatingSum (SImage< T > &src, SImage< T > &dst, int dw, int dh) |
Sum up values within rectangular regions (quick implementation). | |
template<class T > | |
void | ReScale (SImage< T > &img, float scale) |
Rescale image values. | |
template<class T , class S > | |
void | Copy (T *indat, SImage< S > &img) |
Copy an data array to image. | |
template<class T , class S > | |
void | Copy (SImage< T > &src, SImage< S > &dst) |
Copy data from one image to another. | |
template<class T > | |
void | SubCopy (SImage< T > &src, SImage< T > &dst, int x, int y) |
Copy a sub-window from an image. | |
template<class T > | |
void | Clear (SImage< T > &img) |
Clear image data. | |
template<class T > | |
void | Fill (SImage< T > &img, T value) |
Fill image data with a certain value. | |
template<class T > | |
void | ScaleUp (SImage< T > &src, SImage< T > &dst) |
Scale-up an image to twice the size. | |
template<class T > | |
void | ScaleDown (SImage< T > &src, SImage< T > &dst) |
Low-pass and scale-down an image to half the size. | |
template<int res, class T > | |
void | SubSample (SImage< T > &src, SImage< T > &dst) |
Scale-down an image to a smaller size. | |
template<class T > | |
void | LowPass (SImage< T > &img, SImage< T > &out) |
Low-pass an image with variance = 1.0. | |
template<class T > | |
void | LowPassZero (SImage< T > &img, SImage< T > &out) |
Low-pass an image with variance = 1.0. | |
template<class T > | |
void | LowPass3 (SImage< T > &img, SImage< T > &out) |
Low-pass an image with variance = 0.5. | |
template<class T > | |
void | LowPassX (SImage< T > &img, SImage< T > &out) |
Low-pass an image x-wise with variance = 1.0. | |
template<class T > | |
void | LowPassY (SImage< T > &img, SImage< T > &out) |
Low-pass an image y-wise with variance = 1.0. | |
template<class T > | |
void | LowPassX3 (SImage< T > &img, SImage< T > &out) |
Low-pass an image x-wise with variance = 0.5. | |
template<class T > | |
void | LowPassY3 (SImage< T > &img, SImage< T > &out) |
Low-pass an image y-wise with variance = 0.5. | |
template<class T > | |
void | HighPassX3 (SImage< T > &img, SImage< T > &out) |
Compute x-wise derivative. | |
template<class T > | |
void | HighPassY3 (SImage< T > &img, SImage< T > &out) |
Compute y-wise derivative. | |
template<class T , class S > | |
void | SubRectify (SImage< T > &img, SImage< S > &out, float angle, float focal, float xp, float yp, bool sourcepos=true) |
Recify (rotate around y-axis and translate) a sub-window. | |
template<class T , class S > | |
void | Rectify (SImage< T > &img, SImage< S > &out, float angle, float focal, float xshift=0.0, float yshift=0.0) |
Recify (rotate around y-axis and translate) an image. | |
template<class T > | |
void | RadialCorrect (SImage< T > &img, SImage< T > &out, float factor) |
Correct an image for radial distortion. | |
template<class T > | |
void | SImageFunc (DoubleFunc1, SImage< T > &img, SImage< T > &out) |
template<class T > | |
void | SImageFunc (DoubleFunc2, SImage< T > &img1, SImage< T > &img2, SImage< T > &out) |
Templated image utility functions
Definition in file tpimageutil.h.
Compute absolute value of image.
src | source image |
dst | absolute value image |
Compute absolute difference between two images.
src | source image |
dst | absolute difference image |
void Clear | ( | SImage< T > & | img | ) | [inline] |
Clear image data.
img | image to be cleared |
Copy data from one image to another.
src | source image |
dst | destination image |
void Copy | ( | T * | indat, | |
SImage< S > & | img | |||
) | [inline] |
Copy an data array to image.
indat | array of image data |
img | destination image |
void DericheLowPass | ( | SImage< T > & | src, | |
SImage< T > & | dst, | |||
double | sigma, | |||
bool | zeroboard | |||
) | [inline] |
Low-pass filtering using Deriche's recursive method, with constant cost for all filter sizes. Suitable for up to about 5. For floating point images, an assembly implementation is used.
src | source image | |
sigma | filter standard deviation | |
zeroboard | whether to assume outer area is zero or mirrored |
dst | filtered image |
void Fill | ( | SImage< T > & | img, | |
T | value | |||
) | [inline] |
Fill image data with a certain value.
value | value to be used for filling |
img | image to be filled |
void GaussLowPass | ( | SImage< float > & | limg, | |
SImage< float > & | oimg, | |||
float | variance | |||
) | [inline] |
Gaussian low-pass filtering, with computational cost proportional to dw.
dw | filter width (an odd value, typ. ) | |
limg | source image | |
variance | filter variance |
oimg | filtered image |
Compute x-wise derivative.
img | source image |
out | x-wise derivative |
Compute y-wise derivative.
img | source image |
out | y-wise derivative |
Compute Laplacian of image.
src | source image |
dst | Laplacian image |
Low-pass an image with variance = 1.0.
img | source image (repeated boundary assumed) |
out | blurred destination image |
Low-pass an image with variance = 0.5.
img | source image (repeated boundary assumed) |
out | blurred destination image |
Low-pass an image x-wise with variance = 1.0.
img | source image |
out | blurred destination image |
Low-pass an image x-wise with variance = 0.5.
img | source image |
out | blurred destination image |
Low-pass an image y-wise with variance = 1.0.
img | source image |
out | blurred destination image |
Low-pass an image y-wise with variance = 0.5.
img | source image |
out | blurred destination image |
Low-pass an image with variance = 1.0.
img | source image (zero boundary assumed) |
out | blurred destination image |
Point-wise multiply two images.
src | source image |
dst | product image |
Point-wise add two images.
src | source image |
dst | sum image |
Point-wise subtract two images.
src | source image |
dst | difference image |
Point-wise divide two images.
src | source image |
dst | fraction image |
void RadialCorrect | ( | SImage< T > & | img, | |
SImage< T > & | out, | |||
float | factor | |||
) | [inline] |
Correct an image for radial distortion.
void Rectify | ( | SImage< T > & | img, | |
SImage< S > & | out, | |||
float | angle, | |||
float | focal, | |||
float | xshift = 0.0 , |
|||
float | yshift = 0.0 | |||
) | [inline] |
Recify (rotate around y-axis and translate) an image.
img | image to be rectified | |
angle | rotation angle around y-axis | |
focal | focal length (in pixels) | |
xshift | x-wise translation | |
yshift | y-wise translation |
out | rectifed image |
void ReScale | ( | SImage< T > & | img, | |
float | scale | |||
) | [inline] |
Rescale image values.
scale | rescaling factor |
img | image to be rescales |
Referenced by CUDAVisualObject::computeKeypoints().
Convert from RGB (three value per pixel) to grey-level image.
src | RGB source image |
dst | grey-level image |
void RGBToYUV | ( | SImage< S > & | src, | |
SImage< T > & | yimg, | |||
SImage< T > & | uimg, | |||
SImage< T > & | vimg | |||
) | [inline] |
Convert from RGB to YUV.
src | RGB source image |
yimg | luminance component image | |
uimg | u colour component image | |
vimg | v colour component image |
void RotatingSum | ( | SImage< T > & | src, | |
SImage< T > & | dst, | |||
int | dw, | |||
int | dh | |||
) | [inline] |
Sum up values within rectangular regions (quick implementation).
src | source image | |
dw | region widths | |
dh | region heights |
dst | image of summed up values |
Low-pass and scale-down an image to half the size.
src | source image |
dst | destination image of half the size |
Scale-up an image to twice the size.
src | source image |
dst | destination image of twice the size |
Copy a sub-window from an image.
src | source image | |
x | center x-position of window in source image | |
y | center y-position of window in source image | |
dst | destination sub-window |
void SubRectify | ( | SImage< T > & | img, | |
SImage< S > & | out, | |||
float | angle, | |||
float | focal, | |||
float | xp, | |||
float | yp, | |||
bool | sourcepos = true | |||
) | [inline] |
Recify (rotate around y-axis and translate) a sub-window.
img | image to be rectified | |
angle | rotation angle around y-axis | |
focal | focal length (in pixels) | |
xp | x-position of sub-window | |
yp | y-position of sub-window | |
sourcepos | whether positions defined in source image |
out | rectifed sub-window |
Scale-down an image to a smaller size.
src | source image | |
res | scale-down factor |
dst | scale-downed destination image |
Convert from UYVY (two value per pixel) to grey-level image.
src | UYVY source image |
dst | grey-level image |