我定义了两个IPlImage变量
IPlImage* theReadImage;//读摄像头图像
IPlImage* theShowImage;//显示摄像头图像
CvCapture *capture
……
while(isread)
{
theReadImage=cvQueryFrame(capture);
theShowImage=cvCreateImageHeader(cvSize(theReadImage->width,theReadImage->height),8,3);
cvSetData(theShowImage->imageData,theReadImage->imageData,theReadImage->widthStep);
cvWaitKey(200);
if(theShowImage)
ShowImage(theShowImage);
}
……
其实直接显示theReadImage就可以了,也成功了,但我想试验一下将 theReadImage读到的图放到theShowImage里,因为还有别的用处。但程序运行到cvSetData这个函数这报错崩溃了,不知道哪里出问题了,请大神指点,不胜感激。