我在 Opencv 中创建了这段代码,大约 900 帧后,出现了这个错误:
OpenCV Error: Insufficient memory (Failed to allocate 921600 bytes) in function, file ..\..\..\..\ocv\opencv\src\cxcore\cxalloc.cpp, line 52
但我已经初始化了一次变量。这是代码:
int _tmain(int argc, _TCHAR* argv[])
{
IplImage * image;
CvCapture * capture = cvCaptureFromCAM ( 0 );
while ( 1 ){
image = cvCreateImage ( cvSize ( 640,480 ) , 8, 3 );
image = cvQueryFrame ( capture );
cvShowImage ( "test", image );
cvWaitKey ( 10 );
}
}