#include <gevd_float_operators.h>
Static Public Member Functions | |
static float | Convolve (const gevd_bufferxy &from, const gevd_bufferxy &kernel, gevd_bufferxy *&to) |
Convolves from image with 2D filter and stores values in to image. | |
static gevd_bufferxy * | Read2dKernel (const char *filename) |
Read 2D kernel from a file: width height k_x_y .... | |
static float | Convolve (const gevd_bufferxy &from, gevd_bufferxy *&to, const float *xkernel, const int xradius, const bool xevenp, const float *ykernel, const int yradius, const bool yevenp, const bool xwrap=false, const bool ywrap=false) |
Convolves from image with two separable filters, along directions x and y, and stores values in to image. | |
static float | Convolve (const gevd_bufferxy &from, gevd_bufferxy *&to, const float *xkernel, const int xradius, const bool xevenp, const int yradius, const bool xwrap=false, const bool ywrap=false) |
Convolves from image with a filter along x, and a running sum along y-axis, then stores values in to image. | |
static float | Convolve (const float *from, float *&to, const int len, const float *kernel, const int radius, const bool evenp, const bool wrap=false) |
Convolve a linear array of data, wrapping at the 2 ends. | |
static float | RunningSum (float *from, float *&to, const int len, const int radius, const bool wrap=false) |
For large smoothing sigma, use running sum to avoid floating multiplications. | |
static bool | Read1dKernel (const char *filename, float *&kernel, int &radius, bool &evenp) |
Read 1d odd/even kernel from a file: width k_i .... | |
static float | Gaussian (gevd_bufferxy &img, gevd_bufferxy *&smooth, const float sigma=1.0f, const bool xwrap=false, const bool ywrap=false) |
Convolves the from image with a 2D Gaussian filter with standard deviation sigma. | |
static bool | Find1dGaussianKernel (const float sigma, float *&kernel, int &radius, const float fuzz=0.02f) |
Returns the kernel array for Gaussian with given standard deviation sigma [pixel], and cutoff at min/max = fuzz. | |
static float | Gradient (const gevd_bufferxy &smooth, gevd_bufferxy *&mag, gevd_bufferxy *&dirx, gevd_bufferxy *&diry, const bool xwrap=false, const bool ywrap=false) |
Compute the gradient of the intensity surface. | |
static float | Slope (float *from, float *&to, const int len, const bool wrap=false) |
Compute slope or first-difference, in linear/circular array. | |
static float | Hessian (const gevd_bufferxy &smooth, gevd_bufferxy *&mag, gevd_bufferxy *&dirx, gevd_bufferxy *&diry, const bool xwrap=false, const bool ywrap=false) |
Compute the Hessian of the intensity surface. | |
static float | Laplacian (const gevd_bufferxy &smooth, gevd_bufferxy *&mag, gevd_bufferxy *&dirx, gevd_bufferxy *&diry, const bool xwrap=false, const bool ywrap=false) |
Compute the Laplacian of the intensity surface. | |
static float | Curvature (float *from, float *&to, const int len, const bool wrap=false) |
Compute curvature, or 2nd-difference in linear/circular array. | |
static float | Orientation (const gevd_bufferxy &smooth, gevd_bufferxy *&theta, gevd_bufferxy *&coherence, const int frame=1) |
Compute the local orientation at each pixel in the image, and returns 2 images: twice the angle, and coherence measure (0,1). | |
static void | NonMaximumSuppression (const gevd_bufferxy &magnitude, const gevd_bufferxy &directionx, const gevd_bufferxy &directiony, const float threshold, gevd_bufferxy *&contour, gevd_bufferxy *&direction, gevd_bufferxy *&locationx, gevd_bufferxy *&locationy, const bool xwrap=false, const bool ywrap=false) |
Detect contour pixels as strict local maxima, and interpolate the strength/location with a parabola through 3 points. | |
static int | NonMaximumSuppression (const float *from, const int len, const float threshold, int *&index, float *&mag, float *&locs, const bool wrap=false) |
Detect local maxima in linear/circular array. | |
static float | InterpolateParabola (float y1, float y0, float y2, float &y) |
Fit a parabola through 3 points with strict local max/min. | |
static float | BilinearInterpolate (const gevd_bufferxy &img, float x, float y) |
Return the float value of pixel (x, y) in float buffer, using bilinear interpolation. | |
static void | SupportAngle (const gevd_bufferxy &dirx, const gevd_bufferxy &diry, const gevd_bufferxy &magnitude, gevd_bufferxy *&angle) |
Find angle of the line of support, in degrees. | |
static void | SurfaceNormal (const gevd_bufferxy &range, gevd_bufferxy *&normal) |
Find local surface normal at all pixels in the range z(x,y) image. | |
static void | SurfaceCurvature (const gevd_bufferxy &normal, gevd_bufferxy *&curvature) |
Find local gaussian curvature at all pixels from the local surface normals, previously computed from the range z(x,y) image. | |
static void | SurfaceNormalD (const gevd_bufferxy &range, gevd_bufferxy *&normal, float no_value, float pixel_distance=1.0f) |
Same as gevd_float_operators::SurfaceNormal with two exceptions. | |
static void | SurfaceCurvatureD (const gevd_bufferxy &normal, const gevd_bufferxy &surface, gevd_bufferxy *&curvature, float dflt, float pixel_distance=1.0f) |
Estimate the maximum curvature at all pixels from the local surface normals, previously computed from the range z(x,y) image. | |
static float | ShrinkBy2 (const gevd_bufferxy &cfrom, gevd_bufferxy *&to, const float burt_ka=0.359375f) |
Shrinks the from image by 2 and stores into to image, using Burt-Adelson reduction algorithm. | |
static float | ExpandBy2 (const gevd_bufferxy &cfrom, gevd_bufferxy *&to, const float burt_ka=0.359375f) |
Expands the from image by 2 and store into to image, using Burt-Adelson expansion algorithm. | |
static void | ShrinkBy2_D (const gevd_bufferxy &from, gevd_bufferxy *&to, float no_value, float burt_ka=0.359375f) |
Shrinks the from image by 2 and stores into to image. | |
static int | Pyramid (const float *from, const int length, float *&to, int &nlevels, int trim=0, const float burt_ka=0.359375f) |
Compute the pyramid by shrinking data sequence by 2, nlevels-1 times, and return final shrunk length, and reset number of levels in pyramid. | |
static int | ShrinkBy2 (const float *from, const int length, float *&to, const float burt_ka=0.359375f) |
static bool | WaveletTransform (float *array, const int n, const bool forwardp, int nlevels, const int waveletno=4) |
Compute the forward/inverse wavelet transform of a 1d array of data. | |
static bool | WaveletTransformByBlock (float *array, const int *dims, const int ndim, const bool forwardp, int nlevels, const int waveletno=4) |
n-dimensional wavelet transform of an n-dimensional array. | |
static bool | WaveletTransformByIndex (float *array, const int *dims, const int ndim, const bool forwardp, int nlevels, const int waveletno=4) |
n-dimensional wavelet transform of an n-dimensional array. | |
static bool | FindWavelet (const int waveletno, float *&cc, float *&cr, int &ncof) |
Looks up and stores the wavelet pair in (lo_filter, hi_filter). | |
static void | LowHighPyramid (float *highPass, float *lowPass, int n, int nlevels, const float *lo_filter, const float *hi_filter, int ncof, float *wksp) |
Find pyramid of low/high pass components, using wavelet transform. | |
static bool | WaveletTransformByBlock (const gevd_bufferxy &cfrom, gevd_bufferxy *&to, const bool forwardp, int nlevels, const int waveletno=4) |
Compute the Fast Wavelet Transform of the image. | |
static bool | WaveletTransformByIndex (const gevd_bufferxy &cfrom, gevd_bufferxy *&to, const bool forwardp, int nlevels, const int waveletno=4) |
Compute the Fast Wavelet Transform of the 2d array. | |
static int | DeleteMixedComponents (gevd_bufferxy &wave, const int nlevels) |
Delete all wavelet components, which have high frequency along both x- and y- axes. | |
static int | TruncateHighFrequencies (gevd_bufferxy &wave, const int nlevels, const float threshold=0.1f) |
Truncate to 0, all wavelet components with high frequency along either x- or y- axes only, not both. | |
static int | TruncateLowestFrequency (gevd_bufferxy &wave, const int nlevels) |
Truncate to average value, the lowest frequency component. | |
static int | DeleteBoundaryArtifacts (float *wave, const int n, const int nlevels) |
Delete boundary artefacts in 1d-array, because its length is not a power of 2, and so wrapping will skip the last odd element. | |
static int | DeleteBoundaryArtifacts (gevd_bufferxy &wave, const int nlevels) |
Delete boundary artefacts because the dimension of the image is not a power of 2, and so wrapping will skip the last odd element. | |
static void | ProjectWaveOntoX (const gevd_bufferxy &buf, float *&proj, const int nlevels=0) |
Project wavelet components onto the axes. | |
static void | ProjectWaveOntoY (const gevd_bufferxy &buf, float *&proj, const int nlevels=0) |
static void | ProjectOntoX (const gevd_bufferxy &buf, float *&proj, int sizeX=0, int sizeY=0, int origX=0, int origY=0) |
Project the image data in ROI onto the x- and y- axes. | |
static void | ProjectOntoY (const gevd_bufferxy &buf, float *&proj, int sizeX=0, int sizeY=0, int origX=0, int origY=0) |
static float | Correlation (const gevd_bufferxy &from, const gevd_bufferxy &kernel, gevd_bufferxy *&to) |
Correlate from image with 2D filter and stores values in to image. | |
static float | CorrelationAlongAxis (const gevd_bufferxy &from, const gevd_bufferxy &kernel, gevd_bufferxy *&to) |
Correlate from image with 2D filter and stores values in to image. | |
static float | Correlation (const float *data, const int length, const float *pattern, const int radius, const int index) |
Find correlation of given pattern to data, matching pattern[radius+i] with data[index+i]. | |
static float * | Correlations (const float *data, const int length, const float *pattern, const int radius, const int index, const int search) |
Find correlations of given pattern to data, given maximum search from index. | |
static float | BestCorrelation (const float *data, const int length, const float *pattern, const int radius, int &shift, const int search) |
Find correlation, and return correlation and shift values. | |
static float | CoarseFineCorrelation (const float *dataPyr, const int dlength, const float *patternPyr, const int plength, float &shift, const int coarse, const int fine, const float cutoff=0, const float overlap=0.75f, float *matches=0) |
Search for best correlation, from coarse to fine, starting at a priori shift, and requiring minimum overlap. | |
static void | Apply (gevd_bufferxy &buf, float(*func)(float)) |
Apply function to all elements in buffer. | |
static gevd_bufferxy * | AbsoluteDifference (const gevd_bufferxy &buf1, const gevd_bufferxy &buf2) |
static gevd_bufferxy * | Allocate (gevd_bufferxy *space, const gevd_bufferxy &model, int bits_per_pixel=0, int sizeX=0, int sizeY=0) |
Allocate new space if desired depth and sizes are not the same. | |
static gevd_bufferxy * | SimilarBuffer (const gevd_bufferxy &buffer, int bits_per_pixel=0, int sizeX=0, int sizeY=0) |
Creates a new buffer similar to buf, unless dimension and precision are given. | |
static bool | IsSimilarBuffer (const gevd_bufferxy &buf1, const gevd_bufferxy &buf2) |
Two buffers are similar if they have the same dimensions, and precision (bits_per_pixel). | |
static gevd_bufferxy * | Extract (const gevd_bufferxy &buf, int sizeX=0, int sizeY=0, int origX=0, int origY=0) |
Extract from buf, a float sub-buffer with dimensions (sizeX, sizeY), from top-left corner (origX, origY). | |
static void | Update (gevd_bufferxy &old_buf, const gevd_bufferxy &new_buf, int origX=0, int origY=0) |
Update a float sub-buffer of buf, from top-left corner (origX, origY), with values in sub. | |
static gevd_bufferxy * | TransposeExtract (const gevd_bufferxy &buf, int sizeX, int sizeY, int origX, int origY) |
static void | TransposeUpdate (gevd_bufferxy &buf, const gevd_bufferxy &sub, int origX, int origY) |
static void | Fill (gevd_bufferxy &buf, const float value, int sizeX=0, int sizeY=0, int origX=0, int origY=0) |
Set all pixels in ROI to value. | |
static void | FillFrameX (gevd_bufferxy &buf, const float value, const int width=1) |
Sets all pixels in the frame region to value (default = 0). | |
static void | FillFrameY (gevd_bufferxy &buf, const float value, const int width=1) |
static void | DrawFrame (gevd_bufferxy &buf, const int loc, const float value=0) |
Sets all pixels on frame contour, such as buf(loc, i), to value. | |
static gevd_bufferxy * | PadToPowerOf2 (gevd_bufferxy &buf) |
Pad the buffer by repeating values at the border, so that the new buffer has dimensions being powers of 2. | |
static gevd_bufferxy * | UnpadFromPowerOf2 (gevd_bufferxy &padded, int sizeX, int sizeY) |
Inverse of the above operation. | |
static float | Maximum (const gevd_bufferxy &buf, int sizeX=0, int sizeY=0, int origX=0, int origY=0) |
Returns the maximum value in float buffer. | |
static float | Minimum (const gevd_bufferxy &buf, int sizeX=0, int sizeY=0, int origX=0, int origY=0) |
Returns the minimum value in float buffer. | |
static bool | Maximum (const float *data, const int length, int &index, float &value) |
Detect maximum in 1d-array of values. | |
static float | Sum (const gevd_bufferxy &buf, int sizeX=0, int sizeY=0, int origX=0, int origY=0) |
Returns the sum of all values in float buffer. | |
static int | Threshold (gevd_bufferxy &buf, float noise, int sizeX=0, int sizeY=0, int origX=0, int origY=0) |
Truncate all values in ROI to 0, if below noise. | |
static float | TruncateToPositive (gevd_bufferxy &buf) |
Zeros out all negative values. | |
static float | TruncateToCeiling (gevd_bufferxy &buf, float ceil) |
static void | Absolute (gevd_bufferxy &buf) |
Replace with absolute values. | |
static void | Negate (gevd_bufferxy &buf) |
Negate all values. | |
static void | Scale (gevd_bufferxy &buf, float factor) |
Scale all values by factor. | |
static void | ShiftToPositive (gevd_bufferxy &buf) |
Shift to positive values, by adding 30.0000, and truncate all values to 0-60.000. | |
static void | Normalize (gevd_bufferxy &buf, const float lo, const float hi) |
Normalizes a float buffer so that the pixel values range from lo to hi, inclusive. | |
static bool | BufferToFloat (const gevd_bufferxy &from, gevd_bufferxy &floatto) |
Converts from a unsigned char (8-bit) or a short (16-bit) buffer to a float buffer to avoid overflow/underflow and conversion for subsequent math computations. | |
static bool | FloatToBuffer (const gevd_bufferxy &floatfrom, gevd_bufferxy &to) |
Static Protected Member Functions | |
static int | SetupPipeline (const float *data, const int len, const int kradius, const bool wrap, float *&cache, float *&pipeline) |
Setup the cache for reflection/wrapping at the borders, and the center pipeline. | |
static gevd_bufferxy * | WrapAlongX (const gevd_bufferxy &img) |
Create a buffer that wraps rows/columns. | |
static gevd_bufferxy * | WrapAlongY (const gevd_bufferxy &img) |
static float | Gaussian (const float x, const float sigma) |
static float | ShrinkBy2AlongX (const gevd_bufferxy &cfrom, const int y, float *yline, const int len, const float ka, const float kb, const float kc) |
Shrinks the yline by 2 along the x-axis. | |
static void | ShrinkBy2AlongX_D (const gevd_bufferxy &from, int from_sizeX, int sizeX, int y, float kernel[], float no_value, float *yline, float *wline) |
Create a smoothed and subsampled array of x values in the given row. | |
static float | ExpandBy2AlongX (const gevd_bufferxy &cfrom, const int y, float *yline, const int len, const float ka, const float kb, const float kc) |
Expands the yline by 2 along the x-axis. | |
static void | WaveletTransformStep (float *array, const int n, const bool forwardp, const float *lo_filter, const float *hi_filter, const int ncof, float *wksp) |
Convolution with wavelets (lo_filter, hi_filter) and gather results into consecutive blocks, with convolution of lo_filter (resp. | |
static void | WaveletTransformStep (float *array, const int *dims, const int ndim, const bool forwardp, const float *lo_filter, const float *hi_filter, const int ncof, float *buffer, float *wksp) |
static void | CopyNdRecursive (const float *from_array, const int from_size, const int *from_dims, float *to_array, const int to_size, const int *to_dims, const int ndim, const bool fullp=true) |
Recursively copies elements of n-dimensional arrays. | |
static void | TestWavelets () |
Private Member Functions | |
gevd_float_operators () |
Definition at line 42 of file gevd_float_operators.h.
gevd_float_operators::gevd_float_operators | ( | ) | [private] |
void gevd_float_operators::Absolute | ( | gevd_bufferxy & | buf | ) | [static] |
Replace with absolute values.
Definition at line 3835 of file gevd_float_operators.cxx.
gevd_bufferxy * gevd_float_operators::AbsoluteDifference | ( | const gevd_bufferxy & | buf1, |
const gevd_bufferxy & | buf2 | ||
) | [static] |
Definition at line 4110 of file gevd_float_operators.cxx.
gevd_bufferxy * gevd_float_operators::Allocate | ( | gevd_bufferxy * | space, |
const gevd_bufferxy & | model, | ||
int | bits_per_pixel = 0 , |
||
int | sizeX = 0 , |
||
int | sizeY = 0 |
||
) | [static] |
Allocate new space if desired depth and sizes are not the same.
Definition at line 3521 of file gevd_float_operators.cxx.
void gevd_float_operators::Apply | ( | gevd_bufferxy & | buf, |
float(*)(float) | func | ||
) | [static] |
Apply function to all elements in buffer.
Definition at line 3509 of file gevd_float_operators.cxx.
float gevd_float_operators::BestCorrelation | ( | const float * | data, |
const int | length, | ||
const float * | pattern, | ||
const int | radius, | ||
int & | shift, | ||
const int | search | ||
) | [static] |
Find correlation, and return correlation and shift values.
Definition at line 3366 of file gevd_float_operators.cxx.
float gevd_float_operators::BilinearInterpolate | ( | const gevd_bufferxy & | img, |
float | x, | ||
float | y | ||
) | [static] |
Return the float value of pixel (x, y) in float buffer, using bilinear interpolation.
Definition at line 1457 of file gevd_float_operators.cxx.
bool gevd_float_operators::BufferToFloat | ( | const gevd_bufferxy & | from, |
gevd_bufferxy & | to | ||
) | [static] |
Converts from a unsigned char (8-bit) or a short (16-bit) buffer to a float buffer to avoid overflow/underflow and conversion for subsequent math computations.
O(n*m).
Definition at line 3880 of file gevd_float_operators.cxx.
float gevd_float_operators::CoarseFineCorrelation | ( | const float * | dataPyr, |
const int | dlength, | ||
const float * | patternPyr, | ||
const int | plength, | ||
float & | shift, | ||
const int | coarse, | ||
const int | fine, | ||
const float | cutoff = 0 , |
||
const float | overlap = 0.75f , |
||
float * | matches = 0 |
||
) | [static] |
Search for best correlation, from coarse to fine, starting at a priori shift, and requiring minimum overlap.
O(n) time. Return last best correlation, and its corresponding shift. The search is cutoff early, if no maximum is found, or maximum correlation <= cutoff. Accumulate match values if matches non null. Assumes data and pattern are pyramids. Compile with -DDEBUG to trace the coarse-to-fine search of the best correlation,
Definition at line 3398 of file gevd_float_operators.cxx.
float gevd_float_operators::Convolve | ( | const gevd_bufferxy & | from, |
const gevd_bufferxy & | kernel, | ||
gevd_bufferxy *& | to | ||
) | [static] |
Convolves from image with 2D filter and stores values in to image.
O(m*n*k). The filter kernel has odd width and height, and is either even or odd along x- or y-axis. Assume image data is in row-major order.
Special care is taken when to and from are identical - Peter Vanroose.
Definition at line 48 of file gevd_float_operators.cxx.
float gevd_float_operators::Convolve | ( | const gevd_bufferxy & | from, |
gevd_bufferxy *& | to, | ||
const float * | xkernel, | ||
const int | xradius, | ||
const bool | xevenp, | ||
const float * | ykernel, | ||
const int | yradius, | ||
const bool | yevenp, | ||
const bool | xwrap = false , |
||
const bool | ywrap = false |
||
) | [static] |
Convolves from image with two separable filters, along directions x and y, and stores values in to image.
O(m*n*k). The filter kernel has length 2*radius + 1, and is either even or odd. Assume image data is in row-major order.
Special care is taken when to and from are identical - Peter Vanroose.
Definition at line 229 of file gevd_float_operators.cxx.
float gevd_float_operators::Convolve | ( | const gevd_bufferxy & | from, |
gevd_bufferxy *& | to, | ||
const float * | xkernel, | ||
const int | xradius, | ||
const bool | xevenp, | ||
const int | yradius, | ||
const bool | xwrap = false , |
||
const bool | ywrap = false |
||
) | [static] |
Convolves from image with a filter along x, and a running sum along y-axis, then stores values in to image.
O(m*n*k).
Definition at line 379 of file gevd_float_operators.cxx.
float gevd_float_operators::Convolve | ( | const float * | from, |
float *& | to, | ||
const int | len, | ||
const float * | kernel, | ||
const int | kradius, | ||
const bool | evenp, | ||
const bool | wrap = false |
||
) | [static] |
Convolve a linear array of data, wrapping at the 2 ends.
Special care is taken when to and from are identical - Peter Vanroose.
Definition at line 493 of file gevd_float_operators.cxx.
void gevd_float_operators::CopyNdRecursive | ( | const float * | from_array, |
const int | from_size, | ||
const int * | from_dims, | ||
float * | to_array, | ||
const int | to_size, | ||
const int * | to_dims, | ||
const int | ndim, | ||
const bool | fullp = true |
||
) | [static, protected] |
Recursively copies elements of n-dimensional arrays.
Extra elements that can not fit in both arrays are not read or written. A flag fullp (default = true) is used to copy from/to a full n-dimensional array or only a sub-block of the array.
Definition at line 2818 of file gevd_float_operators.cxx.
float gevd_float_operators::Correlation | ( | const gevd_bufferxy & | from, |
const gevd_bufferxy & | kernel, | ||
gevd_bufferxy *& | to | ||
) | [static] |
Correlate from image with 2D filter and stores values in to image.
O(m*n*k). The filter kernel has odd width and height, and is either even or odd along x- or y-axis. Assume image data is in row-major order.
Special care is taken when to and from are identical - Peter Vanroose.
Definition at line 90 of file gevd_float_operators.cxx.
float gevd_float_operators::Correlation | ( | const float * | data, |
const int | length, | ||
const float * | pattern, | ||
const int | radius, | ||
const int | index | ||
) | [static] |
Find correlation of given pattern to data, matching pattern[radius+i] with data[index+i].
The linear correlation coefficient, also called Pearson r, is computed, O(|pattern|). Assumed pattern has length = 2*radius + 1.
Definition at line 3299 of file gevd_float_operators.cxx.
float gevd_float_operators::CorrelationAlongAxis | ( | const gevd_bufferxy & | from, |
const gevd_bufferxy & | kernel, | ||
gevd_bufferxy *& | to | ||
) | [static] |
Correlate from image with 2D filter and stores values in to image.
Special care is taken when to and from are identical - Peter Vanroose.
Definition at line 140 of file gevd_float_operators.cxx.
float * gevd_float_operators::Correlations | ( | const float * | data, |
const int | length, | ||
const float * | pattern, | ||
const int | radius, | ||
const int | index, | ||
const int | search | ||
) | [static] |
Find correlations of given pattern to data, given maximum search from index.
O(|pattern|*shift). Returns the array of correlation values, with positive translation starting from result[search+1], and negative translation starting from result[search-1].
Definition at line 3336 of file gevd_float_operators.cxx.
float gevd_float_operators::Curvature | ( | float * | from, |
float *& | to, | ||
const int | len, | ||
const bool | wrap = false |
||
) | [static] |
Compute curvature, or 2nd-difference in linear/circular array.
Special care is taken when to and from are identical - Peter Vanroose.
Definition at line 1145 of file gevd_float_operators.cxx.
int gevd_float_operators::DeleteBoundaryArtifacts | ( | float * | wave, |
const int | n, | ||
const int | nlevels | ||
) | [static] |
Delete boundary artefacts in 1d-array, because its length is not a power of 2, and so wrapping will skip the last odd element.
Definition at line 3160 of file gevd_float_operators.cxx.
int gevd_float_operators::DeleteBoundaryArtifacts | ( | gevd_bufferxy & | wave, |
const int | nlevels | ||
) | [static] |
Delete boundary artefacts because the dimension of the image is not a power of 2, and so wrapping will skip the last odd element.
Definition at line 3185 of file gevd_float_operators.cxx.
int gevd_float_operators::DeleteMixedComponents | ( | gevd_bufferxy & | wave, |
const int | nlevels | ||
) | [static] |
Delete all wavelet components, which have high frequency along both x- and y- axes.
They are diagonal blocks, except the lowest frequency block. This will throw away high frequency point-like features. Return the number of coefficients deleted.
Definition at line 3083 of file gevd_float_operators.cxx.
void gevd_float_operators::DrawFrame | ( | gevd_bufferxy & | buf, |
const int | loc, | ||
const float | value = 0 |
||
) | [static] |
Sets all pixels on frame contour, such as buf(loc, i), to value.
O(n+m).
Definition at line 3656 of file gevd_float_operators.cxx.
float gevd_float_operators::ExpandBy2 | ( | const gevd_bufferxy & | from, |
gevd_bufferxy *& | to, | ||
const float | burt_ka = 0.359375f |
||
) | [static] |
Expands the from image by 2 and store into to image, using Burt-Adelson expansion algorithm.
Convolution with a 5-point kernel [(0.5-ka), 0.5, 2*ka, 0.5, (0.5-ka)] ka = 0.6 maximum decorrelation, low-pass filter for image compression. ka = 0.5 linear interpolation, ka = 0.4 Gaussian filter, smoothing at tail. ka = 0.3 wider than Gaussian, for more smoothing. The image indexes are mapped with: to.ij = from.ij * 2 The image sizes are related by: to.size = from.size * 2.
Special care is taken when to and from are identical - Peter Vanroose.
Definition at line 2159 of file gevd_float_operators.cxx.
float gevd_float_operators::ExpandBy2AlongX | ( | const gevd_bufferxy & | from, |
const int | y, | ||
float * | yline, | ||
const int | sizeX, | ||
const float | ka, | ||
const float | kb, | ||
const float | kc | ||
) | [static, protected] |
Expands the yline by 2 along the x-axis.
Interpolation is done by convolution with pixels at integral indexes only.
Definition at line 2207 of file gevd_float_operators.cxx.
gevd_bufferxy * gevd_float_operators::Extract | ( | const gevd_bufferxy & | buf, |
int | sizeX = 0 , |
||
int | sizeY = 0 , |
||
int | origX = 0 , |
||
int | origY = 0 |
||
) | [static] |
Extract from buf, a float sub-buffer with dimensions (sizeX, sizeY), from top-left corner (origX, origY).
Faster copying can be done with read/write chunks of memory.
Definition at line 3574 of file gevd_float_operators.cxx.
void gevd_float_operators::Fill | ( | gevd_bufferxy & | buf, |
const float | value, | ||
int | sizeX = 0 , |
||
int | sizeY = 0 , |
||
int | origX = 0 , |
||
int | origY = 0 |
||
) | [static] |
Set all pixels in ROI to value.
Definition at line 3604 of file gevd_float_operators.cxx.
void gevd_float_operators::FillFrameX | ( | gevd_bufferxy & | buf, |
const float | value, | ||
const int | width = 1 |
||
) | [static] |
Sets all pixels in the frame region to value (default = 0).
O((n+m)*width). The frame region is a rectangular band with given width, framing at two ends of x/y axes.
Definition at line 3624 of file gevd_float_operators.cxx.
void gevd_float_operators::FillFrameY | ( | gevd_bufferxy & | buf, |
const float | value, | ||
const int | width = 1 |
||
) | [static] |
Definition at line 3639 of file gevd_float_operators.cxx.
bool gevd_float_operators::Find1dGaussianKernel | ( | const float | sigma, |
float *& | kernel, | ||
int & | radius, | ||
const float | fuzz = 0.02f |
||
) | [static] |
Returns the kernel array for Gaussian with given standard deviation sigma [pixel], and cutoff at min/max = fuzz.
The area under the discrete Gaussian is normalized to 1.
Definition at line 690 of file gevd_float_operators.cxx.
bool gevd_float_operators::FindWavelet | ( | const int | waveletno, |
float *& | lo_filter, | ||
float *& | hi_filter, | ||
int & | ncof | ||
) | [static] |
Looks up and stores the wavelet pair in (lo_filter, hi_filter).
The wavelet number is 2 for Haar wavelet, 4-20 even numbers for Daubechies wavelet, and 9-15 odd numbers for symmetric Coifman wavelets.
Definition at line 2458 of file gevd_float_operators.cxx.
bool gevd_float_operators::FloatToBuffer | ( | const gevd_bufferxy & | floatfrom, |
gevd_bufferxy & | to | ||
) | [static] |
Definition at line 3925 of file gevd_float_operators.cxx.
float gevd_float_operators::Gaussian | ( | gevd_bufferxy & | from, |
gevd_bufferxy *& | to, | ||
const float | sigma = 1.0f , |
||
const bool | xwrap = false , |
||
const bool | ywrap = false |
||
) | [static] |
Convolves the from image with a 2D Gaussian filter with standard deviation sigma.
O(m*n*k). The 2D convolution is decomposed into 2 1D convolutions: Gxy * I = Gy * (Gx * I). The frame with width equal to the radius of the Gaussian kernel is filled with zero.
Definition at line 661 of file gevd_float_operators.cxx.
float gevd_float_operators::Gaussian | ( | const float | x, |
const float | sigma | ||
) | [static, protected] |
Definition at line 718 of file gevd_float_operators.cxx.
float gevd_float_operators::Gradient | ( | const gevd_bufferxy & | smooth, |
gevd_bufferxy *& | magnitude, | ||
gevd_bufferxy *& | gradx, | ||
gevd_bufferxy *& | grady, | ||
const bool | xwrap = false , |
||
const bool | ywrap = false |
||
) | [static] |
Compute the gradient of the intensity surface.
O(m*n). The intensity surface is assumed smoothed by a Gaussian filter, or convolved with a low-pass filter. Return at each pixel, the magnitude, the vector (dG * I), and the multiplication factor to normalize the magnitude. The product of detection |dG * I| and localization |dddG * I| of the step relative to noise is invariant to filter-size for the ideal step edge, and depends only on the shape of the step edge. As the filter size (sigma) increases by k, detection or signal-to-noise ratio increases by sqrt(k), but localization decreases by 1/sqrt(k). This invariance is consistent with the uncertainty principle.
Definition at line 807 of file gevd_float_operators.cxx.
float gevd_float_operators::Hessian | ( | const gevd_bufferxy & | smooth, |
gevd_bufferxy *& | magnitude, | ||
gevd_bufferxy *& | dirx, | ||
gevd_bufferxy *& | diry, | ||
const bool | xwrap = false , |
||
const bool | ywrap = false |
||
) | [static] |
Compute the Hessian of the intensity surface.
O(m*n). The Hessian is directional, and described by the largest absolute eigenvalue, and its corresponding eigenvector. The intensity surface is assumed smoothed by a Gaussian filter, or convolved with a low-pass filter. Return at each pixel, the largest absolute value of the two eigenvalues, the corresponding eigenvector, and the multiplication factor to normalize the magnitude.
Definition at line 956 of file gevd_float_operators.cxx.
float gevd_float_operators::InterpolateParabola | ( | float | y_1, |
float | y_0, | ||
float | y_2, | ||
float & | y | ||
) | [static] |
Fit a parabola through 3 points with strict local max/min.
Return the offset location, and value of the maximum/minimum.
Definition at line 1445 of file gevd_float_operators.cxx.
bool gevd_float_operators::IsSimilarBuffer | ( | const gevd_bufferxy & | buf1, |
const gevd_bufferxy & | buf2 | ||
) | [static] |
Two buffers are similar if they have the same dimensions, and precision (bits_per_pixel).
Definition at line 3559 of file gevd_float_operators.cxx.
float gevd_float_operators::Laplacian | ( | const gevd_bufferxy & | smooth, |
gevd_bufferxy *& | magnitude, | ||
gevd_bufferxy *& | dirx, | ||
gevd_bufferxy *& | diry, | ||
const bool | xwrap = false , |
||
const bool | ywrap = false |
||
) | [static] |
Compute the Laplacian of the intensity surface.
O(m*n). The Laplacian is rotational symmetric, and is the sum of the 2 eigenvalues/curvatures, with positive/negative sign for concave/convex. The intensity surface is assumed smoothed by a Gaussian filter, or convolved with a low-pass filter. Return at each pixel, the absolute value of the laplacian, the eigenvector corresponding to the largest absolute eigenvalue/curvature, and the multiplication factor to normalize the magnitude.
Definition at line 1069 of file gevd_float_operators.cxx.
void gevd_float_operators::LowHighPyramid | ( | float * | highPass, |
float * | lowPass, | ||
int | n, | ||
int | nlevels, | ||
const float * | lo_filter, | ||
const float * | hi_filter, | ||
int | ncof, | ||
float * | wksp | ||
) | [static] |
Find pyramid of low/high pass components, using wavelet transform.
Definition at line 2649 of file gevd_float_operators.cxx.
float gevd_float_operators::Maximum | ( | const gevd_bufferxy & | buf, |
int | sizeX = 0 , |
||
int | sizeY = 0 , |
||
int | origX = 0 , |
||
int | origY = 0 |
||
) | [static] |
Returns the maximum value in float buffer.
Definition at line 3673 of file gevd_float_operators.cxx.
bool gevd_float_operators::Maximum | ( | const float * | data, |
const int | length, | ||
int & | index, | ||
float & | value | ||
) | [static] |
Detect maximum in 1d-array of values.
Definition at line 3964 of file gevd_float_operators.cxx.
float gevd_float_operators::Minimum | ( | const gevd_bufferxy & | buf, |
int | sizeX = 0 , |
||
int | sizeY = 0 , |
||
int | origX = 0 , |
||
int | origY = 0 |
||
) | [static] |
Returns the minimum value in float buffer.
Definition at line 3693 of file gevd_float_operators.cxx.
void gevd_float_operators::Negate | ( | gevd_bufferxy & | buf | ) | [static] |
Negate all values.
Definition at line 3847 of file gevd_float_operators.cxx.
void gevd_float_operators::NonMaximumSuppression | ( | const gevd_bufferxy & | magnitude, |
const gevd_bufferxy & | directionx, | ||
const gevd_bufferxy & | directiony, | ||
const float | threshold, | ||
gevd_bufferxy *& | contour, | ||
gevd_bufferxy *& | direction, | ||
gevd_bufferxy *& | locationx, | ||
gevd_bufferxy *& | locationy, | ||
const bool | xwrap = false , |
||
const bool | ywrap = false |
||
) | [static] |
Detect contour pixels as strict local maxima, and interpolate the strength/location with a parabola through 3 points.
The location[xy]/direction[xy] buffers no longer share the same space to avoid bogus values when the contour/junction pixels move around by +/- 1 pixel.
Definition at line 1294 of file gevd_float_operators.cxx.
int gevd_float_operators::NonMaximumSuppression | ( | const float * | from, |
const int | len, | ||
const float | threshold, | ||
int *& | index, | ||
float *& | mag, | ||
float *& | locs, | ||
const bool | wrap = false |
||
) | [static] |
Detect local maxima in linear/circular array.
Definition at line 1393 of file gevd_float_operators.cxx.
void gevd_float_operators::Normalize | ( | gevd_bufferxy & | buf, |
const float | lo, | ||
const float | hi | ||
) | [static] |
Normalizes a float buffer so that the pixel values range from lo to hi, inclusive.
If the buffer has constant value, the value is mapped to lo. O(n*m).
Definition at line 3759 of file gevd_float_operators.cxx.
float gevd_float_operators::Orientation | ( | const gevd_bufferxy & | smooth, |
gevd_bufferxy *& | theta, | ||
gevd_bufferxy *& | coherence, | ||
const int | frame = 1 |
||
) | [static] |
Compute the local orientation at each pixel in the image, and returns 2 images: twice the angle, and coherence measure (0,1).
Definition at line 1179 of file gevd_float_operators.cxx.
gevd_bufferxy * gevd_float_operators::PadToPowerOf2 | ( | gevd_bufferxy & | buf | ) | [static] |
Pad the buffer by repeating values at the border, so that the new buffer has dimensions being powers of 2.
The original buffer is centered in the new buffer. Returns the buffer unchanged if it already has dimensions being powers of 2.
Definition at line 3996 of file gevd_float_operators.cxx.
void gevd_float_operators::ProjectOntoX | ( | const gevd_bufferxy & | buf, |
float *& | proj, | ||
int | sizeX = 0 , |
||
int | sizeY = 0 , |
||
int | origX = 0 , |
||
int | origY = 0 |
||
) | [static] |
Project the image data in ROI onto the x- and y- axes.
O(n*m). The 1d-array is returned with projections being the sum normalized by the number of elements projected.
Definition at line 3252 of file gevd_float_operators.cxx.
void gevd_float_operators::ProjectOntoY | ( | const gevd_bufferxy & | buf, |
float *& | proj, | ||
int | sizeX = 0 , |
||
int | sizeY = 0 , |
||
int | origX = 0 , |
||
int | origY = 0 |
||
) | [static] |
Definition at line 3271 of file gevd_float_operators.cxx.
void gevd_float_operators::ProjectWaveOntoX | ( | const gevd_bufferxy & | buf, |
float *& | proj, | ||
const int | nlevels = 0 |
||
) | [static] |
Project wavelet components onto the axes.
Definition at line 3214 of file gevd_float_operators.cxx.
void gevd_float_operators::ProjectWaveOntoY | ( | const gevd_bufferxy & | buf, |
float *& | proj, | ||
const int | nlevels = 0 |
||
) | [static] |
Definition at line 3230 of file gevd_float_operators.cxx.
int gevd_float_operators::Pyramid | ( | const float * | data, |
const int | length, | ||
float *& | pyramid, | ||
int & | nlevels, | ||
int | trim = 0 , |
||
const float | burt_ka = 0.359375f |
||
) | [static] |
Compute the pyramid by shrinking data sequence by 2, nlevels-1 times, and return final shrunk length, and reset number of levels in pyramid.
O(n) time. Coarse to fine is stored from left to right. The left and right trim borders are set to 0.
Definition at line 2239 of file gevd_float_operators.cxx.
bool gevd_float_operators::Read1dKernel | ( | const char * | filename, |
float *& | kernel, | ||
int & | radius, | ||
bool & | evenp | ||
) | [static] |
Read 1d odd/even kernel from a file: width k_i ....
Definition at line 622 of file gevd_float_operators.cxx.
gevd_bufferxy * gevd_float_operators::Read2dKernel | ( | const char * | filename | ) | [static] |
Read 2D kernel from a file: width height k_x_y ....
Definition at line 205 of file gevd_float_operators.cxx.
float gevd_float_operators::RunningSum | ( | float * | from, |
float *& | to, | ||
const int | len, | ||
const int | kradius, | ||
const bool | wrap = false |
||
) | [static] |
For large smoothing sigma, use running sum to avoid floating multiplications.
Special care is taken when to and from are identical - Peter Vanroose.
Definition at line 577 of file gevd_float_operators.cxx.
void gevd_float_operators::Scale | ( | gevd_bufferxy & | buf, |
float | factor | ||
) | [static] |
Scale all values by factor.
Definition at line 3822 of file gevd_float_operators.cxx.
int gevd_float_operators::SetupPipeline | ( | const float * | data, |
const int | len, | ||
const int | kradius, | ||
const bool | wrap, | ||
float *& | cache, | ||
float *& | pipeline | ||
) | [static, protected] |
Setup the cache for reflection/wrapping at the borders, and the center pipeline.
Only cache should be deleted after you're done, not the pipeline, since pipeline shares the same space.
Definition at line 731 of file gevd_float_operators.cxx.
void gevd_float_operators::ShiftToPositive | ( | gevd_bufferxy & | buf | ) | [static] |
Shift to positive values, by adding 30.0000, and truncate all values to 0-60.000.
O(n*m).
Definition at line 3784 of file gevd_float_operators.cxx.
float gevd_float_operators::ShrinkBy2 | ( | const gevd_bufferxy & | from, |
gevd_bufferxy *& | to, | ||
const float | burt_ka = 0.359375f |
||
) | [static] |
Shrinks the from image by 2 and stores into to image, using Burt-Adelson reduction algorithm.
Convolution with a 5-point kernel [(0.5-ka)/2, 0.25, ka, 0.25, (0.5-ka)/2] ka = 0.6 maximum decorrelation, wavelet for image compression. ka = 0.5 linear interpolation, ka = 0.4 Gaussian filter ka = 0.359375 min aliasing, wider than Gaussian The image indexes are mapped with: to.ij = from.ij / 2 The image sizes are related by: to.size = (from.size+1)/2.
Special care is taken when to and from are identical - Peter Vanroose.
Definition at line 1840 of file gevd_float_operators.cxx.
int gevd_float_operators::ShrinkBy2 | ( | const float * | from, |
const int | length, | ||
float *& | to, | ||
const float | burt_ka = 0.359375f |
||
) | [static] |
Definition at line 2269 of file gevd_float_operators.cxx.
void gevd_float_operators::ShrinkBy2_D | ( | const gevd_bufferxy & | from, |
gevd_bufferxy *& | to, | ||
float | no_value, | ||
float | burt_ka = 0.359375f |
||
) | [static] |
Shrinks the from image by 2 and stores into to image.
Same as ShrinkBy2 except that it properly handles pixels that have unusable value ("dropouts" --- hence the appended "_D" in the name). These are pixel values "no_value". One problem with this function is that one pixel wide structures may or may not be retained in the shrunken image, depending on the position of the structure. This should not be a problem for the initial application.
Special care is taken when to and from are identical - Peter Vanroose.
Definition at line 1961 of file gevd_float_operators.cxx.
float gevd_float_operators::ShrinkBy2AlongX | ( | const gevd_bufferxy & | from, |
const int | y, | ||
float * | yline, | ||
const int | sizeX, | ||
const float | ka, | ||
const float | kb, | ||
const float | kc | ||
) | [static, protected] |
Shrinks the yline by 2 along the x-axis.
We compute every 2 pixels, the convolution of the 5 pixels along x, with the 5-point kernel [kc, kb, ka, kb, kc].
Definition at line 1903 of file gevd_float_operators.cxx.
void gevd_float_operators::ShrinkBy2AlongX_D | ( | const gevd_bufferxy & | from, |
int | from_sizeX, | ||
int | sizeX, | ||
int | y, | ||
float | kernel[], | ||
float | no_value, | ||
float * | yline, | ||
float * | wline | ||
) | [static, protected] |
Create a smoothed and subsampled array of x values in the given row.
This will return the weighted (but unnormalized) values (in yline) and the weights (wline).
Definition at line 2099 of file gevd_float_operators.cxx.
gevd_bufferxy * gevd_float_operators::SimilarBuffer | ( | const gevd_bufferxy & | buffer, |
int | bits_per_pixel = 0 , |
||
int | sizeX = 0 , |
||
int | sizeY = 0 |
||
) | [static] |
Creates a new buffer similar to buf, unless dimension and precision are given.
Definition at line 3542 of file gevd_float_operators.cxx.
float gevd_float_operators::Slope | ( | float * | from, |
float *& | to, | ||
const int | len, | ||
const bool | wrap = false |
||
) | [static] |
Compute slope or first-difference, in linear/circular array.
Special care is taken when to and from are identical - Peter Vanroose.
Definition at line 883 of file gevd_float_operators.cxx.
float gevd_float_operators::Sum | ( | const gevd_bufferxy & | buf, |
int | sizeX = 0 , |
||
int | sizeY = 0 , |
||
int | origX = 0 , |
||
int | origY = 0 |
||
) | [static] |
Returns the sum of all values in float buffer.
Definition at line 3713 of file gevd_float_operators.cxx.
void gevd_float_operators::SupportAngle | ( | const gevd_bufferxy & | dirx, |
const gevd_bufferxy & | diry, | ||
const gevd_bufferxy & | magnitude, | ||
gevd_bufferxy *& | angle | ||
) | [static] |
Find angle of the line of support, in degrees.
Definition at line 1477 of file gevd_float_operators.cxx.
void gevd_float_operators::SurfaceCurvature | ( | const gevd_bufferxy & | normal, |
gevd_bufferxy *& | curvature | ||
) | [static] |
Find local gaussian curvature at all pixels from the local surface normals, previously computed from the range z(x,y) image.
The gaussian curvature is estimated as the root mean square of the two curvatures along the x- and y- axes.
Definition at line 1527 of file gevd_float_operators.cxx.
void gevd_float_operators::SurfaceCurvatureD | ( | const gevd_bufferxy & | normal, |
const gevd_bufferxy & | surface, | ||
gevd_bufferxy *& | curvature, | ||
float | dflt, | ||
float | pixel_distance = 1.0f |
||
) | [static] |
Estimate the maximum curvature at all pixels from the local surface normals, previously computed from the range z(x,y) image.
This is similar to SurfaceCurvature above with two exceptions. First, it explicitly recognizes image locations where no normal has been calculated. Second, it normalizes the curvature by the pixel_distance, converting the curvature to a real-world quantity rather than a pixel quantity.
Definition at line 1758 of file gevd_float_operators.cxx.
void gevd_float_operators::SurfaceNormal | ( | const gevd_bufferxy & | range, |
gevd_bufferxy *& | normal | ||
) | [static] |
Find local surface normal at all pixels in the range z(x,y) image.
The normal is estimated from the cross-product of the two tangent vectors along the x- and y- axes.
Definition at line 1500 of file gevd_float_operators.cxx.
void gevd_float_operators::SurfaceNormalD | ( | const gevd_bufferxy & | range, |
gevd_bufferxy *& | normal, | ||
float | no_value, | ||
float | pixel_distance = 1.0f |
||
) | [static] |
Same as gevd_float_operators::SurfaceNormal with two exceptions.
First, it explicitly recognizes and avoids pixels that have no range value. These are often called "dropouts", hence the "D" at the end of the function name. Second, it uses an optional "pixel_distance" value to put the inter-pixel distances in the same coordinate system as the range values.
Definition at line 1616 of file gevd_float_operators.cxx.
void gevd_float_operators::TestWavelets | ( | ) | [static, protected] |
Definition at line 2962 of file gevd_float_operators.cxx.
int gevd_float_operators::Threshold | ( | gevd_bufferxy & | buf, |
float | noise, | ||
int | sizeX = 0 , |
||
int | sizeY = 0 , |
||
int | origX = 0 , |
||
int | origY = 0 |
||
) | [static] |
Truncate all values in ROI to 0, if below noise.
Return the number of pixels changed.
Definition at line 3732 of file gevd_float_operators.cxx.
gevd_bufferxy * gevd_float_operators::TransposeExtract | ( | const gevd_bufferxy & | buf, |
int | sizeX, | ||
int | sizeY, | ||
int | origX, | ||
int | origY | ||
) | [static] |
Definition at line 4088 of file gevd_float_operators.cxx.
void gevd_float_operators::TransposeUpdate | ( | gevd_bufferxy & | buf, |
const gevd_bufferxy & | sub, | ||
int | origX, | ||
int | origY | ||
) | [static] |
Definition at line 4099 of file gevd_float_operators.cxx.
int gevd_float_operators::TruncateHighFrequencies | ( | gevd_bufferxy & | wave, |
const int | nlevels, | ||
const float | threshold = 0.1f |
||
) | [static] |
Truncate to 0, all wavelet components with high frequency along either x- or y- axes only, not both.
The relative magnitude of the components must be smaller than the given threshold. This will simulate reduced accuracy in presence of transmission errors. Return the number of coefficients deleted.
Definition at line 3108 of file gevd_float_operators.cxx.
int gevd_float_operators::TruncateLowestFrequency | ( | gevd_bufferxy & | wave, |
const int | nlevels | ||
) | [static] |
Truncate to average value, the lowest frequency component.
This will simulate throwing away the lowest frequencies in image. Return the number of coefficients deleted.
Definition at line 3139 of file gevd_float_operators.cxx.
float gevd_float_operators::TruncateToCeiling | ( | gevd_bufferxy & | buf, |
float | ceil | ||
) | [static] |
Definition at line 3857 of file gevd_float_operators.cxx.
float gevd_float_operators::TruncateToPositive | ( | gevd_bufferxy & | buf | ) | [static] |
Zeros out all negative values.
Definition at line 3803 of file gevd_float_operators.cxx.
gevd_bufferxy * gevd_float_operators::UnpadFromPowerOf2 | ( | gevd_bufferxy & | padded, |
int | sizeX, | ||
int | sizeY | ||
) | [static] |
Inverse of the above operation.
Definition at line 4074 of file gevd_float_operators.cxx.
void gevd_float_operators::Update | ( | gevd_bufferxy & | buf, |
const gevd_bufferxy & | sub, | ||
int | origX = 0 , |
||
int | origY = 0 |
||
) | [static] |
Update a float sub-buffer of buf, from top-left corner (origX, origY), with values in sub.
Faster copying can be done with read/write chunks of memory.
Definition at line 3592 of file gevd_float_operators.cxx.
bool gevd_float_operators::WaveletTransform | ( | float * | array, |
const int | n, | ||
const bool | forwardp, | ||
int | nlevels, | ||
const int | waveletno = 4 |
||
) | [static] |
Compute the forward/inverse wavelet transform of a 1d array of data.
Convolution with low (resp. high) filter is stored on the side of low (resp. high) indices.
Definition at line 2600 of file gevd_float_operators.cxx.
bool gevd_float_operators::WaveletTransformByBlock | ( | float * | array, |
const int * | dims, | ||
const int | ndim, | ||
const bool | forwardp, | ||
int | nlevels, | ||
const int | waveletno = 4 |
||
) | [static] |
n-dimensional wavelet transform of an n-dimensional array.
Convolution with low (resp. high) filter is stored on the side of low (resp. high) indices. Assumes data are stored consecutively with right-most index varying fastest, consistent with convention in C m(i,j) = m[i][j]. This version decomposes only the n-dimensional sub-block of low frequency convolutions. The wavelet are self-similar in n-dimensional space, rather than elongated.
Definition at line 2863 of file gevd_float_operators.cxx.
bool gevd_float_operators::WaveletTransformByBlock | ( | const gevd_bufferxy & | from, |
gevd_bufferxy *& | to, | ||
const bool | forwardp, | ||
int | nlevels, | ||
const int | waveletno = 4 |
||
) | [static] |
Compute the Fast Wavelet Transform of the image.
Higher number wavelets are less compact, but give more accurate decomposition of the image into linear combinations of mother wavelets. Image compression uses mother wavelets around 12, while image segmentation uses compact wavelets around 2 or 4.
Definition at line 3056 of file gevd_float_operators.cxx.
bool gevd_float_operators::WaveletTransformByIndex | ( | float * | array, |
const int * | dims, | ||
const int | ndim, | ||
const bool | forwardp, | ||
int | nlevels, | ||
const int | waveletno = 4 |
||
) | [static] |
n-dimensional wavelet transform of an n-dimensional array.
Convolution with low (resp. high) filter is stored on the side of low (resp. high) indices. Assumes data are stored consecutively with right-most index varying fastest, consistent with convention in C m(i,j) = m[i][j]. This version does a 1d-FWT recursively on each dimension, rather than an nd-FWT on each recursive nd sub-block that are convolved with lo-filters.
Definition at line 2691 of file gevd_float_operators.cxx.
bool gevd_float_operators::WaveletTransformByIndex | ( | const gevd_bufferxy & | from, |
gevd_bufferxy *& | to, | ||
const bool | forwardp, | ||
int | nlevels, | ||
const int | waveletno = 4 |
||
) | [static] |
Compute the Fast Wavelet Transform of the 2d array.
Higher number wavelets are less compact, but give more accurate decomposition of the image into linear combinations of mother wavelets.
Definition at line 3029 of file gevd_float_operators.cxx.
void gevd_float_operators::WaveletTransformStep | ( | float * | array, |
const int | n, | ||
const bool | forwardp, | ||
const float * | lo_filter, | ||
const float * | hi_filter, | ||
const int | ncof, | ||
float * | wksp | ||
) | [static, protected] |
Convolution with wavelets (lo_filter, hi_filter) and gather results into consecutive blocks, with convolution of lo_filter (resp.
hi_filter) on the sides of low (resp. high) indices. Wrap around edges of the array is done with modulo(n) replaced by bit masking with n-1, when n is a power of 2. Assumes n >= 4.
Definition at line 2552 of file gevd_float_operators.cxx.
void gevd_float_operators::WaveletTransformStep | ( | float * | array, |
const int * | dims, | ||
const int | ndim, | ||
const bool | forwardp, | ||
const float * | lo_filter, | ||
const float * | hi_filter, | ||
const int | ncof, | ||
float * | buffer, | ||
float * | wksp | ||
) | [static, protected] |
Definition at line 2776 of file gevd_float_operators.cxx.
gevd_bufferxy * gevd_float_operators::WrapAlongX | ( | const gevd_bufferxy & | img | ) | [static, protected] |
Create a buffer that wraps rows/columns.
Definition at line 755 of file gevd_float_operators.cxx.
gevd_bufferxy * gevd_float_operators::WrapAlongY | ( | const gevd_bufferxy & | img | ) | [static, protected] |
Definition at line 769 of file gevd_float_operators.cxx.