Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

opencv ues callback function Unhandled exception

my ipcam have SDK,there is a callback function to read the image data,below is the code.When I use opencv read and display the picture, it will display an error,Unhandled exception .But I use printf ("% lld", pBuffer); does not make mistakes,why?

//CODE-----------------------------------

void CALLBACK RealDataCallBackEx(LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer,DWORD dwBufSize, LONG lParam,

DWORD dwUser)

{ IplImage* frame; frame = cvCreateImageHeader(cvSize(1280,720),IPL_DEPTH_8U,3);

   cvSetData(frame,pBuffer,1280*3);

   printf("%lld",pBuffer);
   printf("\n");
   printf("%lld",frame);

//The following code will go wrong

  cvNamedWindow("img");
    cvShowImage("img",frame);

} image description image description

click to hide/show revision 2
No.2 Revision

updated 2014-08-16 14:34:38 -0600

berak gravatar image

opencv ues use callback function Unhandled exception

my ipcam have SDK,there is a callback function to read the image data,below is the code.When I use opencv read and display the picture, it will display an error,Unhandled exception .But I use printf ("% lld", pBuffer); does not make mistakes,why?

//CODE-----------------------------------

void CALLBACK RealDataCallBackEx(LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer,DWORD dwBufSize, LONG lParam,

DWORD dwUser)

{ IplImage* frame; frame = cvCreateImageHeader(cvSize(1280,720),IPL_DEPTH_8U,3);

   cvSetData(frame,pBuffer,1280*3);

   printf("%lld",pBuffer);
   printf("\n");
   printf("%lld",frame);

//The following code will go wrong

  cvNamedWindow("img");
    cvShowImage("img",frame);

} image description image description