All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions | Static Public Member Functions | Protected Attributes
motld::Matrix Class Reference

datastructure for images (greyscale or single color) More...

#include <Matrix.h>

List of all members.

Public Member Functions

Matrix affineWarp (const Matrix &t, const ObjectBox &b, const bool &preservear) const
 Performs an affine warping of an image section.
float avg () const
 Returns the average value.
void clip (float aMin, float aMax)
 Clips values that exceed the given range.
void copyFromCharArray (unsigned char *source)
 fills the matrix from a char-array (size has to be already set)
void copyFromFloatArray (float *source, int srcwidth, int width, int height)
 fills the matrix from a float-array (for a given size)
void copyFromFloatArray (const float *const source, int srcwidth, int srcheight, int x, int y, int width, int height)
 fills the matrix from a sub-part of a float-array
floatcreateSummedAreaTable () const
 Creates an Integral Image.
float ** createSummedAreaTable2 () const
 Creates an Integral Image and an Integral Image of squared values.
void cut (Matrix &result, const int x1, const int y1, const int x2, const int y2)
 Copies a rectangular part from the matrix into result, the size of result will be adjusted.
floatdata () const
 Gives access to the internal data representation.
void derivativeX (Matrix &result) const
 Computes derivative in x direction (result will be in result)
void derivativeY (Matrix &result) const
 Computes derivative in y direction (result will be in result)
void downsample (int newWidth, int newHeight)
 Downsamples the matrix.
void downsampleBilinear (int newWidth, int newHeight)
 Downsamples the matrix using bilinear interpolation.
void drawBox (ObjectBox b, int value=255)
 Draws an ObjectBox into the image.
void drawCross (int x, int y, int value=255, int crossSize=1)
 Draws a Cross.
void drawDashedBox (ObjectBox b, int value=255, int dashLength=3, bool dotted=false)
 Draws a dashed ObjectBox into the image.
void drawHistogram (const float *histogram, int x, int y, int value=255, int nbins=7, int psize=15)
 Draws a histogram at position (x,y)
void drawLine (int x1, int y1, int x2, int y2, float value=255)
 Draws a line into the image.
void drawNumber (int x, int y, int n, int value=255)
 Prints a number at position (x,y)
void drawPatch (const Matrix &b, int x, int y, float avg=0)
 Draws a NN-Patch at position (x,y)
void fill (const float value)
 Fills the matrix with the value value (see also operator =)
void fromRGB (const Matrix &rMatrix, const Matrix &gMatrix, const Matrix &bMatrix)
 Creates a grayscale matrix out of r, g, and b matrices.
void fromRGB (unsigned char *source)
 Creates a grayscale matrix out of an array [r0, r1, ..., g0, g1, ..., b0, b1, ...].
void gaussianSmooth (const float sigma, const int filterSize=0)
 Applies a Gaussian filter.
Matrix getRectSubPix (float centerx, float centery, int width, int height) const
 Returns a patch around the central point using bilinear interpolation.
void halfSizeImage (Matrix &result) const
 Downsamples image to half of its size (result will be in result)
void inv3 ()
 Inverts a 3x3 matrix.
 Matrix ()
 Default constructor.
 Matrix (const int width, const int height)
 Constructor.
 Matrix (const Matrix &copyFrom)
 Copy constructor.
 Matrix (const int width, const int height, const float value)
 Constructor with implicit filling.
float norm2 () const
 Returns the squared norm (i.e. sum of squared values)
floatoperator() (const int ax, const int ay) const
 Gives full access to matrix values.
Matrixoperator*= (const float value)
 Multiplication with a scalar.
Matrixoperator+= (const float value)
 Adds a constant to the matrix.
Matrixoperator= (const float value)
 Fills the matrix with the value value (equivalent to fill())
Matrixoperator= (const Matrix &copyFrom)
 Copies the matrix copyFrom to this matrix (size of matrix might change)
void rescale (int newWidth, int newHeight)
 Scales the matrix (includes upsampling and downsampling)
void scharrDerivativeX (Matrix &result) const
 Applies 3x3 Scharr filter in x direction (result will be in result)
void scharrDerivativeY (Matrix &result) const
 Applies 3x3 Scharr filter in y direction (result will be in result)
void setSize (int width, int height)
 Changes the size of the matrix, data will be lost.
int size () const
 Returns the size (width*height) of the matrix.
void sobelDerivativeX (Matrix &result) const
 Applies 3x3 Sobel filter in x direction (result will be in result)
void sobelDerivativeY (Matrix &result) const
 Applies 3x3 Sobel filter in y direction (result will be in result)
void upsample (int newWidth, int newHeight)
 Upsamples the matrix.
void upsampleBilinear (int newWidth, int newHeight)
 Upsamples the matrix using bilinear interpolation.
void writeToPGM (const char *filename) const
 Saves the matrix as a picture in pgm-Format.
int xSize () const
 Returns the width of the matrix.
int ySize () const
 Returns the height of the matrix.
virtual ~Matrix ()
 Destructor.

Static Public Member Functions

static Matrix createWarpMatrix (const float &angle, const float &scale)
 Creates a warp matrix for scaling / roatating.

Protected Attributes

floativData
int ivHeight
int ivWidth

Detailed Description

datastructure for images (greyscale or single color)

Definition at line 76 of file Matrix.h.


Constructor & Destructor Documentation

motld::Matrix::Matrix ( ) [inline]

Default constructor.

Definition at line 209 of file Matrix.h.

motld::Matrix::Matrix ( const int  width,
const int  height 
) [inline]

Constructor.

Definition at line 217 of file Matrix.h.

Copy constructor.

Definition at line 223 of file Matrix.h.

motld::Matrix::Matrix ( const int  width,
const int  height,
const float  value 
)

Constructor with implicit filling.

Definition at line 236 of file Matrix.h.

motld::Matrix::~Matrix ( ) [virtual]

Destructor.

Definition at line 243 of file Matrix.h.


Member Function Documentation

Matrix motld::Matrix::affineWarp ( const Matrix t,
const ObjectBox b,
const bool preservear 
) const [inline]

Performs an affine warping of an image section.

Definition at line 1276 of file Matrix.h.

Returns the average value.

Definition at line 1110 of file Matrix.h.

void motld::Matrix::clip ( float  aMin,
float  aMax 
)

Clips values that exceed the given range.

Definition at line 823 of file Matrix.h.

void motld::Matrix::copyFromCharArray ( unsigned char *  source)

fills the matrix from a char-array (size has to be already set)

Definition at line 248 of file Matrix.h.

void motld::Matrix::copyFromFloatArray ( float source,
int  srcwidth,
int  width,
int  height 
)

fills the matrix from a float-array (for a given size)

Definition at line 268 of file Matrix.h.

void motld::Matrix::copyFromFloatArray ( const float *const  source,
int  srcwidth,
int  srcheight,
int  x,
int  y,
int  width,
int  height 
)

fills the matrix from a sub-part of a float-array

Definition at line 257 of file Matrix.h.

Creates an Integral Image.

Definition at line 1181 of file Matrix.h.

Creates an Integral Image and an Integral Image of squared values.

Definition at line 1206 of file Matrix.h.

Matrix motld::Matrix::createWarpMatrix ( const float angle,
const float scale 
) [inline, static]

Creates a warp matrix for scaling / roatating.

Definition at line 1317 of file Matrix.h.

void motld::Matrix::cut ( Matrix result,
const int  x1,
const int  y1,
const int  x2,
const int  y2 
)

Copies a rectangular part from the matrix into result, the size of result will be adjusted.

Definition at line 812 of file Matrix.h.

float * motld::Matrix::data ( ) const [inline]

Gives access to the internal data representation.

Definition at line 1140 of file Matrix.h.

void motld::Matrix::derivativeX ( Matrix result) const

Computes derivative in x direction (result will be in result)

Definition at line 300 of file Matrix.h.

void motld::Matrix::derivativeY ( Matrix result) const

Computes derivative in y direction (result will be in result)

Definition at line 312 of file Matrix.h.

void motld::Matrix::downsample ( int  newWidth,
int  newHeight 
)

Downsamples the matrix.

Definition at line 535 of file Matrix.h.

void motld::Matrix::downsampleBilinear ( int  newWidth,
int  newHeight 
)

Downsamples the matrix using bilinear interpolation.

Definition at line 630 of file Matrix.h.

void motld::Matrix::drawBox ( ObjectBox  b,
int  value = 255 
)

Draws an ObjectBox into the image.

Definition at line 952 of file Matrix.h.

void motld::Matrix::drawCross ( int  x,
int  y,
int  value = 255,
int  crossSize = 1 
)

Draws a Cross.

Definition at line 941 of file Matrix.h.

void motld::Matrix::drawDashedBox ( ObjectBox  b,
int  value = 255,
int  dashLength = 3,
bool  dotted = false 
)

Draws a dashed ObjectBox into the image.

Definition at line 976 of file Matrix.h.

void motld::Matrix::drawHistogram ( const float histogram,
int  x,
int  y,
int  value = 255,
int  nbins = 7,
int  psize = 15 
)

Draws a histogram at position (x,y)

Definition at line 1009 of file Matrix.h.

void motld::Matrix::drawLine ( int  x1,
int  y1,
int  x2,
int  y2,
float  value = 255 
)

Draws a line into the image.

Definition at line 863 of file Matrix.h.

void motld::Matrix::drawNumber ( int  x,
int  y,
int  n,
int  value = 255 
)

Prints a number at position (x,y)

Definition at line 1023 of file Matrix.h.

void motld::Matrix::drawPatch ( const Matrix b,
int  x,
int  y,
float  avg = 0 
)

Draws a NN-Patch at position (x,y)

