OpenCV  3.1.0
Open Source Computer Vision
Public Member Functions | Static Public Member Functions | List of all members
cv::bridge::Bridge Class Reference

Type conversion class for converting OpenCV and native C++ types. More...

#include "bridge.hpp"

Public Member Functions

 Bridge ()
 
 Bridge (const matlab::MxArray &obj)
 
 Bridge (const mxArray *obj)
 
virtual ~Bridge ()
 
bool empty () const
 
template<typename Object >
Object * getObjectByName (const std::string &name)
 unpack an object from Matlab into C++ More...
 
 operator bool ()
 
 operator cv::Mat () const
 
 operator cv::Moments () const
 
 operator cv::Point () const
 
 operator cv::Point2d () const
 
 operator cv::Point2f () const
 
 operator cv::Rect ()
 
 operator cv::RNG ()
 
 operator cv::RotatedRect ()
 
 operator cv::Scalar ()
 
 operator cv::Size () const
 
 operator cv::TermCriteria ()
 
 operator double ()
 
 operator float ()
 
 operator Ptr_AlignMTB ()
 
 operator Ptr_CalibrateDebevec ()
 
 operator Ptr_CalibrateRobertson ()
 
 operator Ptr_CLAHE ()
 
 operator Ptr_DenseOpticalFlow ()
 
 operator Ptr_DualTVL1OpticalFlow ()
 
 operator Ptr_FeatureDetector ()
 
 operator Ptr_LineSegmentDetector ()
 
 operator Ptr_MergeDebevec ()
 
 operator Ptr_MergeMertens ()
 
 operator Ptr_MergeRobertson ()
 
 operator Ptr_StereoBM ()
 
 operator Ptr_StereoSGBM ()
 
 operator Ptr_Stitcher ()
 
 operator Ptr_Tonemap ()
 
 operator Ptr_TonemapDrago ()
 
 operator Ptr_TonemapDurand ()
 
 operator Ptr_TonemapMantiuk ()
 
 operator Ptr_TonemapReinhard ()
 
 operator std::string ()
 
 operator vector_float ()
 
 operator vector_int ()
 
 operator vector_KeyPoint ()
 
 operator vector_Mat ()
 
 operator vector_Point ()
 
 operator vector_Rect ()
 
 operator vector_String ()
 
 operator vector_uchar ()
 
 operator vector_vector_char ()
 
 operator vector_vector_DMatch ()
 
Bridgeoperator= (const mxArray *obj)
 
Bridgeoperator= (const matlab::MxArray &obj)
 
Bridgeoperator= (const cv::Mat &mat)
 
Bridgeoperator= (const std::string &)
 
Bridgeoperator= (const bool &)
 
Bridgeoperator= (const double &)
 
Bridgeoperator= (const float &)
 
Bridgeoperator= (const int &)
 
Bridgeoperator= (const cv::Point &)
 
Bridgeoperator= (const cv::Point2f &)
 
Bridgeoperator= (const cv::Point2d &)
 
Bridgeoperator= (const cv::Size &)
 
Bridgeoperator= (const cv::Moments &)
 
Bridgeoperator= (const cv::Scalar &)
 
Bridgeoperator= (const cv::Rect &)
 
Bridgeoperator= (const cv::RotatedRect &)
 
Bridgeoperator= (const cv::TermCriteria &)
 
Bridgeoperator= (const cv::RNG &)
 
Bridgeoperator= (const vector_Mat &)
 
Bridgeoperator= (const vector_int &)
 
Bridgeoperator= (const vector_float &)
 
Bridgeoperator= (const vector_Rect &)
 
Bridgeoperator= (const vector_KeyPoint &)
 
Bridgeoperator= (const vector_String &)
 
Bridgeoperator= (const vector_Point &)
 
Bridgeoperator= (const vector_uchar &)
 
Bridgeoperator= (const vector_vector_char &)
 
Bridgeoperator= (const vector_vector_DMatch &)
 
Bridgeoperator= (const Ptr_StereoBM &)
 
Bridgeoperator= (const Ptr_StereoSGBM &)
 
