SIGABRT when cvReleaseImage
I think I'm confusing with pointers...
Vision vis;
IplImage* imgB0=cvCreateImage(img_sz, IPL_DEPTH_32F, 1);
IplImage* imgB1=cvCreateImage(img_sz, IPL_DEPTH_32F, 1);
//Get next frame
vis->getFrame();
imgB0=vis->image;
usleep(3);
vis->g开发者_高级运维etFrame();
imgB1=vis->image;
cvAddWeighted(imgB0, 1./(float)2., imgB1,1./(float)2.,0,imgB1);
cvReleaseImage(&imgB0); //<-SIGABRT
...
Vision.h:
class Vision
{
public:
IplImage* image;
...
Vision.cpp:
void Vision::getFrame()
{
image = cvQueryFrame(capture);
}
Any ideas? Thanks!
FRom HighGUI Reference Manual:
The returned image should not be released or modified by user.
You're also leaking the two cvImage
s you create.
精彩评论