img
is the name of the variable, might as well beblahblahblah
;IplImage
is the type of the variable, it's just astruct
that contains the image data itself plus some info (size, color depth, etc.) on the image;typedef struct _IplImage { int nSize; int ID; int nChannels; int alphaChannel; int depth; char colorModel[4]; char channelSeq[4]; int dataOrder; int origin; int align; int width; int height; struct _IplROI* roi; struct _IplImage* maskROI; void* imageId; struct _IplTileInfo* tileInfo; int imageSize; char* imageData; int widthStep; int BorderMode[4]; int BorderConst[4]; char* imageDataOrigin; } IplImage;
For more info on IplImage
: Other question about IplImage
cvLoadImage
provides a pointer to anIplImage
, which means it creates an IplImage when it loads it and returns you it's emplacement.
Do not forget to do cvReleaseImage(&img)
when you are finished with it, if you do not want to have memory leaks.