gpt4 book ai didi

c++ - 当 cvReleaseImage 时 SIGABRT

转载 作者:太空宇宙 更新时间:2023-11-03 22:16:07 24 4
gpt4 key购买 nike

我想我对指针感到困惑...

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->getFrame();
imgB1=vis->image;
cvAddWeighted(imgB0, 1./(float)2., imgB1,1./(float)2.,0,imgB1);
cvReleaseImage(&imgB0); //<-SIGABRT
...

视觉.h:

 class Vision
{
public:
IplImage* image;
...

视觉.cpp:

void Vision::getFrame()
{
image = cvQueryFrame(capture);
}

有什么想法吗?谢谢!

最佳答案

来自 HighGUI Reference Manual :

The returned image should not be released or modified by user.

您还泄露了您创建的两个 cvImage

关于c++ - 当 cvReleaseImage 时 SIGABRT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6665698/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com