30 #ifndef _D_OPENCV_IMAGE_HPP
31 #define _D_OPENCV_IMAGE_HPP
33 #include <opencv/cv.h>
35 #include "Core/include/private/DImage.hxx"
36 #include "Core/include/private/DSharedImage.hpp"
61 BaseObject::className =
"OpenCVInt";
63 this->attach((T*)(_cvMat.data), _cvMat.size().width, _cvMat.size().height);
68 BaseObject::className =
"OpenCVInt";
70 this->attach((T*)(cvIm->imageData), cvIm->width, cvIm->height);
73 #if defined Py_PYCONFIG_H || defined SWIGPYTHON
88 ERR_MSG(
"input object is NULL.");
91 python_iplimage *pIm = (python_iplimage*)obj;
92 IplImage *cvIm = pIm->img;
95 ERR_MSG(
"Error: Input object must be an IplImage.");
98 BaseObject::className =
"OpenCVInt";
100 this->attach((T*)(cvIm->imageData), cvIm->width, cvIm->height, 1);
112 template<>
inline int getCvType<UINT8>() {
return CV_8UC1; }
113 template<>
inline int getCvType<UINT16>() {
return CV_16UC1; }
121 int cvType = getCvType<T>();
123 ASSERT(cvType!=-1,
"Data type conversion not implemented", cv::Mat())
size_t getWidth() const
Get image width.
Definition: DBaseImage.h:80
size_t getHeight() const
Get image height.
Definition: DBaseImage.h:85
Main Image class.
Definition: DImage.hpp:57
lineType getPixels() const
Get the pixels as a 1D array.
Definition: DImage.hpp:105
OpenCV Image Interface.
Definition: DOpenCVInterface.hpp:54
Image that uses an existing (1D) data pointer.
Definition: DSharedImage.hpp:51
OpenCVInt(cv::Mat &_cvMat)
Constructor.
Definition: DOpenCVInterface.hpp:59
cv::Mat toMatImage(Image< T > &im)
Create a OpneCV Mat from a Smil image (the data is copied)
Definition: DOpenCVInterface.hpp:119
OpenCVInt(IplImage *cvIm)
Constructor.
Definition: DOpenCVInterface.hpp:66
Definition: DOpenCVInterface.hpp:76