Bridgeoperator= (const Ptr_FeatureDetector &)
 
Bridgeoperator= (const Ptr_CLAHE &)
 
Bridgeoperator= (const Ptr_LineSegmentDetector &)
 
Bridgeoperator= (const Ptr_AlignMTB &)
 
Bridgeoperator= (const Ptr_CalibrateDebevec &)
 
Bridgeoperator= (const Ptr_CalibrateRobertson &)
 
Bridgeoperator= (const Ptr_DenseOpticalFlow &)
 
Bridgeoperator= (const Ptr_DualTVL1OpticalFlow &)
 
Bridgeoperator= (const Ptr_MergeDebevec &)
 
Bridgeoperator= (const Ptr_MergeMertens &)
 
Bridgeoperator= (const Ptr_MergeRobertson &)
 
Bridgeoperator= (const Ptr_Stitcher &)
 
Bridgeoperator= (const Ptr_Tonemap &)
 
Bridgeoperator= (const Ptr_TonemapDrago &)
 
Bridgeoperator= (const Ptr_TonemapDurand &)
 
Bridgeoperator= (const Ptr_TonemapMantiuk &)
 
Bridgeoperator= (const Ptr_TonemapReinhard &)
 
bool toBool ()
 
double toDouble ()
 
float toFloat ()
 
int toInt ()
 
cv::Mat toMat () const
 
template<typename Scalar >
cv::Mat toMat () const
 
cv::Moments toMoments () const
 
matlab::MxArray toMxArray ()
 
cv::Point toPoint () const
 
cv::Point2d toPoint2d () const
 
cv::Point2f toPoint2f () const
 
Ptr_AlignMTB toPtrAlignMTB ()
 
Ptr_CalibrateDebevec toPtrCalibrateDebevec ()
 
Ptr_CalibrateRobertson toPtrCalibrateRobertson ()
 
Ptr_CLAHE toPtrCLAHE ()
 
Ptr_DenseOpticalFlow toPtrDenseOpticalFlow ()
 
Ptr_DualTVL1OpticalFlow toPtrDualTVL1OpticalFlow ()
 
Ptr_FeatureDetector toPtrFeatureDetector ()
 
Ptr_LineSegmentDetector toPtrLineSegmentDetector ()
 
Ptr_MergeDebevec toPtrMergeDebevec ()
 
Ptr_MergeMertens toPtrMergeMertens ()
 
Ptr_MergeRobertson toPtrMergeRobertson ()
 
Ptr_StereoBM toPtrStereoBM ()
 
Ptr_StereoSGBM toPtrStereoSGBM ()
 
Ptr_Stitcher toPtrStitcher ()
 
Ptr_Tonemap toPtrTonemap ()
 
Ptr_TonemapDrago toPtrTonemapDrago ()
 
Ptr_TonemapDurand toPtrTonemapDurand ()
 
Ptr_TonemapMantiuk toPtrTonemapMantiuk ()
 
Ptr_TonemapReinhard toPtrTonemapReinhard ()
 
cv::Rect toRect ()
 
cv::RNG toRNG ()
 explicit conversion to cv::RNG() More...
 
cv::RotatedRect toRotatedRect ()
 
cv::Scalar toScalar ()
 
cv::Size toSize () const
 
std::string toString ()
 
cv::TermCriteria toTermCriteria ()
 
vector_float toVectorFloat ()
 
vector_int toVectorInt ()
 
vector_KeyPoint toVectorKeyPoint ()
 
vector_Mat toVectorMat ()
 
vector_Point toVectorPoint ()
 
vector_Rect toVectorRect ()
 
vector_String toVectorString ()
 
vector_uchar toVectorUchar ()
 
vector_vector_char toVectorVectorChar ()
 
vector_vector_DMatch toVectorVectorDMatch ()
 

Static Public Member Functions

template<typename Scalar >
static matlab::MxArray FromMat (const cv::Mat &mat)
 

Detailed Description

Type conversion class for converting OpenCV and native C++ types.

Bridge provides an interface for converting between OpenCV/C++ types to Matlab's mxArray format.

