8.8.3.5.4.5.1. DataObject - Reference#
-
class DataObject#
dataObject contains a n-dimensional matrix
The n-dimensional matrix can have different element types. Recently the following types are supported: int8, uint8, int16, uint16, int32, uint32, float32, float64 (=> double), complex64 (2x float32), complex128 (2x float64)
In order to handle huge matrices, the data object can divide one matrix into subparts in memory. Each subpart (called matrix-plane) is two-dimensional and covers data of the last two dimensions. Each of these matrix-planes is of type cv::Mat_<type> and can be used with every operator given by the openCV-framework (version 2.3.1 or higher).
We assume to have a n-dimensional matrix A, where each dimension has its size s_i, hence A=[s_1, s_2, …, s_(n-2), s_(n-1), s_n]
Hence, in total there are s_1 * s_2 * … * s_(n-2) different matrix-planes, which are all accessible by the member m_data, which is a std::vector of the general type int*. This type has to be casted to the specific cv::Mat_<…> when one matrix-plane has to be accessed. Sometimes it is also possible to simply cast to cv::Mat.
In order to make the data object compatible to continuously organized data structures, like numpy-arrays, it is also possible to have all matrix-planes in one data-block in memory. Then the continuous-flag will be set and the whole data block can be accessed by taking the pointer given by m_data[0]. Nevertheless, the indicated data structure with the two-dimensional sub-matrix-planes is still existing, hence, the pointer to each matrix-planes points to the entry point of its matrix-planes lying within the huge data block.
The data organization is equal to the one of open-cv, hence, two-dimensional matrices are stored row-by-row (C-style)…
The real size of each dimension is stored in the vector m_osize. Since it is possible to set a n-dimensional region of interest (ROI) to each matrix, the virtual dimensions, which will be delivered if the user asks for the matrix size, are stored in the member vector m_size.
8.8.3.5.4.5.1. #
8.8.3.5.4.5.1. Concept to handle templated and non-templated methods#
According to openCV, the class dataObject is not templated, because there are some structures in the entire itom-framework which does not support any templating concept, like the plugin-handling or communication with external dll-functions. Additionally the signal-slot-design of the Qt-framework does not accept templated parameters beside some standard-objects. Therefore the element-data-type is set by the integer-member m_type. The transformation between the real data type and the integer number is coded several times within the whole framework and can be accessed by the enumeration tDataType in typeDefs.h. Since templating has got many advantages concerning low-level calculation, we adapted the transformation-process which is used by openCV:
define a templated helper-method in the following form:
template<typename _Tp> returnType ‘MethodName’Func(Parameters1)
define the following two lines of code: typedef returnType (*t’MethodName’Func)(Parameters1); MAKEFUNCLIST(‘MethodName’Func);
define the method, accessed for example as public-method of dataObject RetVal DataObject::’PublicMethodName’(Parameters2) { … fList’MethodName’Func[getType()](Parameters1); … return … }
By the macro MAKEFUNCLIST a list fList’MethodName’Func is generated with each entry being a function pointer to the specific templated version of ‘MethodName’Func. The specific method is accessed by using getType() of dataObject. Hence it is important to keep the element-data-types and their order consistent for the whole itom-project.
Public Functions
-
DataObject(void)#
constructor for empty data object
no data will be allocated, the number of elements and dimensions is set to zero
-
DataObject(const int size, const int type)#
constructor for one-dimensional data object. The data is newly allocated and arbitrarily filled.
In fact, by this constructor a two-dimensional matrix with dimension 1 x size will be created. the owndata-flag is set to true, the continuously-flag, too (since only one matrix-plane will be created)
See also
create, tDataType
- Parameters:
size – is the number of elements
type – is the data-type of each element (use type of enumeration tDataType)
-
DataObject(const int sizeY, const int sizeX, const int type)#
constructor for two-dimensional data object. The data is newly allocated and arbitrarily filled.
the owndata-flag is set to true, the continuously-flag, too (since only one matrix-plane will be created)
See also
create, tDataType
- Parameters:
sizeY – is the number of rows in each matrix-plane
sizeX – is the number of columns in each matrix-plane
type – is the data-type of each element (use type of enumeration tDataType)
-
DataObject(const int sizeZ, const int sizeY, const int sizeX, const int type, const unsigned char continuous = 0)#
constructor for three-dimensional data object. The data is newly allocated and arbitrarily filled.
constructor for three-dimensional data object. The data is newly allocated and arbitrarily filled.
the owndata-flag is set to true
See also
create, tDataType
- Parameters:
sizeZ – is the number of images in the z-direction
sizeY – is the number of rows in each matrix-plane
sizeX – is the number of columns in each matrix-plane
type – is the data-type of each element (use type of enumeration tDataType)
continuous – indicates whether all matrix-planes should continuously lie in memory (1) or not (0) (default: 0)
-
DataObject(const int sizeZ, const int sizeY, const int sizeX, const int type, const uchar *continuousDataPtr, const int *steps = NULL)#
constructor for 3-dimensional data object which uses the data given by the continuousDataPtr.
In case of the continuousDataPtr, the owndata-flag is set to false, hence this DataObject will not delete the data. Additionally the continuous-flag is set to true. The external data must be kept alive during the entire lifetime of this DataObject.
See also
create, tDataType
- Parameters:
sizeZ – is the number of images in the z-direction
sizeY – is the number of rows in each matrix-plane
sizeX – is the number of columns in each matrix-plane
type – is the data-type of each element (use type of enumeration tDataType)
*continuousDataPtr – points to the first element of a continuous data block of the specific data type
*steps – may be NULL, if the data in continuousDataPtr should be taken continuously, hence the ROI is the whole matrix, else this is a vector with three elements, where each elements indicates the number of bytes one has to move in order to get from one element to the next one in the same dimension. Hence, the last element in this vector is equal to the size of one single element (in bytes)
-
DataObject(const MSize &sizes, const int type, const unsigned char continuous = 0)#
constructor for data object with given dimension. The data is newly allocated and arbitrarily filled.
constructor for data object with given dimension. The data is newly allocated and arbitrarily filled.
the owndata-flag is set to true
See also
create, tDataType
- Parameters:
sizes –
type – is the data-type of each element (use type of enumeration tDataType)
continuous – indicates whether all matrix-planes should continuously lie in memory (1) or not (0) (default: 0)
-
DataObject(const unsigned char dimensions, const int *sizes, const int type, const unsigned char continuous = 0)#
constructor for data object with given dimension. The data is newly allocated and arbitrarily filled.
constructor for data object with given dimension. The data is newly allocated and arbitrarily filled.
the owndata-flag is set to true
See also
create, tDataType
- Parameters:
dimensions – indicates the total number of dimensions
*sizes – is a vector of size ‘dimensions’, where each element gives the size (not osize) of the specific dimension
type – is the data-type of each element (use type of enumeration tDataType)
continuous – indicates whether all matrix-planes should continuously lie in memory (1) or not (0) (default: 0)
-
DataObject(const unsigned char dimensions, const int *sizes, const int type, const uchar *continuousDataPtr, const int *steps = NULL)#
constructor for data object which uses the data given by the continuousDataPtr.
In case of the continuousDataPtr, the owndata-flag is set to false, hence this dataObj will not delete the data. Additionally the continuous-flag is set to true. The external data must be kept alive during the entire lifetime of this DataObject.
See also
create, ito::tDataType
- Parameters:
dimensions – indicates the total number of dimensions
*sizes – is a vector of size ‘dimensions’, where each element gives the size (not osize) of the specific dimension
type – is the data-type of each element (use type of enumeration tDataType)
*continuousDataPtr – points to the first element of a continuous data block of the specific data type
*steps – may be NULL, if the data in continuousDataPtr should be taken continuously, hence the ROI is the whole matrix, else this is a vector of size ‘dimensions’, where each elements indicates the number of bytes one has to move in order to get from one element to the next one in the same dimension. Hence, the last element in this vector is equal to the size of one single element (in bytes)
-
DataObject(const unsigned char dimensions, const int *sizes, const int type, const cv::Mat *planes, const unsigned int nrOfPlanes)#
constructor for data object from a stack of cv::Mat
-
DataObject(const cv::Mat &data)#
constructor for data object from a single cv::Mat
-
DataObject(const DataObject ©Constr)#
copy constructor for data object
copy constructor
creates a data object with respect to the given data object. The header information is completely copied, while the data is a shallow copy. The lock of the new data object is unlocked while the lock for the common data block is taken from the current lock status of the given data object.
- Parameters:
©Constr – is the data object, which will be copied
-
~DataObject(void)#
destructor
reference pointer of data is decremented and if <0, data will be deleted if owndata-flag is true. Additionally the allocated memory for header information will be deleted, too.
See also
freeData
-
double getValueOffset() const#
< Function return the offset of the values stored within the dataOject
Function return the scaling of values stored within the dataOject
-
double getValueScale() const#
Function return the unit description for the values stoerd within the dataOject.
-
const std::string getValueUnit() const#
Function return the description for the values stored within the dataOject, if tagspace does not exist, NULL is returned.
-
std::string getValueDescription() const#
Function return the axis-offset for the existing axis specified by axisNum. If axisNum is out of dimension range it returns NULL.
-
double getAxisOffset(const int axisNum) const#
Function returns the axis-description for the exist axis specified by axisNum. If axisNum is out of dimension range it returns NULL.
-
double getAxisScale(const int axisNum) const#
Function returns the axis-unit-description for the exist axis specified by axisNum. If axisNum is out of dimension range it returns NULL.
< Function returns the axis-description for the exist axis specified by axisNum. If axisNum is out of dimension range it returns NULL.
-
const std::string getAxisUnit(const int axisNum, bool &validOperation) const#
Function returns the axis-description for the exist specified by axisNum. If axisNum is out of dimension range it returns NULL.
< Function returns the axis-unit-description for the exist axis specified by axisNum. If axisNum is out of dimension range it returns NULL.
-
std::string getAxisDescription(const int axisNum, bool &validOperation) const#
< Function returns the axis-description for the exist specified by axisNum. If axisNum is out of dimension range it returns NULL.
-
bool getTagByIndex(const int tagNumber, std::string &key, DataObjectTagType &value) const#
Function returns the string-value for ‘key’ identified by int tagNumber. If key in the TagMap do not exist NULL is returned.
-
std::string getTagKey(const int tagNumber, bool &validOperation) const#
Function returns the number of elements in the Tags-Maps.
< Function returns the string-value for ‘key’ identified by int tagNumber. If key in the TagMap do not exist NULL is returned
-
int getTagListSize() const#
Function to set the string-value of the value unit, return 1 if values does not exist.
< Function returns the number of elements in the Tags-Maps
-
int setValueUnit(const std::string &unit)#
Function to set the string-value of the value description, return 1 if values does not exist.
< Function to set the string-value of the value unit, return 1 if values does not exist
-
int setValueDescription(const std::string &description)#
set the offset of the axisNum-th axis. Offset is in pixel. The relation is: physical unit = (pixel unit - offset) * scale
< Function to set the string-value of the value description, return 1 if values does not exist
-
int setAxisOffset(const unsigned int axisNum, const double offset)#
set the scaling of the axisNum-th axis. Scaling is in (physical unit / pixel). The relation is: physical unit = (pixel unit - offset) * scale
< Function to set the offset of the specified axis, return 1 if axis does not exist
-
int setAxisScale(const unsigned int axisNum, const double scale)#
set the unit of the axisNum-th axis as latin1 encoded string
< Function to set the scale of the specified axis, return 1 if axis does not exist or scale is 0.0.
-
int setAxisUnit(const unsigned int axisNum, const std::string &unit)#
set the description of the axisNum-th axis as latin1 encoded string
< Function to set the unit (string value) of the specified axis, return 1 if axis does not exist
-
int setAxisDescription(const unsigned int axisNum, const std::string &description)#
< Function to set the description (string value) of the specified axis, return 1 if axis does not exist
-
int setTag(const std::string &key, const DataObjectTagType &value)#
< Function to set the string value of the specified tag, if the tag do not exist, it will be added automatically, return 1 if tagspace does not exist
-
bool existTag(const std::string &key) const#
< Function to check whether tag exist or not
-
bool deleteTag(const std::string &key)#
< Function deletes specified tag. If tag do not exist, return value is 1 else returnvalue is 0
-
int addToProtocol(const std::string &value)#
< Function adds value to the protocol-tag. If this object is an ROI, the ROI-coordinates are added. If string do not end with an
,
is added.
-
double getPhysToPix(const unsigned int dim, const double phys, bool &isInsideImage) const#
Function returns the not rounded pixel index of a physical coordinate.
Function returns the not rounded pixel index of a physical coordinate \detail Function returns the not rounded pixel index of a physical coordinate (Unit-Coordinate = ( px-Coordinate - Offset)* Scale). If the pixel is outside of the image, the isInsideImage-flag is set to false else it is set to true. To avoid memory access-error, the returnvalue is clipped within the range of the image ([0…imagesize-1])
The pixel value is clipped to the valid range of this object.
- Parameters:
dim – [in] Axis-dimension for which the physical coordinate is calculated
pix – [in] Pixel-index as double
isInsideImage – [out] flag which is set to true if coordinate is within range of the image.
- Returns:
(double)( phys / AxisScale + AxisOffset) & [0..imagesize-1]
-
double getPhysToPix(const unsigned int dim, const double phys) const#
Function returns the not rounded pixel index of a physical coordinate.
Function returns the not rounded pixel index of a physical coordinate \detail Function returns the not rounded pixel index of a physical coordinate (Unit-Coordinate = ( px-Coordinate - Offset)* Scale). To avoid memory access-error, the return value is clipped within the range of the image ([0…imagesize-1])
The pixel value is clipped to the valid range of this object.
- Parameters:
dim – [in] Axis-dimension for which the physical coordinate is calculated
pix – [in] Pixel-index as double
- Returns:
(double)( phys / AxisScale + AxisOffset) & [0..imagesize-1]
-
double getPhysToPixUnclipped(const unsigned int dim, const double phys) const#
Function returns the not rounded pixel index of a physical coordinate.
The pixel value is not clipped to the valid range of this object, hence, the returned index might not exist in the dataObject.
-
int getPhysToPix2D(const double physY, double &tPxY, bool &isInsideImageY, const double physX, double &tPxX, bool &isInsideImageX) const#
Function returns the not rounded pixel index of a physical coordinate.
This method only considers the x- and y-coordinates (last two dimensions of the dataObject).
- Parameters:
physY – is the physical coordinate of the y axis
tPxY – [byRef] contains the corresponding pixel coordinate of physY after the function has been called
isInsideImageY – [byRef] is true if physY is inside of the dataObject area, else false
physX – is the physical coordinate of the x axis
tPxX – [byRef] contains the corresponding pixel coordinate of physX after the function has been called
isInsideImageX – [byRef] is true if physX is inside of the dataObject area, else false
- Returns:
0 (always)
-
double getPixToPhys(const unsigned int dim, const double pix, bool &isInsideImage) const#
Function returns the physical coordinate of a pixel.
Function returns the physical coordinate of a pixel \detail Function returns the physical coordinate of a pixel index (Unit-Coordinate = ( px-Coordinate.
Offset)* Scale). If the pixel is outside of the image, the isInsideImage-flag is set to false else it is set to true
- Parameters:
dim – [in] Axis-dimension for which the physical coordinate is calculated
pix – [in] Pixel-index as double
isInsideImage – [out] flag which is set to true if coordinate is within range of the image.
- Returns:
(double)( pix - AxisOffset)* AxisScale)
-
double getPixToPhys(const unsigned int dim, const double pix) const#
Function returns the physical coordinate of a pixel.
Function returns the physical coordinate of a pixel \detail Function returns the physical coordinate of a pixel index (Unit-Coordinate = ( px-Coordinate.
Offset)* Scale).
- Parameters:
dim – [in] Axis-dimension for which the physical coordinate is calculated
pix – [in] Pixel-index as double
- Returns:
(double)( pix - AxisOffset)* AxisScale)
-
RetVal setXYRotationalMatrix(double r11, double r12, double r13, double r21, double r22, double r23, double r31, double r32, double r33)#
Function to access (set) the rotiational matrix by each element.
- Parameters:
r11 – [in] Upper left element
r12 – [in] Upper middle element
r13 – [in] Upper right element
r21 – [in] Middle left element
r22 – [in] Middle middle element
r23 – [in] Middle right element
r31 – [in] Lower left element
r32 – [in] Lower middle element
r33 – [in] Lower right element
- Returns:
ito::retOk || ito::retError
-
RetVal getXYRotationalMatrix(double &r11, double &r12, double &r13, double &r21, double &r22, double &r23, double &r31, double &r32, double &r33) const#
Function to access (get) the rotiational matrix by each element.
- Parameters:
r11 – [out] Upper left element
r12 – [out] Upper middle element
r13 – [out] Upper right element
r21 – [out] Middle left element
r22 – [out] Middle middle element
r23 – [out] Middle right element
r31 – [out] Lower left element
r32 – [out] Lower middle element
r33 – [out] Lower right element
- Returns:
ito::retOk || ito::retError
-
RetVal copyTagMapTo(DataObject &rhs) const#
Deep copies the tagmap with all entries to rhs object
\detail this function makes a deepcopy of the tags map to rhs object from this object.
See also
DataObjectTags
- Parameters:
&rhs – is the matrix where the map is copied to. The old map of this object is cleared first
- Returns:
retOk
-
RetVal copyAxisTagsTo(DataObject &rhs) const#
Deep copies the axistags to rhs object
this function makes a deepcopy of the axis and value metadata from this object to rhs object. It copies
See also
DataObjectTags
- Parameters:
&rhs – is the matrix where the map is copied from. The old map of this object is cleared first
- Returns:
retOk
-
RetVal setReal(DataObject &valuesObj)#
high-level value which calculates the real value of each element of the input source data object and returns the resulting data object
See also
ArgFunc
- Parameters:
&dObj –
- Throws:
cv::Exception – if undefined data type (e.g. real data types)
- Returns:
new data object with real values
-
RetVal setImag(DataObject &valuesObj)#
high-level value which calculates the real value of each element of the input source data object and returns the resulting data object
See also
ArgFunc
- Parameters:
&dObj –
- Throws:
cv::Exception – if undefined data type (e.g. real data types)
- Returns:
new data object with real values
-
inline int getDims(void) const#
< returns the number of dimensions returns the element data type in form of its type-number
-
inline int getType(void) const#
returns if the data in the first n-2 dimensions is stored within one entire block in memory (true), else (false)
-
inline char getContinuous(void) const#
returns if the data object is owner of the data, hence, the data will be deleted by this data object, if nobody else is using the data any more
-
inline char getOwnData(void) const#
returns the real plane index of cv::Mat array returned by get_mdata() for a given plane number considering a possible roi. Use this method if you already know the total number of planes within the roi.
-
int seekMat(const int matNum, const int numMats) const#
returns the real plane index of cv::Mat array returned by get_mdata() for a given plane number considering a possible roi. This method internally calculates the number of planes within the roi using getNumPlanes.
returns the index vector-index of m_data which corresponds to the given zero-based two-dimensional matrix-index
Since there might be a difference between the “real” matrix size in memory and the virtual size which is set by subslicing a matrix and hence setting any ROI, this method transforms a desired matrix-plane index to the real index in memory of the data-vector m_data
- Parameters:
matNum – zero-based matrix-plane-index, considering the virtual matrix size (ROI), 0<=matNum<getNumPlanes
numMats – total number of matrix-planes, lying within the ROI
- Returns:
real vector-index for the desired matrix-plane or 0 if matNum >= numMats.
-
int seekMat(const int matNum) const#
returns the number of planes of this data object (considering a possible ROI). This method simply calls getNumPlanes and is only there for historical reasons.
returns the index vector-index of m_data which corresponds to the given zero-based two-dimensional matrix-index
Since there might be a difference between the “real” matrix size in memory and the virtual size which is set by subslicing a matrix and hence setting any ROI, this method transforms a desired matrix-plane index to the real index in memory of the data-vector m_data
See also
See also
- Parameters:
matNum – zero-based matrix-plane considering the virtual matrix size (ROI), 0<=matNum<getNumPlanes
- Returns:
real vector-index for the desired matrix-plane
-
int calcNumMats(void) const#
calculates numbers of single opencv matrices which are part of the ROI which has previously been set.
See also
- Returns:
0 if empty range or empty matrix, 1 if two dimensional, else product of sizes of all dimensions besides the last two ones.
-
inline int getNumPlanes(void) const#
calculates numbers of single opencv matrices which are part of the ROI which has previously been set.
This method replaces calcNumMats due to its more consistent method name.
- Returns:
0 if empty range or empty matrix, 1 if two dimensional, else product of sizes of all dimensions besides the last two ones.
-
cv::Mat *getCvPlaneMat(const int planeIndex)#
returns pointer to cv::Mat plane with given index considering a possible roi.
returns the pointer to the underlying cv::Mat that represents the plane with given planeIndex of the entire data object.
This command is equivalent to get_mdata()[seekMat(planeIndex)] but checks for out-of-range errors.
See also
See also
- Parameters:
planeIndex – is the zero-based index of the requested plane within the current ROI of the data object
- Returns:
pointer to the cv::Mat plane or NULL if planeIndex is out of range
-
const cv::Mat *getCvPlaneMat(const int planeIndex) const#
returns pointer to cv::Mat plane with given index considering a possible roi.
returns the pointer to the underlying cv::Mat that represents the plane with given planeIndex of the entire data object.
This command is equivalent to get_mdata()[seekMat(planeIndex)] but checks for out-of-range errors.
See also
See also
- Parameters:
planeIndex – is the zero-based index of the requested plane within the current ROI of the data object
- Returns:
pointer to the cv::Mat plane or NULL if planeIndex is out of range
-
const cv::Mat getContinuousCvPlaneMat(const int planeIndex) const#
returns a shallow or deep copy of a cv::Mat plane with given index. If the current plane is not continuous (due to a roi), a cloned, continuous matrix is returned, else a shallow copy.
returns a shallow or deep copy of a cv::Mat plane with given index. If the current plane is not continuous (due to a roi), a cloned, continuous matrix is returned, else a shallow copy.
See also
See also
- Parameters:
planeIndex – is the zero-based index of the requested plane within the current ROI of the data object
- Returns:
shallow copy or clone of desired plane, depending if the plane is continuous (no roi set in plane dimensions) or not.
-
inline cv::Mat **get_mdata(void)#
returns array of pointers to cv::_Mat-matrices (planes) of the data object.
The returned array of matrices contains all matrices of this object, including the matrices that may lie outside of a possible region of interest. In order to access the i-th plane considering any roi, use getCvPlaneMat or calculate the right accessing index using seekMat.
Remark
the returned type is an array of cv::Mat*, you should cast it to the appropriate type (e.g. cv::_Mat<int8>)
See also
- Returns:
pointer to vector of matrices
-
inline const cv::Mat **get_mdata(void) const#
returns constant array of pointers to cv::_Mat-matrices (planes) of the data object
The returned array of matrices contains all matrices of this object, including the matrices that may lie outside of a possible region of interest. In order to access the i-th plane considering any roi, use getCvPlaneMat or calculate the right accessing index using seekMat.
Remark
the returned type is a const array of cv::Mat*, you should cast it to the appropriate type (e.g. cv::_Mat<int8>)
See also
- Returns:
pointer to vector of matrices
-
inline MSize getSize(void)#
returns the size-member. m_size fits to the physical organization of data in memory.
- Returns:
size-member of type MSize
-
inline const MSize getSize(void) const#
returns the size-member. This member does not consider the transpose flag, hence, m_size fits to the physical organization of data in memory.
- Returns:
size-member of type MSize
-
inline int getSize(int index) const#
gets the size of the given dimension (this is the size within the ROI)
- Parameters:
index – is the specific zero-based dimension-index whose size is requested
- Returns:
size or -1 if index is out of boundaries
-
inline MSize getOriginalSize(void)#
returns the original size-member. This is equal to getSize() if no roi is set to the dataObject.
- Returns:
osize-member of type MSize
-
inline const MSize getOriginalSize(void) const#
returns the original size-member. This is equal to getSize() if no roi is set to the dataObject.
- Returns:
osize-member of type MSize
-
inline int getOriginalSize(int index) const#
gets the original size of the given dimension (this is the size without considering any ROI)
- Parameters:
index – is the specific zero-based dimension-index whose size is requested
- Returns:
size or -1 if index is out of boundaries
-
int getStep(int index) const#
returns a normalized step in the index-th axis, this is the number of values one has to walk in order to get the next value in the index-th axis.
Please consider, that this value can only be used for pointer-arithmetic operations if the dataObject is continuous. Else, it only indicates the number of values, however their pixel position might be interrupted at plane boundaries.
- Parameters:
index – is the axis for which the step size should be determined \raises Exception if index is out of bounds
-
inline int getTotal() const#
gets total number of elements within the data object’s ROI
- Returns:
number of elements
-
inline int getOriginalTotal() const#
gets total number of elements of the whole data object
- Returns:
number of elements
-
RetVal copyTo(DataObject &rhs, unsigned char regionOnly = 0) const#
high-level, non-templated method to deeply copy the data of this matrix to another matrix rhs
deeply copies the data of this data object to the given rhs-dataObject. regionOnly defines if only data within the current ROI should be copied or the entire matrix with the current ROI borders. The destination object is newly allocated if its current number od dimensions, type or size of the ROI does not fit.
In case of ‘regionOnly’ == false, the destination dataObject ‘rhs’ is always newly allocated before copying data and the tags as well as the axis descriptions etc. are also copied from the source object. If the source object has a ROI set, the entire object with all data outside of the ROI is copied and the ROI is applied to the destination object, too.
If ‘regionOnly’ == true, only data within a current ROI is copied to the destination object. In this case, the destination is only newly allocated if its current dimension, size or type do not fit to the source object. Else, data is copied into the existing memory. Tags and axis descriptions etc. are always copied to the destination object.
See also
- Parameters:
&rhs – is the matrix where the data is copied to. The old data of rhs is deleted first
regionOnly, if – true, only the data of the ROI in lhs is copied, hence, the org-size of rhs corresponds to the ROI-size of lhs, else the whole data block is copied and the ROI of rhs is set to the ROI of lhs
- Returns:
retOk
-
RetVal convertTo(DataObject &rhs, const int type, const double alpha = 1, const double beta = 0) const#
high-level, non-templated matrix conversion
Convertes an array to another data type with optional scaling (alpha * value + beta)
Every element of the source matrix is converted to a new, given type. Additionally a floating-point scaling and offset parameter is possible.
See also
fListConvertToFunc
- Parameters:
&rhs – is the destination data object, whose memory is firstly deleted, then newly allocated
type – is the type-number of the destination element
alpha – scaling factor (default: 1.0)
beta – offset value (default: 0.0)
- Throws:
cv::Exception – if cast failed, e.g. if cast not possible or types unknown
- Returns:
retOk
-
RetVal setTo(const int8 &value, const DataObject &mask = DataObject())#
Sets all or some of the array elements to the specific value.
Sets all or some (if uint8 mask is given) of the array elements to the specified value.
See also
AssignScalarValue
- Parameters:
assigned – scalar converted to the actual array type
mask – Operation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
- Returns:
retError in case of error
-
RetVal setTo(const uint8 &value, const DataObject &mask = DataObject())#
Sets all or some of the array elements to the specific value.
Sets all or some (if uint8 mask is given) of the array elements to the specified value.
See also
AssignScalarValue
- Parameters:
assigned – scalar converted to the actual array type
mask – Operation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
- Returns:
retError in case of error
-
RetVal setTo(const int16 &value, const DataObject &mask = DataObject())#
Sets all or some of the array elements to the specific value.
Sets all or some (if uint8 mask is given) of the array elements to the specified value.
See also
AssignScalarValue
- Parameters:
assigned – scalar converted to the actual array type
mask – Operation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
- Returns:
retError in case of error
-
RetVal setTo(const uint16 &value, const DataObject &mask = DataObject())#
Sets all or some of the array elements to the specific value.
Sets all or some (if uint8 mask is given) of the array elements to the specified value.
See also
AssignScalarValue
- Parameters:
assigned – scalar converted to the actual array type
mask – Operation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
- Returns:
retError in case of error
-
RetVal setTo(const int32 &value, const DataObject &mask = DataObject())#
Sets all or some of the array elements to the specific value.
Sets all or some (if uint8 mask is given) of the array elements to the specified value.
See also
AssignScalarValue
- Parameters:
assigned – scalar converted to the actual array type
mask – Operation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
- Returns:
retError in case of error
-
RetVal setTo(const uint32 &value, const DataObject &mask = DataObject())#
Sets all or some of the array elements to the specific value.
Sets all or some (if uint8 mask is given) of the array elements to the specified value.
See also
AssignScalarValue
- Parameters:
assigned – scalar converted to the actual array type
mask – Operation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
- Returns:
retError in case of error
-
RetVal setTo(const float32 &value, const DataObject &mask = DataObject())#
Sets all or some of the array elements to the specific value.
Sets all or some (if uint8 mask is given) of the array elements to the specified value.
See also
AssignScalarValue
- Parameters:
assigned – scalar converted to the actual array type
mask – Operation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
- Returns:
retError in case of error
-
RetVal setTo(const float64 &value, const DataObject &mask = DataObject())#
Sets all or some of the array elements to the specific value.
Sets all or some (if uint8 mask is given) of the array elements to the specified value.
See also
AssignScalarValue
- Parameters:
assigned – scalar converted to the actual array type
mask – Operation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
- Returns:
retError in case of error
-
RetVal setTo(const complex64 &value, const DataObject &mask = DataObject())#
Sets all or some of the array elements to the specific value.
Sets all or some (if uint8 mask is given) of the array elements to the specified value.
See also
AssignScalarValue
- Parameters:
assigned – scalar converted to the actual array type
mask – Operation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
- Returns:
retError in case of error
-
RetVal setTo(const complex128 &value, const DataObject &mask = DataObject())#
Sets all or some of the array elements to the specific value.
Sets all or some (if uint8 mask is given) of the array elements to the specified value.
See also
AssignScalarValue
- Parameters:
assigned – scalar converted to the actual array type
mask – Operation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
- Returns:
retError in case of error
-
RetVal setTo(const ito::Rgba32 &value, const DataObject &mask = DataObject())#
Sets all or some of the array elements to the specific value.
Sets all or some (if uint8 mask is given) of the array elements to the specified value.
See also
AssignScalarValue
- Parameters:
assigned – scalar converted to the actual array type
mask – Operation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
- Returns:
retError in case of error
-
RetVal setTo(const ito::DateTime &value, const DataObject &mask = DataObject())#
Sets all or some of the array elements to the specific value.
Sets all or some (if uint8 mask is given) of the array elements to the specified value.
See also
AssignScalarValue
- Parameters:
assigned – scalar converted to the actual array type
mask – Operation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
- Returns:
retError in case of error
-
RetVal setTo(const ito::TimeDelta &value, const DataObject &mask = DataObject())#
Sets all or some of the array elements to the specific value.
Sets all or some (if uint8 mask is given) of the array elements to the specified value.
See also
AssignScalarValue
- Parameters:
assigned – scalar converted to the actual array type
mask – Operation mask of the same size as *this and type uint8 or empty data object if no mask should be considered (default)
- Returns:
retError in case of error
-
RetVal deepCopyPartial(DataObject ©To)#
copy all values of this data object to the copyTo data object. The copyTo-data object must be allocated and have the same type and size (of its roi) than this data object. The compared sequence of sizes only contains dimensions whose size is bigger than one (e.g. it is possible to copy a 5x1 object to a 1x1x5 object)
high-level, non-templated method. Deeply copies data of this data object which is within its ROI to the ROI of rhs.
See also
DeepCopyPartialFunc
- Parameters:
&rhs – is the right-handed data object, where data is copied to.
- Throws:
cv::Exception(CV_StsAssert) – if sizes or type of both matrices are not equal
- Returns:
retOk
-
DObjIterator begin()#
Returns the matrix iterator and sets it to the first matrix element.
returns iterator to the first item in the data object array
See also
DObjIterator
- Returns:
iterator
-
DObjIterator end()#
Returns the matrix iterator and sets it to the after-last matrix element.
returns iterator to the end value of this data object array
The end value is the first item outside of the data object array.
See also
DObjIterator
- Returns:
iterator
-
DObjConstIterator constBegin() const#
Returns the matrix read-only iterator and sets it to the first matrix element.
returns constant iterator to the first item in the data object array
See also
DObjConstIterator
- Returns:
iterator
-
DObjConstIterator constEnd() const#
Returns the matrix read-only iterator and sets it to the after-last matrix element.
returns constant iterator to the end value of this data object array
The end value is the first item outside of the data object array.
See also
DObjConstIterator
- Returns:
iterator
-
DataObject &operator=(const cv::Mat &rhs)#
assign-operator which creates a two-dimensional data object as a shallow copy of a two dimensional cv::Mat object.
shallow-copy means, that the header information of this data-object is physically created at the hard disk, while the data is shared with the original cv::Mat.
See also
create
- Parameters:
&rhs – is the cv::Mat where the shallow copy is taken from. At first, the existing data of this object is freed.
- Throws:
cv::Exception – if rhs is not two-dimensional or data type has no compatible data type of dataObject.
- Returns:
this data object
-
DataObject &operator=(const DataObject &rhs)#
assign-operator which makes a shallow-copy of the rhs data object and stores it in this data object
shallow-copy means, that the header information of the rhs data-object is physically copied to this-dataObject while the data is shared, hence, only its reference counter is incremented.
The previous array covered by this data object is completely released before assigning the new rhs data object. In order to deeply copy the values from one object into another pre-allocated object use the method deepCopyPartial.
See also
CopyMatFunc, deepCopyPartial
- Parameters:
&rhs – is the data object where the shallow copy is taken from. At first, the existing data of this object is freed.
- Throws:
cv::Exception – if lock state of both objects is not equal. Please make sure, that both lock states are equal
- Returns:
this data object
-
DataObject &operator=(const int8 &value)#
Every data element in this data object is set to the given value.
sets all elements of the data object to the given value. Value is cast to the data object’s type
See also
AssignScalarValue
- Parameters:
value – is the scalar assignment value
- Returns:
modified data object
-
DataObject &operator=(const uint8 &value)#
Every data element in this data object is set to the given value.
sets all elements of the data object to the given value. Value is cast to the data object’s type
See also
AssignScalarValue
- Parameters:
value – is the scalar assignment value
- Returns:
modified data object
-
DataObject &operator=(const int16 &value)#
Every data element in this data object is set to the given value.
sets all elements of the data object to the given value. Value is cast to the data object’s type
See also
AssignScalarValue
- Parameters:
value – is the scalar assignment value
- Returns:
modified data object
-
DataObject &operator=(const uint16 &value)#
Every data element in this data object is set to the given value.
sets all elements of the data object to the given value. Value is cast to the data object’s type
See also
AssignScalarValue
- Parameters:
value – is the scalar assignment value
- Returns:
modified data object
-
DataObject &operator=(const int32 &value)#
Every data element in this data object is set to the given value.
sets all elements of the data object to the given value. Value is cast to the data object’s type
See also
AssignScalarValue
- Parameters:
value – is the scalar assignment value
- Returns:
modified data object
-
DataObject &operator=(const uint32 &value)#
Every data element in this data object is set to the given value.
sets all elements of the data object to the given value. Value is cast to the data object’s type
See also
AssignScalarValue
- Parameters:
value – is the scalar assignment value
- Returns:
modified data object
-
DataObject &operator=(const float32 &value)#
Every data element in this data object is set to the given value.
sets all elements of the data object to the given value. Value is cast to the data object’s type
See also
AssignScalarValue
- Parameters:
value – is the scalar assignment value
- Returns:
modified data object
-
DataObject &operator=(const float64 &value)#
Every data element in this data object is set to the given value.
sets all elements of the data object to the given value. Value is cast to the data object’s type
See also
AssignScalarValue
- Parameters:
value – is the scalar assignment value
- Returns:
modified data object
-
DataObject &operator=(const complex64 &value)#
Every data element in this data object is set to the given value.
sets all elements of the data object to the given value. Value is cast to the data object’s type
See also
AssignScalarValue
- Parameters:
value – is the scalar assignment value
- Returns:
modified data object
-
DataObject &operator=(const complex128 &value)#
Every data element in this data object is set to the given value.
sets all elements of the data object to the given value. Value is cast to the data object’s type
See also
AssignScalarValue
- Parameters:
value – is the scalar assignment value
- Returns:
modified data object
-
DataObject &operator=(const ito::Rgba32 &value)#
Every data element in this data object is set to the given value.
sets all elements of the data object to the given value. Value is cast to the data object’s type
See also
AssignScalarValue
- Parameters:
value – is the scalar assignment value
- Returns:
modified data object
-
DataObject &operator=(const ito::DateTime &value)#
Every data element in this data object is set to the given value.
sets all elements of the data object to the given value. Value is cast to the data object’s type
See also
AssignScalarValue
- Parameters:
value – is the scalar assignment value
- Returns:
modified data object
-
DataObject &operator=(const ito::TimeDelta &value)#
Every data element in this data object is set to the given value.
sets all elements of the data object to the given value. Value is cast to the data object’s type
See also
AssignScalarValue
- Parameters:
value – is the scalar assignment value
- Returns:
modified data object
-
DataObject &operator+=(const DataObject &rhs)#
high-level, non-templated arithmetic operator for element-wise addition of values of given data object to this data object
See also
AddFunc
- Parameters:
&rhs – is the data object whose elements will be added to this data object
- Throws:
cv::Exception – if both data objects don’t have the same size or type
- Returns:
this data object
-
DataObject operator+(const DataObject &rhs)#
high-level, non-templated arithmetic operator for element-wise addition of values of two given data objects
See also
AddFunc
- Parameters:
&rhs – is the data object whose elements will be added to this data object
- Throws:
cv::Exception – if both data objects don’t have the same size or type
- Returns:
new resulting data object
-
DataObject &operator-=(const DataObject &rhs)#
high-level, non-templated arithmetic operator for element-wise subtraction of values of given data object from values of this data object
See also
SubFunc
- Parameters:
&rhs – is the data object whose elements will be subtracted from this data object
- Throws:
cv::Exception – if both data objects don’t have the same size or type
- Returns:
this data object
-
DataObject operator-(const DataObject &rhs)#
high-level, non-templated arithmetic operator for element-wise subtraction of values of given data object from values of this data object
See also
SubFunc
- Parameters:
&rhs – is the data object whose elements will be subtracted from this data object
- Throws:
cv::Exception – if both data objects don’t have the same size or type
- Returns:
new resulting data object
-
DataObject &operator*=(const DataObject &rhs)#
inplace matrix multiplication of this dataObject with rhs (this *= rhs)
This multiplication is only implemented for float32 and float64. The matrix multiplication is only executed plane-by-plane, hence, the multiplication is done separately for each plane. This operation is only inplace, if the second matrix is squared and both matrices have the same number of columns. Else, this dataObject is reallocated to the new size.
For an element wise multiplication use the mul-method.
-
DataObject &operator*=(const float64 &factor)#
high-level method which multiplies every element in this data object by a given floating-point factor
See also
OpScalarMulFunc
- Parameters:
factor –
-
DataObject operator*(const DataObject &rhs)#
matrix multiplication of this dataObject with rhs. The result is returned.
This multiplication is only implemented for float32 and float64. The matrix multiplication is only executed plane-by-plane, hence, the multiplication is done separately for each plane.
For an element wise multiplication use the mul-method.
-
DataObject operator*(const float64 &factor)#
high-level method which multiplies every element in this data object by a given floating-point factor. The result matrix is returned as a new matrix.
See also
operator *, OpScalarMulFunc
- Parameters:
factor –
-
DataObject operator<(DataObject &rhs)#
compare operator, compares for “lower than”
See also
CmpFunc
- Parameters:
&rhs – is the data object with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator>(DataObject &rhs)#
compare operator, compares for “bigger than”
See also
CmpFunc
- Parameters:
&rhs – is the data object with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator<=(DataObject &rhs)#
compare operator, compares for “lower or equal than”
See also
CmpFunc
- Parameters:
&rhs – is the data object with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator>=(DataObject &rhs)#
compare operator, compares for “bigger or equal than”
See also
CmpFunc
- Parameters:
&rhs – is the data object with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator==(DataObject &rhs)#
compare operator, compares for “equal to”
See also
CmpFunc
- Parameters:
&rhs – is the data object with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator!=(DataObject &rhs)#
compare operator, compares for “unequal to”
See also
CmpFunc
- Parameters:
&rhs – is the data object with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator<(const float64 &value)#
compare operator, compares for “lower than”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator>(const float64 &value)#
compare operator, compares for “bigger than”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator<=(const float64 &value)#
compare operator, compares for “lower or equal than”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator>=(const float64 &value)#
compare operator, compares for “bigger or equal than”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator==(const float64 &value)#
compare operator, compares for “equal to”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator!=(const float64 &value)#
compare operator, compares for “unequal to”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator!=(const ito::complex64 &value)#
compare operator, compares for “unequal to”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator==(const ito::Rgba32 &value)#
compare operator, compares for “equal to”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator!=(const ito::Rgba32 &value)#
compare operator, compares for “unequal to”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator<(const ito::DateTime &value)#
compare operator, compares for “lower than”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator>(const ito::DateTime &value)#
compare operator, compares for “bigger than”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator<=(const ito::DateTime &value)#
compare operator, compares for “lower or equal than”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator>=(const ito::DateTime &value)#
compare operator, compares for “bigger or equal than”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator==(const ito::DateTime &value)#
compare operator, compares for “equal to”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator!=(const ito::DateTime &value)#
compare operator, compares for “unequal to”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator<(const ito::TimeDelta &value)#
compare operator, compares for “lower than”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator>(const ito::TimeDelta &value)#
compare operator, compares for “bigger than”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator<=(const ito::TimeDelta &value)#
compare operator, compares for “lower or equal than”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator>=(const ito::TimeDelta &value)#
compare operator, compares for “bigger or equal than”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator==(const ito::TimeDelta &value)#
compare operator, compares for “equal to”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator!=(const ito::TimeDelta &value)#
compare operator, compares for “unequal to”
See also
CmpFunc
- Parameters:
value – is the value with which this data object should element-wisely be compared
- Throws:
cv::Exception – if both data objects doesn’t have the same size or type
- Returns:
compare matrix of type uint8, which contains 0 or 1, depending on the result of the element-wise comparison
-
DataObject operator<<(const unsigned int shiftbit)#
high-level operator, which shifts the elements of this data objects by a given number of bits to the left and returns the new data object
See also
operator <<=, ShiftLFunc
- Parameters:
shiftbit – defines the number of bits to shift
- Returns:
new data object with shifted values
-
DataObject &operator<<=(const unsigned int shiftbit)#
high-level operator, which shifts the elements of this data objects by a given number of bits to the left
See also
ShiftLFunc
- Parameters:
shiftbit – defines the number of bits to shift
- Returns:
reference to this data object
-
DataObject operator>>(const unsigned int shiftbit)#
high-level operator, which shifts the elements of this data objects by a given number of bits to the right and returns the new data object
See also
operator >>=, ShiftRFunc
- Parameters:
shiftbit – defines the number of bits to shift
- Returns:
new data object with shifted values
-
DataObject &operator>>=(const unsigned int shiftbit)#
high-level operator, which shifts the elements of this data objects by a given number of bits to the right
See also
ShiftRFunc
- Parameters:
shiftbit – defines the number of bits to shift
- Returns:
reference to this data object
-
DataObject operator&(const DataObject &rhs)#
high-level operator, which executes the element-wise operation “bitwise and” between this data object and a given data object
the result is returned as a newly allocated data object.
See also
operator &=, BitAndFunc
- Parameters:
&rhs – is the matrix which is used for the operator
- Throws:
cv::Exception – if data type is not supported or both data objects differs either in their size or data type
- Returns:
new data object, where the result of the operation is stored
-
DataObject &operator&=(const DataObject &rhs)#
high-level operator, which executes the element-wise operation “bitwise and” between this data object and a given data object
See also
BitAndFunc
- Parameters:
&rhs – is the matrix which is used for the operator
- Throws:
cv::Exception – if data type is not supported or both data objects differs either in their size or data type
- Returns:
reference to this data object, where the result of the operation is stored
-
DataObject operator|(const DataObject &rhs)#
high-level operator, which executes the element-wise operation “bitwise or” between this data object and a given data object
the result is returned as a newly allocated data object.
See also
operator |=, BitOrFunc
- Parameters:
&rhs – is the matrix which is used for the operator
- Throws:
cv::Exception – if data type is not supported or both data objects differs either in their size or data type
- Returns:
new data object, where the result of the operation is stored
-
DataObject &operator|=(const DataObject &rhs)#
high-level operator, which executes the element-wise operation “bitwise or” between this data object and a given data object
See also
BitOrFunc
- Parameters:
&rhs – is the matrix which is used for the operator
- Throws:
cv::Exception – if data type is not supported or both data objects differs either in their size or data type
- Returns:
reference to this data object, where the result of the operation is stored
-
DataObject operator^(const DataObject &rhs)#
high-level operator, which executes the element-wise operation “bitwise or” between this data object and a given data object
the result is returned as a newly allocated data object.
See also
operator ^=, BitXorFunc
- Parameters:
&rhs – is the matrix which is used for the operator
- Throws:
cv::Exception – if data type is not supported or both data objects differs either in their size or data type
- Returns:
new data object, where the result of the operation is stored
-
DataObject &operator^=(const DataObject &rhs)#
high-level operator, which executes the element-wise operation “bitwise xor” between this data object and a given data object
See also
BitXorFunc
- Parameters:
&rhs – is the matrix which is used for the operator
- Throws:
cv::Exception – if data type is not supported or both data objects differs either in their size or data type
- Returns:
reference to this data object, where the result of the operation is stored
-
DataObject bitwise_not() const#
All other types will raise an exception. Compute bit-wise and element-wise inversion. For signed integer inputs, the two’s complement is returned. For floating-point objects, its machine-specific bit representation is used for the operation
-
RetVal zeros(const int type)#
allocates a zero-value matrix of size 1x1 with the given type
See also
zeros, ZerosFunc
- Parameters:
type – is the desired type-number
- Returns:
retOk
-
RetVal zeros(const int size, const int type)#
allocates a zero-value matrix of size 1 x size with the given type
See also
zeros, ZerosFunc
- Parameters:
size – is the desired length of the vector
type – is the desired type-number
- Returns:
retOk
-
RetVal zeros(const int sizeY, const int sizeX, const int type)#
allocates a zero-value matrix of size sizeY x sizeX with the given type
See also
zeros, ZerosFunc
- Parameters:
sizeY – are the number of rows
sizeX – are the number of columns
type – is the desired type-number
- Returns:
retOk
-
RetVal zeros(const int sizeZ, const int sizeY, const int sizeX, const int type, const unsigned char continuous = 0)#
allocates a zero-value, 3D- matrix of size sizeZ x sizeY x sizeX with the given type
See also
zeros, ZerosFunc
- Parameters:
sizeZ – are the number of matrix-planes
sizeY – are the number of rows
sizeX – are the number of columns
type – is the desired type-number
continuous – indicates whether the data should be in one continuous block (true) or not (false)
- Returns:
retOk
-
RetVal zeros(const unsigned char dimensions, const int *sizes, const int type, const unsigned char continuous = 0)#
high-level, non-templated base function for allocation of new matrix whose elements are all set to zero
See also
ZerosFunc
- Parameters:
dimensions – indicates the number of dimensions
*sizes – is a vector with the same length than dimensions. Every element indicates the size of the specific dimension
type – is the desired data-element-type
continuous – indicates whether the data should be in one continuous block (true) or not (false)
- Returns:
retOk
-
RetVal ones(const int type)#
allocates a one-value matrix of size 1x1 with the given type
See also
zeros, ZerosFunc
- Parameters:
type – is the desired type-number
- Returns:
retOk
-
RetVal ones(const int size, const int type)#
allocates a one-value matrix of size 1 x size with the given type
See also
zeros, ZerosFunc
- Parameters:
size – is the desired length of the vector
type – is the desired type-number
- Returns:
retOk
-
RetVal ones(const int sizeY, const int sizeX, const int type)#
allocates a one-value matrix of size sizeY x sizeX with the given type
See also
zeros, ZerosFunc
- Parameters:
sizeY – are the number of rows
sizeX – are the number of columns
type – is the desired type-number
- Returns:
retOk
-
RetVal ones(const int sizeZ, const int sizeY, const int sizeX, const int type, const unsigned char continuous = 0)#
allocates a one-valued, 3D- matrix of size sizeZ x sizeY x sizeX with the given type
See also
zeros, ZerosFunc
- Parameters:
sizeZ – are the number of matrix-planes
sizeY – are the number of rows
sizeX – are the number of columns
type – is the desired type-number
unsigned – char continuous indicates whether the data should be in one continuous block (true) or not (false)
- Returns:
retOk
-
RetVal ones(const unsigned char dimensions, const int *sizes, const int type, const unsigned char continuous = 0)#
high-level, non-templated base function for allocation of new matrix whose elements are all set to one
See also
OnesFunc
- Parameters:
dimensions – indicates the number of dimensions
*sizes – is a vector with the same length than dimensions. Every element indicates the size of the specific dimension
type – is the desired data-element-type
continuous – indicates whether the data should be in one continuous block (true) or not (false)
- Returns:
retOk
-
RetVal nans(const int type)#
allocates a one-value matrix of size 1x1 with the given type
See also
zeros, ZerosFunc
- Parameters:
type – is the desired type-number
- Returns:
retOk
-
RetVal nans(const int size, const int type)#
allocates a one-value matrix of size 1 x size with the given type
See also
zeros, ZerosFunc
- Parameters:
size – is the desired length of the vector
type – is the desired type-number
- Returns:
retOk
-
RetVal nans(const int sizeY, const int sizeX, const int type)#
allocates a one-value matrix of size sizeY x sizeX with the given type
See also
zeros, ZerosFunc
- Parameters:
sizeY – are the number of rows
sizeX – are the number of columns
type – is the desired type-number
- Returns:
retOk
-
RetVal nans(const int sizeZ, const int sizeY, const int sizeX, const int type, const unsigned char continuous = 0)#
allocates a one-valued, 3D- matrix of size sizeZ x sizeY x sizeX with the given type
See also
zeros, ZerosFunc
- Parameters:
sizeZ – are the number of matrix-planes
sizeY – are the number of rows
sizeX – are the number of columns
type – is the desired type-number
unsigned – char continuous indicates whether the data should be in one continuous block (true) or not (false)
- Returns:
retOk
-
RetVal nans(const unsigned char dimensions, const int *sizes, const int type, const unsigned char continuous = 0)#
high-level, non-templated base function for allocation of new matrix whose elements are all set to one
See also
OnesFunc
- Parameters:
dimensions – indicates the number of dimensions
*sizes – is a vector with the same length than dimensions. Every element indicates the size of the specific dimension
type – is the desired data-element-type
continuous – indicates whether the data should be in one continuous block (true) or not (false)
- Returns:
retOk
-
RetVal rand(const int type, const bool randMode = false)#
allocates a random-value matrix of size 1x1 with the given type
\detail this function allocates an random value matrix using cv::randu for uniform (randMode = false) or gausion noise (randMode = true). In case of an integer type, the uniform noise is from min(inclusiv) to max(inclusiv). For floating point types, the noise is between 0(inclusiv) and 1(exclusive). In case of an integer type, the Gaussian noise mean value is (max+min)/2.0 and the standard deviation is (max-min/)6.0 to max. For floating point types, the noise mean value is 0 and the standard deviation is 1.0/3.0.
See also
zeros, ZerosFunc
- Parameters:
type – is the desired type-number
randMode – switch mode between uniform distributed(false) and normal distributed noise(true)
- Returns:
retOk
-
RetVal rand(const int size, const int type, const bool randMode = false)#
allocates a random-value matrix of size 1 x size with the given type
\detail this function allocates an random value matrix using cv::randu for uniform (randMode = false) or gausion noise (randMode = true). In case of an integer type, the uniform noise is from min(inclusiv) to max(inclusiv). For floating point types, the noise is between 0(inclusiv) and 1(exclusive). In case of an integer type, the Gaussian noise mean value is (max+min)/2.0 and the standard deviation is (max-min/)6.0 to max. For floating point types, the noise mean value is 0 and the standard deviation is 1.0/3.0.
See also
zeros, ZerosFunc
- Parameters:
size – is the desired length of the vector
type – is the desired type-number
randMode – switch mode between uniform distributed(false) and normal distributed noise(true)
- Returns:
retOk
-
RetVal rand(const int sizeY, const int sizeX, const int type, const bool randMode = false)#
allocates a random-value matrix of size sizeY x sizeX with the given type
\detail this function allocates an random value matrix using cv::randu for uniform (randMode = false) or gausion noise (randMode = true). In case of an integer type, the uniform noise is from min(inclusiv) to max(inclusiv). For floating point types, the noise is between 0(inclusiv) and 1(exclusive). In case of an integer type, the Gaussian noise mean value is (max+min)/2.0 and the standard deviation is (max-min/)6.0 to max. For floating point types, the noise mean value is 0 and the standard deviation is 1.0/3.0.
See also
zeros, ZerosFunc
- Parameters:
sizeY – are the number of rows
sizeX – are the number of columns
type – is the desired type-number
randMode – switch mode between uniform distributed(false) and normal distributed noise(true)
- Returns:
retOk
-
RetVal rand(const int sizeZ, const int sizeY, const int sizeX, const int type, const bool randMode, const unsigned char continuous = 0)#
allocates a random-valued, 3D- matrix of size sizeZ x sizeY x sizeX with the given type
\detail this function allocates an random value matrix using cv::randu for uniform (randMode = false) or gausion noise (randMode = true). In case of an integer type, the uniform noise is from min(inclusiv) to max(inclusiv). For floating point types, the noise is between 0(inclusiv) and 1(exclusive). In case of an integer type, the Gaussian noise mean value is (max+min)/2.0 and the standard deviation is (max-min/)6.0 to max. For floating point types, the noise mean value is 0 and the standard deviation is 1.0/3.0.
See also
zeros, ZerosFunc
- Parameters:
sizeZ – are the number of matrix-planes
sizeY – are the number of rows
sizeX – are the number of columns
type – is the desired type-number
randMode – switch mode between uniform distributed(false) and normal distributed noise(true)
unsigned – char continuous indicates whether the data should be in one continuous block (true) or not (false)
- Returns:
retOk
-
RetVal rand(const unsigned char dimensions, const int *sizes, const int type, const bool randMode, const unsigned char continuous = 0)#
high-level, non-templated base function for allocation of new matrix whose elements are all set to one
\detail this function allocates an random value matrix using cv::randu for uniform (randMode = false) or gausion noise (randMode = true). In case of an integer type, the uniform noise is from min(inclusiv) to max(exclusive). For floating point types, the noise is between 0(inclusiv) and 1(exclusive). In case of an integer type, the Gaussian noise mean value is (max+min)/2.0 and the standard deviation is (max-min/)6.0 to max. For floating point types, the noise mean value is 0 and the standard deviation is 1.0/3.0.
See also
OnesFunc
- Parameters:
dimensions – indicates the number of dimensions
*sizes – is a vector with the same length than dimensions. Every element indicates the size of the specific dimension
type – is the desired data-element-type
randMode – switch mode between uniform distributed(false) and normal distributed noise(true)
continuous – indicates whether the data should be in one continuous block (true) or not (false)
- Returns:
retOk
-
RetVal eye(const int type)#
sets the matrix of this data object to a two-dimensional eye-matrix of size 1, hence [1]
See also
- Parameters:
type – is the desired element data-type
- Returns:
retOk
-
RetVal eye(const int size, const int type)#
sets the matrix of this data object to a two-dimensional eye-matrix of given size
At first, a preexisting matrix is freed, before creating the eye-matrix
See also
freeData, create, EyeFunc
- Parameters:
size – is the desired size of the squared eye-matrix
type – is the desired element data-type
- Returns:
retOk
-
RetVal conj()#
converts every element of the data object to its conjugate complex value
See also
ConjFunc
- Throws:
cv::Exception – if data type is not complex.
- Returns:
retOk
-
DataObject adj() const#
converts every element of the data object to its adjungate value
The adjungate is the transposed matrix, where each element is complex conjugated.
See also
- Throws:
cv::Exception – if data type is not complex.
- Returns:
retOk
-
DataObject trans() const#
transposes this data object
simply toggles the transpose flag
- Returns:
reference to this data object
-
DataObject mul(const DataObject &mat2, const double scale = 1.0) const#
high-level method which does a element-wise multiplication of elements in this matrix with elements in the second matrix.
The result is returned as new data object with the same type and size than this object. The axis scale, offset, description and unit values are copied from this object. Tags are copied from this object, too. Optionally the multiplication can be scaled by a scaling factor, which is set to one by default.
See also
DivFunc
- Parameters:
&mat2 – is the second source matrix
scale – is the scaling factor (default: 1.0)
- Returns:
result matrix
-
DataObject div(const DataObject &mat2, const double scale = 1.0) const#
high-level method which does a element-wise division of elements in this matrix by elements in second source matrix.
The result is returned as new data object with the same type and size than this object. The axis scale, offset, description and unit values are copied from this object. Tags are copied from this object, too.
See also
DivFunc
- Parameters:
&mat2 – is the second source matrix
scale – is the scaling factor (default: 1.0)
- Returns:
result matrix
-
int elemSize() const#
returns number of bytes required by each value in the array.
number of bytes that are required by each value inside of the data object array (e.g. 1 for uint8, 2 for int16…)
- Returns:
the size of each array element in bytes.
-
template<typename _Tp>
inline const _Tp &at(const unsigned int y, const unsigned int x) const# addressing method for two-dimensional data object.
- Parameters:
y – is the zero-based row-index to the element which is requested (considering any ROI)
x – is the zero-based column-index to the element which is requested (considering any ROI)
- Returns:
const reference to specific element
-
template<typename _Tp>
inline _Tp &at(const unsigned int y, const unsigned int x)# addressing method for two-dimensional data object.
- Parameters:
y – is the zero-based row-index to the element which is requested (considering any ROI)
x – is the zero-based column-index to the element which is requested (considering any ROI)
- Returns:
reference to specific element
-
template<typename _Tp>
inline const _Tp &at(const unsigned int z, const unsigned int y, const unsigned int x) const# addressing method for three-dimensional data object.
- Parameters:
z – is the zero-based z-index to the element which is requested (considering any ROI)
y – is the zero-based row-index to the element which is requested (considering any ROI)
x – is the zero-based column-index to the element which is requested (considering any ROI)
- Returns:
const reference to specific element
-
template<typename _Tp>
inline _Tp &at(const unsigned int z, const unsigned int y, const unsigned int x)# addressing method for three-dimensional data object.
- Parameters:
z – is the zero-based z-index to the element which is requested (considering any ROI)
y – is the zero-based row-index to the element which is requested (considering any ROI)
x – is the zero-based column-index to the element which is requested (considering any ROI)
- Returns:
reference to specific element
-
template<typename _Tp>
inline const _Tp &at(const unsigned int *idx) const# addressing method for n-dimensional data object.
Remark
The idx vector must indicate the indizes in “virtual”-order (user-friendly order)
- Parameters:
*idx – is vector whose size is equal to the data object’s dimensions. Each entry indicates the zero-based index of its specific dimension considering any ROI
- Returns:
const reference to specific element
-
template<typename _Tp>
inline _Tp &at(const unsigned int *idx)# addressing method for n-dimensional data object.
Remark
The idx vector must indicate the indizes in “virtual”-order (user-friendly order)
- Parameters:
*idx – is vector whose size is equal to the data object’s dimensions. Each entry indicates the zero-based index of its specific dimension considering any ROI
- Returns:
reference to specific element
-
DataObject at(const ito::Range &rowRange, const ito::Range &colRange) const#
addressing method for two-dimensional data object with two given range-values. returns shallow copy of addressed regions
addressing method for two-dimensional data object with two given range-values. returns shallow copy of addressed regions.
- Parameters:
rowRange – is the desired rowRange which should be in the new ROI (considers any existing ROI, too)
colRange – is the desired colRange which should be in the new ROI (considers any existing ROI, too)
- Throws:
cv::Exception – if number of dimensions is unequal to two.
- Returns:
new data object which is a shallow copy of this data object and whose ROI is set to the given row- and col-ranges
-
DataObject at(ito::Range *ranges) const#
addressing method for n-dimensional data object with n given range-values. returns shallow copy of addressed regions
addressing method for n-dimensional data object with n given range-values. returns shallow copy of addressed regions
If any of the given ranges exceed the boundaries of its corresponding dimension, the range will be set to the boundaries. ranges will be given in “virtual” order, hence, the transpose-flag is considered by this method.
See also
GetRangeFunc
- Parameters:
*ranges – is vector of desired ranges for each dimension
- Returns:
new data object with shallow copy of this data object and adjusted ROI with respect to the given ranges
-
DataObject at(const DataObject &mask) const#
addressing method that returns a Mx1 data object of the same type than this object with only values that are marked in the given uint8 mask object
addressing method that returns a 1xM data object of the same type than this object with only values that are marked in the given uint8 mask object
This method returns a new 1xM data object with the same type than this data object. The M columns are filled with a values of this data object whose corresponding mask value is != 0.
- Parameters:
mask – is a uint8 mask data object with the same size than this object. Values != 0 are valid values in the mask.
- Returns:
new data object with shallow copy of this data object and adjusted ROI with respect to the given ranges
-
inline uchar *rowPtr(const int matNum, const int y)#
returns pointer to the data in the y-th row in the 2d-matrix plane matNum
cast this pointer to the data type of the matrix elements (as pointer).
Remark
No further error checking (e.g. boundaries)
- Returns:
data-pointer
-
inline const uchar *rowPtr(const int matNum, const int y) const#
returns pointer to the data in the y-th row in the 2d-matrix plane matNum
cast this pointer to the data type of the matrix elements (as pointer).
Remark
No further error checking (e.g. boundaries)
- Returns:
data-pointer
-
template<typename _Tp>
inline _Tp *rowPtr(const int matNum, const int y)# returns pointer to the data in the y-th row in the 2d-matrix plane matNum
This is a templated version to return the pointer already casted to the right type, e.g. ito::float64* myPtr = myObj->rowPtr<ito::float64>(0,0).
Remark
No further error checking (e.g. boundaries)
- Returns:
data-pointer
-
template<typename _Tp>
inline const _Tp *rowPtr(const int matNum, const int y) const# returns pointer to the data in the y-th row in the 2d-matrix plane matNum
This is a templated version to return the pointer already casted to the right type, e.g. const ito::float64* myPtr = myObj->rowPtr<ito::float64>(0,0).
Remark
No further error checking (e.g. boundaries)
- Returns:
data-pointer
-
DataObject row(const int selRow) const#
low-level, templated method which changes the region of interest of the data object to the selected zero-based row index
See also
RowFunc
- Parameters:
*dObj –
selRow – indicates the zero-based row-index (considering any existing ROI)
selRow – is the specific zero-based row index
- Throws:
cv::Exception – if dimension is unequal to two.
- Returns:
retOk high-level method which makes a new header for the specified matrix row and returns it. The underlying data of the new matrix is shared with the original matrix.
- Returns:
new data object
-
DataObject col(const int selCol) const#
low-level, templated method which changes the region of interest of the data object to the selected zero-based col index
See also
ColFunc
- Parameters:
*dObj –
unsigned – int selCol indicates the zero-based col-index (considering any existing ROI)
selCol – is the specific zero-based row index
- Throws:
cv::Exception – if dimension is unequal to two.
- Returns:
retOk high-level method which makes a new header for the specified matrix column and returns it. The underlying data of the new matrix is shared with the original matrix.
- Returns:
new data object
-
DataObject toGray(const int destinationType = ito::tUInt8) const#
converts a color image (rgba32) to a gray-scale image
usage: res = static_cast<ito::float32>(sourceDataObject)
See also
convertTo, CastFunc
- Throws:
cv::Exception – if cast failed, e.g. if cast not possible or types unknown
- Returns:
cast data object
-
DataObject splitColor(const char *destinationColor, const int &dtype) const#
returns a color channel of a color image (rgba32)
- Throws:
cv::Exception – if cast failed, e.g. if cast not possible or types unknown
- Returns:
data object
-
DataObject lineCut(const double *coordinates, const int &len) const#
high-level method which takes a line cut across the planes of a dataObject.
The result is stored in a 2d result matrix of the same type.
- Parameters:
*coordinates – start and end point coordinates of line cut (physical). The coordinates are interpreted as followed: [x0,y0,x1,y1].
&len – length of coordinates list.
- Returns:
result dataObject
-
DataObject &adjustROI(const int dtop, const int dbottom, const int dleft, const int dright)#
adjust submatrix size and position within the two-dimensional data-object
changes the boundaries of the ROI of a two-dimensional data object by the given incremental values
Remark
the parameters indicates the shift with respect to the virtual order of the matrix, hence, the transpose flag is considered in this method
See also
- Parameters:
dtop – The shift of the top submatrix boundary upwards (positive value means upwards)
dbottom – The shift of the bottom submatrix boundary downwards (positive value means downwards)
dleft – The shift of the left submatrix boundary to the left (positive value means to the left)
dright – The shift of the right submatrix boundary to the right (positive value means to the right)
- Throws:
cv::Exception – if data object is not two-dimensional
- Returns:
reference to this data object
-
DataObject &adjustROI(const unsigned char dims, const int *lims)#
adjust submatrix size and position within the n-dimensional data-object
changes the boundaries of the ROI of a n-dimensional data object by the given incremental values
\params dims is the number of dimensions
Remark
lims indicates the shift with respect to the virtual order of the matrix, hence, the transpose flag is considered in this method
See also
- Parameters:
*lims – is a integer array whose length is 2*dims. For every dimension, two adjacent values indicates the shift of the ROI. The first of both values indicates the shift of the ROI towards the first element in the matrix (positive direction). The second value indicates the shift of the ROI towards the last element in the matrix (positive direction).
- Returns:
reference to this data object
-
RetVal locateROI(int *wholeSizes, int *offsets) const#
method locates ROI of this data object within its original data block
locates the boundaries of the ROI of a n-dimensional data object and returns the original size and the distances to the physical borders
long description
- Parameters:
*wholeSizes – is an allocated array of size m_dims, which is filled with the original matrix-sizes (considering the transpose-flag, hence, the output is in user-friendly form)
offsets – is dimension-wise offset in order to get from the original first element of the matrix to the subpart within the region of interest, array must be pre-allocated, too.
- Returns:
retOk
-
RetVal locateROI(int *lims) const#
method get ROI of this data object within its original data block
locates the boundaries of the ROI of a n-dimensional data object the distances to the physical borders
\params dims is the number of dimensions
- Parameters:
*lims – is a integer array whose length is 2*dims. For every dimension, two adjacent values indicates the shift of the ROI. The first of both values indicates the shift of the ROI towards the first element in the matrix (positive direction). The second value indicates the shift of the ROI towards the last element in the matrix (positive direction).
- Returns:
retOk
-
template<typename _Tp>
inline RetVal copyFromData2D(const _Tp *src, const int sizeX, const int sizeY)# copies the externally given source data inside this data object
This method obtains an externally given source array that must have the same element type than this data object. Its dimension is given by sizeX and sizeY and must correspond to the x-size and y-size of this data object. It is allowed that this data object is a shallow copy with a possible region of interest of another (bigger) object.
Then, the given array is copied inside of the values of the data object. The external array must have a row-wise data arrangement (c-style), hence, one row follows after the other one.
- Parameters:
_Tp* – src is the source array. The type of the array is analyzed at compile time (_Tp is the placeholder for this type as template parameter)
sizeX – is the width of the array and must fit to the plane width of the data object
sizeY – is the height of the array and must fit to the plane height of the data object
- Returns:
RetVal error if sizeX or sizeY does not fit to the size of the data object or if the type of the given array does not fit to the type of the data object
-
template<typename _Tp>
inline RetVal copyFromData2D(const _Tp *src, const int sizeX, const int sizeY, const int x0, const int y0, const int width, const int height)# copies the externally given source data inside this data object
This method obtains an externally given source array that must have the same element type than this data object. Its dimension is given by sizeX and sizeY and must correspond to the x-size and y-size of this data object. It is allowed that this data object is a shallow copy with a possible region of interest of another (bigger) object.
Then, the given array is copied inside of the values of the data object. The external array must have a row-wise data arrangement (c-style), hence, one row follows after the other one.
In this method, it is allowed that the original width and height of the given data is different than the plane size of this data object. Then only a subregion of the external data is copied, indicated by the x0 and y0 indices of the first value and its width and height (sizeX and sizeY are the original size of the given data). width and height must correspond to the plane size of the data object.
- Parameters:
_Tp* – src is the source array. The type of the array is analyzed at compile time (_Tp is the placeholder for this type as template parameter)
sizeX – is the width of the array.
sizeY – is the height of the array.
x0 – is the x-index of the first value of the source data that is copied.
y0 – is the y-index of the first value of the source data that is copied.
width – is the width of the sub-region of the source data that should be copied (must fit to the width of the data object)
height – is the height of the sub-region of the source data that should be copied (must fit to the height of the data object)
- Returns:
RetVal error if sizeX or sizeY does not fit to the size of the data object or if the type of the given array does not fit to the type of the data object
-
template<typename T2>
operator T2()# cast operator for data object
cast operator, tries to cast this data object to another element type
usage: res = static_cast<ito::float32>(sourceDataObject)
See also
convertTo, CastFunc
- Throws:
cv::Exception – if cast failed, e.g. if cast not possible or types unknown
- Returns:
cast data object
Public Static Functions
-
static DataObject stack(const DataObject *mats, int num, unsigned int axis = 0)#
returns a stack of multiple dataObjects (number is equal to num) along the given axis (default: 0).
The axis is always mapped to the object with the largest number of dimensions ndim_max. All other dataObjects are considered to also have ndim_max dimensions, where additional dimensions are prepended having a size of 1.
high-level method which stacks the planes of the input dataObjects to a three dimensional dataObject together.
The result is stored in a result matrix of the same plane size and type. Only one of the (n-2) dimensions is allowed to have a size greter than one.
- Parameters:
*mats – sequence of input DataObjects
*num – number elements in mats
axis – axis along which a stack is build (not yet implemented)
- Returns:
result dataObject