Ask Your Question
0

opencv use callback function Unhandled exception

asked 2014-08-16 09:05:24 -0600

qmail03 gravatar image

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

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

edit retag flag offensive close merge delete

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 ( 2014-08-16 14:32:14 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-08-16 15:23:37 -0600

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).

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-08-16 09:05:24 -0600

Seen: 274 times

Last updated: Aug 16 '14