Home > Software engineering >  Opencv1.0 how open the camera to capture image with this method
Opencv1.0 how open the camera to capture image with this method

Time:10-09

Int ncams=cvcamGetCamerasCount ();//return the number of cameras can access

The HWND MyWin;//get the control handle (IDC_VIDEO is picture controls)
CvcamSetProperty (0, CVCAM_PROP_ENABLE, CVCAMTRUE); Choose your first camera//
Int width=800;
Int height=600;
MyWin=: : GetDlgItem (m_hWnd, IDC_ShowImg);
CvcamSetProperty (0, CVCAM_PROP_WINDOW, & amp; MyWin);//Selects a window for
CvcamSetProperty (0, CVCAM_RNDWIDTH, & amp; Width);
CvcamSetProperty (0, CVCAM_RNDHEIGHT, & amp; Height);
CvcamSetProperty (0, CVCAM_PROP_CALLBACK, callback);//callback function will handle each frame

CvcamInit ();
CvcamStart ();
CvWaitKey (0);
CvcamStop ();
CvcamExit ();
return ;
My computer is win732, do a simple target tracking, use other ways to open the camera display is black, but this method but don't know how to collect images, strives for the guidance of the great god!!!!!!

CodePudding user response:

Should write a loop that constantly acquisition

CodePudding user response:

Advice to compile the first link debug OpenCV bring relevant example code,
  • Related