Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The line

IplImage *ResultImage       = cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);

should be

IplImage *ResultImage       = cvCreateImage(cvSize(width,height),IPL_DEPTH_8U,1);

Or you need to use cvSetData() on ResultImage before passing to cvAbsDiff()

like

cvSetData( ResultImage, CurrentFrame, width );