stromx  0.8.0
Public Member Functions | Static Public Member Functions | Friends | List of all members
stromx::cvsupport::Matrix Class Reference

Matrix implementation based on OpenCV matrices. More...

#include <Matrix.h>

Inheritance diagram for stromx::cvsupport::Matrix:
stromx::runtime::MatrixWrapper stromx::runtime::Matrix stromx::runtime::Data stromx::runtime::DataInterface

Public Member Functions

 Matrix ()
 
 Matrix (const stromx::cvsupport::Matrix &matrix)
 
 Matrix (const unsigned int rows, const unsigned int cols, const ValueType valueType)
 
 Matrix (cv::Mat &cvMatrix)
 
 Matrix (const cv::MatExpr &cvMatExpr)
 
 Matrix (const stromx::runtime::Matrix &matrix)
 
 Matrix (const cv::Rect &cvRect)
 
 Matrix (const cv::RotatedRect &cvRotatedRect)
 
 Matrix (const unsigned int size)
 
 Matrix (const std::string &filename)
 
virtual const runtime::Versionversion () const
 
virtual const std::string & type () const
 
virtual const std::string & package () const
 
virtual Dataclone () const
 
const Matrixoperator= (const runtime::Matrix &matrix)
 
- Public Member Functions inherited from stromx::runtime::MatrixWrapper
 MatrixWrapper (const unsigned int bufferSize, uint8_t *const buffer)
 
 MatrixWrapper ()
 
virtual const VariantHandlevariant () const
 
virtual uint8_t * buffer ()
 
virtual unsigned int bufferSize () const
 
virtual unsigned int rows () const
 
virtual unsigned int cols () const
 
virtual unsigned int stride () const
 
virtual ValueType valueType () const
 
virtual uint8_t * data ()
 
virtual const uint8_t * data () const
 
virtual void initializeMatrix (const unsigned int rows, const unsigned int cols, const unsigned int stride, uint8_t *data, const ValueType valueType)
 
virtual void serialize (OutputProvider &output) const
 
virtual void deserialize (InputProvider &input, const Version &version)
 
void resize (const unsigned int rows, const unsigned int cols, const ValueType valueType)
 
void resize (const unsigned int size)
 
void open (const std::string &filename)
 
void save (const std::string &filename) const
 
- Public Member Functions inherited from stromx::runtime::Matrix
virtual unsigned int valueSize () const
 
template<class T >
T & at (const unsigned row, const unsigned col)
 
template<class T >
const T & at (const unsigned int row, const unsigned col) const
 
template<class T >
const T value (const unsigned int row, const unsigned int col) const
 
- Public Member Functions inherited from stromx::runtime::DataInterface
bool isVariant (const VariantInterface &v) const
 

Static Public Member Functions

static cvsupport::Matrix eye (const unsigned int rows, const unsigned int cols, const ValueType valueType)
 
static cvsupport::Matrix zeros (const unsigned int rows, const unsigned int cols, const ValueType valueType)
 
- Static Public Member Functions inherited from stromx::runtime::MatrixWrapper
static void save (const std::string &filename, const runtime::Matrix &matrix)
 
- Static Public Member Functions inherited from stromx::runtime::Matrix
static unsigned int valueSize (const ValueType valueType)
 

Friends

STROMX_CVSUPPORT_API cv::Mat getOpenCvMat (const runtime::Matrix &matrix, const unsigned int numChannels)
 

Additional Inherited Members

- Public Types inherited from stromx::runtime::Matrix
enum  ValueType {
  NONE, INT_8, UINT_8, INT_16,
  UINT_16, INT_32, UINT_32, FLOAT_32,
  FLOAT_64
}
 
- Protected Member Functions inherited from stromx::runtime::MatrixWrapper
void setBuffer (uint8_t *const buffer, const unsigned int bufferSize)
 
- Static Protected Member Functions inherited from stromx::runtime::Matrix
static const runtime::VariantHandle dataVariantFromValueType (const ValueType valueType)
 

Detailed Description

Matrix implementation based on OpenCV matrices.

Constructor & Destructor Documentation

§ Matrix() [1/10]

stromx::cvsupport::Matrix::Matrix ( )

