image source相机snap模式采集
来源:互联网 发布:大数据总监岗位职责 编辑:程序博客网 时间:2024/06/05 14:44
</pre><p></p><p></p><pre name="code" class="html">// snapimage.cpp : 定义控制台应用程序的入口点。/#include <iostream>///添加相机需要的头文件#include <tisudshl.h>#include "../Common/CmdHelper.h"///添加所需要的名词空间using namespace _DSHOWLIB_NAMESPACE;int _tmain(int argc, _TCHAR* argv[]){////初始化的类库DShowLib::InitLibrary();///创建采集对象Grabber grabber;//显示相机的参数设置的属性页,同时保存相机的设置if( !setupDeviceFromFile( grabber ) ){return -1;} ////创建的相机采集的图像的格式内存tFrameHandlerSinkPtr pSink= FrameHandlerSink::create(eY800,1);///设计采集图像的模式,设置true为snap采图模式,设置false为grab采集模式pSink->setSnapMode(true);////将采集程序和内存设置为pSinkgrabber.setSinkType(pSink);////判断程序采集程序是否打开if (!grabber.prepareLive(false)){std::cerr<<"无法将视频格式转化为eY800格式";return -1;//退出程序} ////FrameTypeInfo info;pSink->getOutputFrameType(info);/////创建8位字节的内存,用于输出图像数据 BYTE *pbuf[5];for (int i=0;i<5;++i){pbuf[i]=new BYTE[info.buffersize];///获取每张图片需要的内存}////// tMemBufferCollectionPtr pCollection = MemBufferCollection::create( info, 5, pbuf ); ////Start live mode for fast snapping. The live video will not be displayed, // because false is passed to startLive(). grabber.startLive( false ); /////采集5幅图像 pSink->snapImages( 5 ); //关闭采集的对象 grabber.closeDev(); //关闭对象 grabber.stopLive(); ///释放所创建的内存 pCollection->save("file*.bmp");
///释放中间所创建的内存 for (int j=0;j<5;++j) { delete pbuf[j]; }return 0;}
<pre name="code" class="cpp">grabber.startLive( false );
/////采集5幅图像
pSink->snapImages( 5 );
snap image() 以及startlive被注释之后仍然可以采集到图像,这是什么情况?
1 0
- image source相机snap模式采集
- image soure相机的snap采图方式
- 是手机还是相机,Snap绝对够装逼
- basler相机采集程序
- Image.Source 如何绑定
- image 相机vc+环境配置
- Silverlight 之 image source 绑定
- FlyCapture2相机的连接和图像采集
- halcon+大恒水星相机图像采集
- Basler工业相机基于opencv 采集图像
- 工业相机采集帧回调函数
- 关于两台GigE相机采集
- remap(result, // source image image, // destination image srcX, // x map
- 封装相机功能->>>>>block返回image
- 相机拍照常见模式
- silverlight image绑定bitmap( Binding Image.Source from downloaded memory)
- wpf image绑定bitmap( Binding Image.Source from download memory)
- The source of image UBB codes creator
- Unity5.0状态机
- 设计模式-桥接模式(Bridge Pattern)
- 2015 Multi-University Training Contest 2
- android 命令获取手机中项目数据库
- typeof 与GetType()的区别
- image source相机snap模式采集
- 802.1x
- activity之间传递List<E>值
- 拼写纠错
- mangle nat filter
- UICollectionViewCell的使用
- HDU
- 理解RESTful架构
- 春夜宴诸从弟桃李园序 李白