Each type conversion requires three operators: // conversion from ObjectType –> Bridge Bridge& operator=(const ObjectType&); // implicit conversion from Bridge –> ObjectType operator ObjectType(); // explicit conversion from Bridge –> ObjectType ObjectType toObjectType();

The bridging class provides common conversions between OpenCV types, std and stl types to Matlab's mxArray format. By inheriting Bridge, you can add your own custom type conversions.

Because Matlab uses a homogeneous storage type, all operations are provided relative to Matlab's type. That is, Bridge always stores an matlab::MxArray object and converts to and from other object types on demand.

NOTE: for the explicit conversion function, the object name must be in UpperCamelCase, for example: int –> toInt my_object –> MyObject my_Object –> MyObject myObject –> MyObject this is because the binding generator standardises the calling syntax.

Bridge attempts to make as few assumptions as possible, however in some cases where 1-to-1 mappings don't exist, some assumptions are necessary. In particular:

Constructor & Destructor Documentation

cv::bridge::Bridge::Bridge ( )
inline
virtual cv::bridge::Bridge::~Bridge ( )
inlinevirtual
cv::bridge::Bridge::Bridge ( const matlab::MxArray obj)
inline
cv::bridge::Bridge::Bridge ( const mxArray *  obj)
inline

Member Function Documentation

bool cv::bridge::Bridge::empty ( ) const
inline
template<typename Scalar >
static matlab::MxArray cv::bridge::Bridge::FromMat ( const cv::Mat mat)
inlinestatic
template<typename Object >
Object* cv::bridge::Bridge::getObjectByName ( const std::string &  name)
inline

unpack an object from Matlab into C++

this function checks whether the given bridge is derived from an object in Matlab. If so, it converts it to a (platform dependent) pointer to the underlying C++ object.

NOTE! This function assumes that the C++ pointer is stored in inst_