Definition at line 1002 of file Matrix.h.

void motld::Matrix::fill ( const float  value)

Fills the matrix with the value value (see also operator =)

Definition at line 805 of file Matrix.h.

void motld::Matrix::fromRGB ( const Matrix rMatrix,
const Matrix gMatrix,
const Matrix bMatrix 
)

Creates a grayscale matrix out of r, g, and b matrices.

Definition at line 277 of file Matrix.h.

void motld::Matrix::fromRGB ( unsigned char *  source)

Creates a grayscale matrix out of an array [r0, r1, ..., g0, g1, ..., b0, b1, ...].

Definition at line 289 of file Matrix.h.

void motld::Matrix::gaussianSmooth ( const float  sigma,
const int  filterSize = 0 
)

Applies a Gaussian filter.

Definition at line 393 of file Matrix.h.

Matrix motld::Matrix::getRectSubPix ( float  centerx,
float  centery,
int  width,
int  height 
) const

Returns a patch around the central point using bilinear interpolation.

Definition at line 477 of file Matrix.h.

void motld::Matrix::halfSizeImage ( Matrix result) const

Downsamples image to half of its size (result will be in result)

Applies the filter [1/4 1/2 1/4]^2

Definition at line 437 of file Matrix.h.

Inverts a 3x3 matrix.

Definition at line 833 of file Matrix.h.

Returns the squared norm (i.e. sum of squared values)

Definition at line 1119 of file Matrix.h.

float & motld::Matrix::operator() ( const int  ax,
const int  ay 
) const [inline]

Gives full access to matrix values.

Definition at line 1059 of file Matrix.h.

Matrix & motld::Matrix::operator*= ( const float  value)

Multiplication with a scalar.

Definition at line 1102 of file Matrix.h.

Matrix & motld::Matrix::operator+= ( const float  value)

Adds a constant to the matrix.

Definition at line 1094 of file Matrix.h.

Matrix & motld::Matrix::operator= ( const float  value) [inline]

Fills the matrix with the value value (equivalent to fill())

Definition at line 1070 of file Matrix.h.

Matrix & motld::Matrix::operator= ( const Matrix copyFrom)

Copies the matrix copyFrom to this matrix (size of matrix might change)

Definition at line 1076 of file Matrix.h.

void motld::Matrix::rescale ( int  newWidth,
int  newHeight 
)

Scales the matrix (includes upsampling and downsampling)

Definition at line 785 of file Matrix.h.

void motld::Matrix::scharrDerivativeX ( Matrix result) const

Applies 3x3 Scharr filter in x direction (result will be in result)

Applied filter: [-3,0,3; -10,0,10; -3,0,3] = [-1,0,1] x [3;10;3]

Definition at line 326 of file Matrix.h.

void motld::Matrix::scharrDerivativeY ( Matrix result) const

Applies 3x3 Scharr filter in y direction (result will be in result)

See also:
scharrDerivativeX()

Definition at line 345 of file Matrix.h.

void motld::Matrix::setSize ( int  width,
int  height 
)

Changes the size of the matrix, data will be lost.

Definition at line 524 of file Matrix.h.

int motld::Matrix::size ( ) const [inline]

Returns the size (width*height) of the matrix.

Definition at line 1136 of file Matrix.h.

void motld::Matrix::sobelDerivativeX ( Matrix result) const

Applies 3x3 Sobel filter in x direction (result will be in result)

Applied filter: [-1,0,1; -2,0,2; -1,0,1] = [-1,0,1] x [1;2;1]

Definition at line 361 of file Matrix.h.

void motld::Matrix::sobelDerivativeY ( Matrix result) const

Applies 3x3 Sobel filter in y direction (result will be in result)

See also:
sobelDerivativeX()

Definition at line 378 of file Matrix.h.

void motld::Matrix::upsample ( int  newWidth,
int  newHeight 
)

Upsamples the matrix.

Definition at line 662 of file Matrix.h.

void motld::Matrix::upsampleBilinear ( int  newWidth,
int  newHeight 
)

Upsamples the matrix using bilinear interpolation.

Definition at line 753 of file Matrix.h.

void motld::Matrix::writeToPGM ( const char *  filename) const

Saves the matrix as a picture in pgm-Format.

Definition at line 461 of file Matrix.h.

int motld::Matrix::xSize ( ) const [inline]

Returns the width of the matrix.

Definition at line 1128 of file Matrix.h.

int motld::Matrix::ySize ( ) const [inline]

Returns the height of the matrix.

Definition at line 1132 of file Matrix.h.


Member Data Documentation

Definition at line 193 of file Matrix.h.

int motld::Matrix::ivHeight [protected]

Definition at line 192 of file Matrix.h.

int motld::Matrix::ivWidth [protected]

Definition at line 192 of file Matrix.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


motld
Author(s): Jost Tobias Springenberg, Jan Wuelfing
autogenerated on Wed Dec 26 2012 16:24:49