Into

Modules

Documentation

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>
( )

Creates a modifiable wrapper for mat that can be used as an IplImage in OpenCV function calls.

template<class T>
PiiIplImage< T, true >
( )

Creates a const wrapper for mat that can be used as an IplImage in OpenCV function calls.

Function details

  • PiiIplImage

    ( )
    [inline]
  • PiiIplImage

    ( )
    [inline]

    Creates a new IplImage wrapper that shares the pixel data with matrix.

    If the isConst template parameter is false, the shared data can be modified by OpenCV function calls. That is, the class can be casted to a non-const CvArr pointer. If isConst is true, a copy of the data will be created if it is still shared when a pointer to a CvArr is requested.

  • template<class T>

    PiiIplImage< T > iplImage

    ( )
    [inline]

    Creates a modifiable wrapper for mat that can be used as an IplImage in OpenCV function calls.

  • template<class T>

    PiiIplImage< T, true > iplImage

    ( )
    [inline]

    Creates a const wrapper for mat that can be used as an IplImage in OpenCV function calls.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.