Constructs an empty matrix with zero rows and columns and value type Matrix::NONE. No data is associated with the matrix, i.e. its data and buffer pointers are 0.

§ Matrix() [2/10]

stromx::cvsupport::Matrix::Matrix ( const stromx::cvsupport::Matrix matrix)

Copy constructs a matrix from matrix.

§ Matrix() [3/10]

stromx::cvsupport::Matrix::Matrix ( const unsigned int  rows,
const unsigned int  cols,
const ValueType  valueType 
)
explicit

Constructs a matrix for the given parameters.

§ Matrix() [4/10]

stromx::cvsupport::Matrix::Matrix ( cv::Mat &  cvMatrix)
explicit

Constructs a matrix from cvMatrix. The data of the input matrix is not copied only a lightweight wrapper is allocated which references cvMatrix.

§ Matrix() [5/10]

stromx::cvsupport::Matrix::Matrix ( const cv::MatExpr &  cvMatExpr)
explicit

Constructs a matrix from cvMatExpr. The data of the input matrix is copied to this matrix.

§ Matrix() [6/10]

stromx::cvsupport::Matrix::Matrix ( const stromx::runtime::Matrix matrix)
explicit

Copy constructs a matrix from matrix.

§ Matrix() [7/10]

stromx::cvsupport::Matrix::Matrix ( const cv::Rect cvRect)
explicit

Allocates a 1 x 4 matrix with 32-bit integer values and copies the (x, y, width, height) values from cvRect to it.

§ Matrix() [8/10]

stromx::cvsupport::Matrix::Matrix ( const cv::RotatedRect &  cvRotatedRect)
explicit

Allocates a 1 x 5 matrix with 32-bit float values and copies the (centerX, centerY, width, height, angle) of cvRotatedRect to it.

§ Matrix() [9/10]

stromx::cvsupport::Matrix::Matrix ( const unsigned int  size)
explicit

Allocates a matrix with a buffer of a given size in bytes. The matrix has 1 row and size columns. Its value type is Image::NONE. The buffer size of the image is guaranteed to be at least size.

§ Matrix() [10/10]

stromx::cvsupport::Matrix::Matrix ( const std::string &  filename)
explicit

Allocates a matrix and reads its content from the file filename.

Member Function Documentation

§ clone()

runtime::Data * stromx::cvsupport::Matrix::clone ( ) const
virtual

Returns a copy of the data object, i.e. a object of the same type is allocated and the data of the original object is copied to the new object. A pointer to the new object is returned.

Implements stromx::runtime::DataInterface.

§ eye()

cvsupport::Matrix stromx::cvsupport::Matrix::eye ( const unsigned int  rows,
const unsigned int  cols,
const ValueType  valueType 
)
static

Returns the identity matrix (or a submatrix of a larger identity matrix) with the given number of rows and cols and with values of type of valueType.

§ operator=()

const Matrix & stromx::cvsupport::Matrix::operator= ( const runtime::Matrix matrix)

Copies the the matrix on the right hand side.

§ package()

virtual const std::string& stromx::cvsupport::Matrix::package ( ) const
inlinevirtual

Returns the package of the class of this data object.

Implements stromx::runtime::DataInterface.

§ type()

virtual const std::string& stromx::cvsupport::Matrix::type ( ) const
inlinevirtual

Returns the name of the class of this data object.

Implements stromx::runtime::DataInterface.

§ version()

virtual const runtime::Version& stromx::cvsupport::Matrix::version ( ) const
inlinevirtual

Returns the version of the class of this data object.

Implements stromx::runtime::DataInterface.

§ zeros()

cvsupport::Matrix stromx::cvsupport::Matrix::zeros ( const unsigned int  rows,
const unsigned int  cols,
const ValueType  valueType 
)
static

Returns the zero matrix with the given number of rows and cols and with values of type of valueType.

Friends And Related Function Documentation

§ getOpenCvMat

STROMX_CVSUPPORT_API cv::Mat getOpenCvMat ( const runtime::Matrix matrix,
const unsigned int  numChannels 
)
friend

Returns an OpenCV matrix header for matrix.


The documentation for this class was generated from the following files: