Replace CvMat with IplImage