Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to convert Vimba FramePtr to IplImage?

I need to convert Vimba FramePtr to opencv IplImage. How to do it?

How to convert Vimba FramePtr to IplImage?Memory leaks in IplImage

I need have the function, which is leaking memory:

void CAsynchronousGrabDlg::ComputeVariables(FramePtr pFrame) { IplImage *testImage; byte *imageData; pFrame -> GetImage(imageData); VmbUint32_t nWidth, nHeight; nWidth = m_pApiController->GetWidth(); nHeight = m_pApiController->GetHeight(); testImage = cvCreateImage(cvSize(nWidth, nHeight), IPL_DEPTH_8U, 1); cvSetData(testImage, imageData, nWidth);

// delete imageData; // delete testImage; } If I try to convert Vimba FramePtr use delete function, for example delete imageData or delete testImage, I get memory assertion. Can someone tell me, how to opencv IplImage. How to do it?correctly deallocate memory for these functions?

Memory leaks in IplImage

I have the function, which is leaking memory:

void CAsynchronousGrabDlg::ComputeVariables(FramePtr pFrame)
{
IplImage *testImage;
byte *imageData;
pFrame -> GetImage(imageData);
VmbUint32_t nWidth, nHeight;
nWidth = m_pApiController->GetWidth();
nHeight = m_pApiController->GetHeight();
testImage = cvCreateImage(cvSize(nWidth, nHeight), IPL_DEPTH_8U, 1);
cvSetData(testImage, imageData, nWidth);

nWidth);

// delete imageData; // delete testImage; }

If I try to use delete function, for example delete imageData or delete testImage, I get memory assertion. Can someone tell me, how to correctly deallocate memory for these functions?