1个回答
展开全部
一、OpenCV的方法(注:OpenCV 最新版本 http://opencv.org/
/* start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*) */
CVAPI(CvCapture*) cvCreateCameraCapture( int index );
/* grab a frame, return 1 on success, 0 on fail.
this function is thought to be fast */
CVAPI(int) cvGrabFrame( CvCapture* capture );
/* get the frame grabbed with cvGrabFrame(..)
This function may apply some frame processing like
frame decompression, flipping etc.
!!!DO NOT RELEASE or MODIFY the retrieved frame!!! */
CVAPI(IplImage*) cvRetrieveFrame( CvCapture* capture );
/* Just a combination of cvGrabFrame and cvRetrieveFrame
!!!DO NOT RELEASE or MODIFY the retrieved frame!!! */
CVAPI(IplImage*) cvQueryFrame( CvCapture* capture );
/* stop capturing/reading and free resources */
CVAPI(void) cvReleaseCapture( CvCapture** capture );
二、DirectDraw的方法
///////////////////////////////////////////////////////////////////////
// StartCapture: Begin capture to file
///////////////////////////////////////////////////////////////////////
HRESULT CDxVideoGraphBase::StartCapture()
{
// Set the start time to 0 and stop time to MAX_TIME
REFERENCE_TIME stop = MAX_TIME;
HRESULT hr = m_pCaptureGraphBuilder2->ControlStream(&PIN_CATEGORY_CAPTURE, NULL,
NULL, NULL, &stop, 0, 0);
return hr;
}
前提是你的采集卡驱动要完全安装好。
/* start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*) */
CVAPI(CvCapture*) cvCreateCameraCapture( int index );
/* grab a frame, return 1 on success, 0 on fail.
this function is thought to be fast */
CVAPI(int) cvGrabFrame( CvCapture* capture );
/* get the frame grabbed with cvGrabFrame(..)
This function may apply some frame processing like
frame decompression, flipping etc.
!!!DO NOT RELEASE or MODIFY the retrieved frame!!! */
CVAPI(IplImage*) cvRetrieveFrame( CvCapture* capture );
/* Just a combination of cvGrabFrame and cvRetrieveFrame
!!!DO NOT RELEASE or MODIFY the retrieved frame!!! */
CVAPI(IplImage*) cvQueryFrame( CvCapture* capture );
/* stop capturing/reading and free resources */
CVAPI(void) cvReleaseCapture( CvCapture** capture );
二、DirectDraw的方法
///////////////////////////////////////////////////////////////////////
// StartCapture: Begin capture to file
///////////////////////////////////////////////////////////////////////
HRESULT CDxVideoGraphBase::StartCapture()
{
// Set the start time to 0 and stop time to MAX_TIME
REFERENCE_TIME stop = MAX_TIME;
HRESULT hr = m_pCaptureGraphBuilder2->ControlStream(&PIN_CATEGORY_CAPTURE, NULL,
NULL, NULL, &stop, 0, 0);
return hr;
}
前提是你的采集卡驱动要完全安装好。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询