This class implements utility functions for the migration from OpenCV to Ocean.
More...
#include <OpenCVUtilities.h>
|
| static cv::Mat | toCvMat (const Frame &frame, const bool copy=false) |
| | Convert an Ocean Frame image to an OpenCV image.
|
| static Frame | toOceanFrame (const cv::Mat &frame, const bool copy=false, const FrameType::PixelFormat pixelFormat=FrameType::FORMAT_UNDEFINED) |
| | Convert an OpenCV image to an Ocean Frame image object.
|
| template<typename T> |
| static SquareMatrixT3< T > | toOceanSquareMatrix3 (const cv::Matx< T, 3, 3 > &matrix) |
| | Convert an OpenCV 3-by-3 matrix (row-major) to an Ocean SquareMatrix3 (column-wise order).
|
| template<typename T> |
| static SquareMatrixT3< T > | toOceanSquareMatrix3Affine (const cv::Matx< T, 2, 3 > &affineTransformation) |
| | Convert an OpenCV 2-by-3 matrix (row-major) to an Ocean SquareMatrix3 (column-major).
|
| template<typename T> |
| static cv::Matx< T, 3, 3 > | toCvMatx33 (const SquareMatrixT3< T > &matrix) |
| | Convert an Ocean SquareMatrix3 (column-major) to an OpenCV 3-by-3 matrix (row-major).
|
| template<typename T> |
| static cv::Matx< T, 2, 3 > | toCvMatx23Affine (const SquareMatrixT3< T > &affineTransformation) |
| | Convert an Ocean SquareMatrix3 (column-major) to an OpenCV 2-by-3 matrix (row-major).
|
| static bool | toCvDepth (const FrameType::DataType dataType, int &cvDepth) |
| | Converts an Ocean frame data type to a corresponding depth type in OpenCV.
|
| static bool | toOceanFrameTypeDataType (const int cvDepth, FrameType::DataType &dataType) |
| | Converts an OpenCV depth type to a corresponding Ocean frame data type.
|
This class implements utility functions for the migration from OpenCV to Ocean.
◆ toCvDepth()
| bool Ocean::CV::OpenCVUtilities::toCvDepth |
( |
const FrameType::DataType | dataType, |
|
|
int & | cvDepth ) |
|
inlinestatic |
Converts an Ocean frame data type to a corresponding depth type in OpenCV.
- Parameters
-
| dataType | The Ocean data type that will be converted |
| cvDepth | The corresponding OpenCV depth type |
- Returns
- True if a correspondence has been found, otherwise false
◆ toCvMat()
| cv::Mat Ocean::CV::OpenCVUtilities::toCvMat |
( |
const Frame & | frame, |
|
|
const bool | copy = false ) |
|
inlinestatic |
Convert an Ocean Frame image to an OpenCV image.
- Parameters
-
| frame | An image instance of the Ocean framework |
| copy | If true, the data will be copied to (and owned by) to OpenCV Mat. |
- Returns
- An OpenCV-based version of the input image, will be empty on failure
◆ toCvMatx23Affine()
template<typename T>
| cv::Matx< T, 2, 3 > Ocean::CV::OpenCVUtilities::toCvMatx23Affine |
( |
const SquareMatrixT3< T > & | affineTransformation | ) |
|
|
inlinestatic |
Convert an Ocean SquareMatrix3 (column-major) to an OpenCV 2-by-3 matrix (row-major).
- Parameters
-
- Template Parameters
-
| T | Type of the matrix elements (usually float or double) |
- Returns
- The corresponding affine transformation as a 2-by-3 OpenCV matrix
◆ toCvMatx33()
template<typename T>
| cv::Matx< T, 3, 3 > Ocean::CV::OpenCVUtilities::toCvMatx33 |
( |
const SquareMatrixT3< T > & | matrix | ) |
|
|
inlinestatic |
Convert an Ocean SquareMatrix3 (column-major) to an OpenCV 3-by-3 matrix (row-major).
- Parameters
-
- Template Parameters
-
| T | Type of the matrix elements (usually float or double) |
- Returns
- OpenCV instance of a 3-by-3 matrix
◆ toOceanFrame()
Convert an OpenCV image to an Ocean Frame image object.
- Parameters
-
| frame | The OpenCV image to be converted |
| pixelFormat | OpenCV image types do not store the pixel format. For images with 2 or more channels, specify the pixel format. |
| copy | If true, the data will be copied to (and owned by) to Ocean frame |
- Returns
- An Ocean-based version of the input image, will be invalid on failure
◆ toOceanFrameTypeDataType()
| bool Ocean::CV::OpenCVUtilities::toOceanFrameTypeDataType |
( |
const int | cvDepth, |
|
|
FrameType::DataType & | dataType ) |
|
inlinestatic |
Converts an OpenCV depth type to a corresponding Ocean frame data type.
- Parameters
-
| cvDepth | The OpenCV depth type that will be converted |
| dataType | The corresponding Ocean data type |
- Returns
- True if a correspondence has been found, otherwise false
◆ toOceanSquareMatrix3()
template<typename T>
| SquareMatrixT3< T > Ocean::CV::OpenCVUtilities::toOceanSquareMatrix3 |
( |
const cv::Matx< T, 3, 3 > & | matrix | ) |
|
|
inlinestatic |
Convert an OpenCV 3-by-3 matrix (row-major) to an Ocean SquareMatrix3 (column-wise order).
- Parameters
-
| matrix | An OpenCV instance of a 3-by-3 matrix |
- Template Parameters
-
| T | Type of the matrix elements (usually float or double) |
- Returns
- The corresponding Ocean matrix
◆ toOceanSquareMatrix3Affine()
template<typename T>
| SquareMatrixT3< T > Ocean::CV::OpenCVUtilities::toOceanSquareMatrix3Affine |
( |
const cv::Matx< T, 2, 3 > & | affineTransformation | ) |
|
|
inlinestatic |
Convert an OpenCV 2-by-3 matrix (row-major) to an Ocean SquareMatrix3 (column-major).
- Parameters
-
| affineTransformation | An OpenCV instance of a 2-by-3 matrix (OpenCV assumes the third row to be [0, 0, 1]) |
- Template Parameters
-
| T | Type of the matrix elements (usually float or double) |
- Returns
- The corresponding affine transformation Ocean matrix (third row is [0, 0, 1])
The documentation for this class was generated from the following file: