开发者

How to release a IplImage created by imdecode

I don't know how to free memory in the case of an IplImage created like this:

Mat matrixJpeg = cv::imdecode(Mat(jpegBuffer), 1);
IplImage fIplImageHeader = matrixJpeg;

This won't work:

cvReleaseImage(&fIplImageHeader);

I will get error:

1   IntelliSense: argument of type "IplImage *" is incompatible with parameter of type "IplImage **"    c:\users\richard\documents\visual studio 2010\projects\server\server\server.cpp 59  19  Server

This won't work either:

cvReleaseImage(fIplImageHeader);

I will get error:

1   IntelliSense: no suitable conversion function from "IplImage" to "IplImage **" exists   c:\users\richard\documents\visual studio 2010\projects\server\server\server.cpp 59  19  Server

Any s开发者_如何转开发uggestions?


Your example is not dealing with pointers. The memory is on the stack you have nothing to release until the end of scope.

The operator IplImage() const from Mat specifies that no data is copied.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