www.pudn.com > ColorSegment.rar > iplwrapper.h
#ifndef _UTIL_CVIMAGE_WRAPER_H #define _UTIL_CVIMAGE_WRAPER_H #include "cv.h" #include "highgui.h" templateclass Image { private: IplImage* imgp; public: Image(IplImage* img=0) {imgp=img;} ~Image(){imgp=0;} void operator=(IplImage* img) {imgp=img;} inline T* operator[](const int rowIndx) { return ((T *)(imgp->imageData + rowIndx*imgp->widthStep));} }; typedef struct{ unsigned char ch1,ch2,ch3; } DATA8UC3; typedef struct{ float ch1,ch2,ch3; } DATA32FC3; typedef Image Image8UC3; typedef Image Image32FC3; typedef Image Image8UC1; typedef Image Image32FC1; typedef Image Image32SC1; #endif