cv::bridge::Bridge::operator bool ( )
inline
cv::bridge::Bridge::operator cv::Mat ( ) const
inline
cv::bridge::Bridge::operator cv::Moments ( ) const
inline
cv::bridge::Bridge::operator cv::Point ( ) const
inline
cv::bridge::Bridge::operator cv::Point2d ( ) const
inline
cv::bridge::Bridge::operator cv::Point2f ( ) const
inline
cv::bridge::Bridge::operator cv::Rect ( )
inline
cv::bridge::Bridge::operator cv::RNG ( )
inline
cv::bridge::Bridge::operator cv::RotatedRect ( )
inline
cv::bridge::Bridge::operator cv::Scalar ( )
inline
cv::bridge::Bridge::operator cv::Size ( ) const
inline
cv::bridge::Bridge::operator cv::TermCriteria ( )
inline
cv::bridge::Bridge::operator double ( )
inline
cv::bridge::Bridge::operator float ( )
inline
cv::bridge::Bridge::operator Ptr_AlignMTB ( )
inline
cv::bridge::Bridge::operator Ptr_CalibrateDebevec ( )
inline
cv::bridge::Bridge::operator Ptr_CalibrateRobertson ( )
inline
cv::bridge::Bridge::operator Ptr_CLAHE ( )
inline
cv::bridge::Bridge::operator Ptr_DenseOpticalFlow ( )
inline
cv::bridge::Bridge::operator Ptr_DualTVL1OpticalFlow ( )
inline
cv::bridge::Bridge::operator Ptr_FeatureDetector ( )
inline
cv::bridge::Bridge::operator Ptr_LineSegmentDetector ( )
inline
cv::bridge::Bridge::operator Ptr_MergeDebevec ( )
inline
cv::bridge::Bridge::operator Ptr_MergeMertens ( )
inline
cv::bridge::Bridge::operator Ptr_MergeRobertson ( )
inline
cv::bridge::Bridge::operator Ptr_StereoBM ( )
inline
cv::bridge::Bridge::operator Ptr_StereoSGBM ( )
inline
cv::bridge::Bridge::operator Ptr_Stitcher ( )
inline
cv::bridge::Bridge::operator Ptr_Tonemap ( )
inline
cv::bridge::Bridge::operator Ptr_TonemapDrago ( )
inline
cv::bridge::Bridge::operator Ptr_TonemapDurand ( )
inline
cv::bridge::Bridge::operator Ptr_TonemapMantiuk ( )
inline
cv::bridge::Bridge::operator Ptr_TonemapReinhard ( )
inline
cv::bridge::Bridge::operator std::string ( )
inline
cv::bridge::Bridge::operator vector_float ( )
inline
cv::bridge::Bridge::operator vector_int ( )
inline
cv::bridge::Bridge::operator vector_KeyPoint ( )
inline
cv::bridge::Bridge::operator vector_Mat ( )
inline
cv::bridge::Bridge::operator vector_Point ( )
inline
cv::bridge::Bridge::operator vector_Rect ( )
inline
cv::bridge::Bridge::operator vector_String ( )
inline
cv::bridge::Bridge::operator vector_uchar ( )
inline
cv::bridge::Bridge::operator vector_vector_char ( )
inline
cv::bridge::Bridge::operator vector_vector_DMatch ( )
inline
Bridge& cv::bridge::Bridge::operator= ( const mxArray *  obj)
inline
Bridge& cv::bridge::Bridge::operator= ( const matlab::MxArray obj)
inline
Bridge& cv::bridge::Bridge::operator= ( const std::string &  )
inline
Bridge& cv::bridge::Bridge::operator= ( const bool &  )
inline
Bridge& cv::bridge::Bridge::operator= ( const double &  )
inline
Bridge& cv::bridge::Bridge::operator= ( const float &  )
inline
Bridge& cv::bridge::Bridge::operator= ( const int &  )
inline
Bridge& cv::bridge::Bridge::operator= ( const cv::Point )
inline
Bridge& cv::bridge::Bridge::operator= ( const cv::Point2f )
inline
Bridge& cv::bridge::Bridge::operator= ( const cv::Point2d )
inline
Bridge& cv::bridge::Bridge::operator= ( const cv::Size )
inline
Bridge& cv::bridge::Bridge::operator= ( const cv::Moments )
inline
Bridge& cv::bridge::Bridge::operator= ( const cv::Scalar )
inline
Bridge& cv::bridge::Bridge::operator= ( const cv::Rect )
inline
Bridge& cv::bridge::Bridge::operator= ( const cv::RotatedRect )
inline
Bridge& cv::bridge::Bridge::operator= ( const cv::TermCriteria )
inline
Bridge& cv::bridge::Bridge::operator= ( const cv::RNG )
inline
Bridge& cv::bridge::Bridge::operator= ( const vector_Mat )
inline
Bridge& cv::bridge::Bridge::operator= ( const vector_int )
inline
Bridge& cv::bridge::Bridge::operator= ( const vector_float )
inline
Bridge& cv::bridge::Bridge::operator= ( const vector_Rect )
inline
Bridge& cv::bridge::Bridge::operator= ( const vector_KeyPoint )
inline
Bridge& cv::bridge::Bridge::operator= ( const vector_String )
inline
Bridge& cv::bridge::Bridge::operator= ( const vector_Point )
inline
Bridge& cv::bridge::Bridge::operator= ( const vector_uchar )
inline
Bridge& cv::bridge::Bridge::operator= ( const vector_vector_char )
inline
Bridge& cv::bridge::Bridge::operator= ( const vector_vector_DMatch )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_StereoBM )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_StereoSGBM )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_FeatureDetector )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_CLAHE )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_LineSegmentDetector )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_AlignMTB )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_CalibrateDebevec )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_CalibrateRobertson )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_DenseOpticalFlow )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_DualTVL1OpticalFlow )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_MergeDebevec )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_MergeMertens )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_MergeRobertson )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_Stitcher )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_Tonemap )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_TonemapDrago )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_TonemapDurand )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_TonemapMantiuk )
inline
Bridge& cv::bridge::Bridge::operator= ( const Ptr_TonemapReinhard )
inline
bool cv::bridge::Bridge::toBool ( )
inline
double cv::bridge::Bridge::toDouble ( )
inline
float cv::bridge::Bridge::toFloat ( )
inline
int cv::bridge::Bridge::toInt ( )
inline
template<typename Scalar >
cv::Mat cv::bridge::Bridge::toMat ( ) const
inline
cv::Moments cv::bridge::Bridge::toMoments ( ) const
inline
matlab::MxArray cv::bridge::Bridge::toMxArray ( )
inline
cv::Point cv::bridge::Bridge::toPoint ( ) const
inline
cv::Point2d cv::bridge::Bridge::toPoint2d ( ) const
inline
cv::Point2f cv::bridge::Bridge::toPoint2f ( ) const
inline
Ptr_AlignMTB cv::bridge::Bridge::toPtrAlignMTB ( )
inline
Ptr_CalibrateDebevec cv::bridge::Bridge::toPtrCalibrateDebevec ( )
inline
Ptr_CalibrateRobertson cv::bridge::Bridge::toPtrCalibrateRobertson ( )
inline
Ptr_CLAHE cv::bridge::Bridge::toPtrCLAHE ( )
inline
Ptr_DenseOpticalFlow cv::bridge::Bridge::toPtrDenseOpticalFlow ( )
inline
Ptr_DualTVL1OpticalFlow cv::bridge::Bridge::toPtrDualTVL1OpticalFlow ( )
inline
Ptr_FeatureDetector cv::bridge::Bridge::toPtrFeatureDetector ( )
inline
Ptr_LineSegmentDetector cv::bridge::Bridge::toPtrLineSegmentDetector ( )
inline
Ptr_MergeDebevec cv::bridge::Bridge::toPtrMergeDebevec ( )
inline
Ptr_MergeMertens cv::bridge::Bridge::toPtrMergeMertens ( )
inline
Ptr_MergeRobertson cv::bridge::Bridge::toPtrMergeRobertson ( )
inline
Ptr_StereoBM cv::bridge::Bridge::toPtrStereoBM ( )
inline
Ptr_StereoSGBM cv::bridge::Bridge::toPtrStereoSGBM ( )
inline
Ptr_Stitcher cv::bridge::Bridge::toPtrStitcher ( )
inline
Ptr_Tonemap cv::bridge::Bridge::toPtrTonemap ( )
inline
Ptr_TonemapDrago cv::bridge::Bridge::toPtrTonemapDrago ( )
inline
Ptr_TonemapDurand cv::bridge::Bridge::toPtrTonemapDurand ( )
inline
Ptr_TonemapMantiuk cv::bridge::Bridge::toPtrTonemapMantiuk ( )
inline
Ptr_TonemapReinhard cv::bridge::Bridge::toPtrTonemapReinhard ( )
inline
cv::Rect cv::bridge::Bridge::toRect ( )
inline
cv::RNG cv::bridge::Bridge::toRNG ( )
inline

