classPiiIplImage
#include <PiiOpenCv.h>
A class that makes it possible to reuse the data in a PiiMatrix in an IplImage.
Inherits PiiMatrix< T >
Description
Once created, the wrapper can be substituted to CvArr* or IplImage*
in OpenCV function calls. The isConst template
parameter determines if the shared data can be modified.
PiiMatrix<int> threshold(const PiiMatrix<int>& input) { PiiMatrix<int> matResult(50,50); cvAdaptiveThreshold(PiiOpenCv::iplImage(cvSource), PiiOpenCv::iplImage(matResult), 15.0); return matResult; }
This class is intended to be used only as a temporary object and should not be copied. Unless C++11 support is enabled, the compiler allows you to create a copy of an PiiIplImage object, but the CvArr pointer of the copied object will be zero after copying.
PiiMatrix<int> matTest(10,10); PiiIplImage<int> iplImage(matTest); PiiIplImage<int> iplImage2(iplImage); // moves data from iplImage to iplImage2 cvFunction(iplImage); // Crash, the data is null.
Public types
|
typedef Pii::If<
isConst, PiiConstCvArr< PiiIplImage< T >, IplImage
>, PiiCvArr< PiiIplImage< T >, IplImage
> >::Type
|
Constructors and destructor
|
|
|
|
Creates a new IplImage wrapper that shares the pixel data with matrix. |
Public member functions
|
template<class T>
PiiIplImage< T >
|
Creates a modifiable wrapper for |
|
template<class T>
PiiIplImage< T, true
>
|
Creates a const wrapper for |
Function details
-
-
Creates a new IplImage wrapper that shares the pixel data with matrix.
If the
isConsttemplate parameter isfalse, the shared data can be modified by OpenCV function calls. That is, the class can be casted to a non-const CvArr pointer. IfisConstistrue, a copy of the data will be created if it is still shared when a pointer to a CvArr is requested. -
Creates a modifiable wrapper for
matthat can be used as an IplImage in OpenCV function calls. -
Creates a const wrapper for
matthat can be used as an IplImage in OpenCV function calls.
Add a note
Not a single note added yet. Be the first, add yours.