Sometime we may only got rgb data from source, so we have to build valid IplImage pointer. This sample shows that how to change rgb data to IplImage. 有時我們只會收到rgb資料,所以要自己建立有效的IplImage,以下是將rgb資料轉成IplImage。 VARIABLE DEFINITION 變量定義 rgbtexture raw rgb data get from the camera | 由視訊傳來的rgb原始資料 cpimg IplImage to store the RAW rgb data | 用來存rgb原始資料的IplImage變量 arr simple opencv data format | 基本的opencv的資料格式 According to IplImage definition | 根據IplImage的定義 typedef struct _IplImage { int nSize; /* sizeof(IplImage) */ int ID; /* version (=0)*/ int nChannels; /* Most of OpenCV functions support 1,2,3 or 4 channels */ int alphaChannel; /* Ignored by OpenCV */ int depth; /* Pixel depth in bits: IPL_DEPTH_8U, IPL_DEPTH_8S, IPL_DEPTH_16S,IPL_DEPTH_32S, IPL_DEPTH_32F and IPL_DEPTH_64F are supported. */ char colorModel[4]; /* Ignored by OpenCV */