explicit conversion to cv::RNG()

Converts a bridge object to a cv::RNG(). We explicitly assert that the object is an RNG in matlab space before attempting to deference its pointer

cv::RotatedRect cv::bridge::Bridge::toRotatedRect ( )
inline
cv::Scalar cv::bridge::Bridge::toScalar ( )
inline
cv::Size cv::bridge::Bridge::toSize ( ) const
inline
std::string cv::bridge::Bridge::toString ( )
inline
cv::TermCriteria cv::bridge::Bridge::toTermCriteria ( )
inline
vector_float cv::bridge::Bridge::toVectorFloat ( )
inline
vector_int cv::bridge::Bridge::toVectorInt ( )
inline
vector_KeyPoint cv::bridge::Bridge::toVectorKeyPoint ( )
inline
vector_Mat cv::bridge::Bridge::toVectorMat ( )
inline
vector_Point cv::bridge::Bridge::toVectorPoint ( )
inline
vector_Rect cv::bridge::Bridge::toVectorRect ( )
inline
vector_String cv::bridge::Bridge::toVectorString ( )
inline
vector_uchar cv::bridge::Bridge::toVectorUchar ( )
inline
vector_vector_char cv::bridge::Bridge::toVectorVectorChar ( )
inline
vector_vector_DMatch cv::bridge::Bridge::toVectorVectorDMatch ( )
inline

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