开发者

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 cvImages you create.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