Ask Your Question
0

opencv use callback function Unhandled exception

asked Aug 16 '14

qmail03 gravatar image

updated Aug 16 '14

berak gravatar image

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

Preview: (hide)

Comments

  • chinese screenshots aren't helpful at all (to the rest of the world)
  • using opencv's deprecated c-api is a dead end.
  • did you ever try : VideoCapture("some://protocol/some/url"); instead ?
berak gravatar imageberak (Aug 16 '14)edit

1 answer

Sort by » oldest newest most voted
0

answered Aug 16 '14

Copy all the opencv dll files (look for them inside the OpenCV directory, which's the one you specified when installed the OpenCV library) to your Visual Studio Project DLLs directory. Finally, add the OpenCV dlls to your Visual Studio project dependencies (Solution Explorer, choose Property Pages from the View menu, select project dependencies from common properties).

Preview: (hide)

Question Tools

Stats

Asked: Aug 16 '14

Seen: 325 times

Last updated: Aug 16 '14