资源简介
MATRIX VISION品牌相机(mvIMPACT驱动) SDK调用例程,实现自由采集、软触发、硬触发模式,经工业项目测试。
代码片段和文件信息
#include “StdAfx.h“
#include “MvCamera.h“
MvCamera::MvCamera(void)
{
m_pMgr = new DeviceManager();
m_maxCount = 3;
m_isopen = false;
m_isgrab = false;
}
MvCamera::~MvCamera(void)
{
if (m_isopen)
{
CloseCamera();
}
if (m_pMgr != NULL)
{
delete m_pMgr;
m_pMgr = NULL;
}
}
long MvCamera::GetCameraList(vector& camlist)
{
camlist.clear();
int devCnt = m_pMgr->deviceCount();
if (devCnt > 0)
{
for(int i = 0; i < devCnt; i++ )
{
Device* pDev = m_pMgr->getDevice(i);
if( pDev )
{
string sn = pDev->serial.read();
camlist.push_back(sn);
}
}
}
return devCnt;
}
long MvCamera::OpenCamera(string sn)
{
if (sn.length() > 1)
{
m_pDev = m_pMgr->getDeviceBySerial(sn);
if(m_pDev)
{
m_pDev->interfaceLayout.write(dilGenICam);
m_pDev->acquisitionstartStopBehaviour.write( assbUser );
m_pDev->userControlledImageProcessingEnable.write(bTrue);
m_pDev->open();
m_isopen = true;
//抓图操作的接口类
m_function = new FunctionInterface(m_pDev);
m_acquisitionControl = new AcquisitionControl( m_pDev );
m_analogControl = new AnalogControl( m_pDev );
m_imageFormatControl = new ImageFormatControl( m_pDev );
m_imagedestination = new ImageDestination( m_pDev );
m_systemSetting = new SystemSettings(m_pDev);
//设置图像对列
m_maxCount = m_acquisitionControl->mvAcquisitionMemoryMaxframeCount.read();
m_systemSetting->requestCount.write(m_maxCount);
BasicDeviceSettings pBasicDeviceSettings(m_pDev);
PropertyI timeOutProp = pBasicDeviceSettings.imageRequestTimeout_ms;
timeOutProp.write(0);
SetGrabMode(MV_Software);
StartAcquire();
return 0;
}
}
return -1;
}
long MvCamera::CloseCamera()
{
if(m_isgrab) StopAcquire();
if(m_isopen)
{
if(m_imagedestination != NULL)
{
delete m_imagedestination;
m_imagedestination = NULL;
}
if(m_imageFormatControl != NULL)
{
delete m_imageFormatControl;
m_imageFormatControl = NULL;
}
if(m_analogControl != NULL)
{
delete m_analogControl;
m_analogControl = NULL;
}
if(m_acquisitionControl != NULL)
{
delete m_acquisitionControl;
m_acquisitionControl = NULL;
}
if(m_function != NULL)
{
delete m_function;
m_function = NULL;
}
if(m_systemSetting != NULL)
{
delete m_systemSetting;
m_systemSetting = NULL;
}
m_pDev->close();
m_isopen = false;
}
return 0;
}
long MvCamera::GrabOne(void* pImageData)
{
if(m_isopen)
{
if(!m_isgrab)
{
m_function->imageRequestReset( 0 0 );
int icount = m_maxCount;
while( static_cast( m_function->imageRequestSingle() ) == DMR_NO_ERROR )
{
if (icount-- < 0)
{
return -1;
}
};
//开始采集
StartAcquire();
}
if(m_isgrab)
{
int requestNr = INVALID_ID;
//软触发
if((m_GrabMode == MV_Software))
{
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-09-27 15:34 mvCameraTest01\
目录 0 2018-11-22 14:09 mvCameraTest01\Release\
文件 140288 2018-11-22 14:09 mvCameraTest01\Release\mvCameraTest01.exe
文件 2649088 2018-11-22 14:09 mvCameraTest01\Release\mvCameraTest01.pdb
目录 0 2018-11-22 14:09 mvCameraTest01\mvCameraTest01\
目录 0 2018-11-20 13:58 mvCameraTest01\mvCameraTest01\MV(2.29)\
目录 0 2018-11-20 13:58 mvCameraTest01\mvCameraTest01\MV(2.29)\include\
目录 0 2018-11-20 13:58 mvCameraTest01\mvCameraTest01\MV(2.29)\include\Driverba
目录 0 2018-11-20 13:58 mvCameraTest01\mvCameraTest01\MV(2.29)\include\Driverba
文件 9998 2018-11-07 09:15 mvCameraTest01\mvCameraTest01\MV(2.29)\include\Driverba
文件 251138 2018-11-07 09:15 mvCameraTest01\mvCameraTest01\MV(2.29)\include\Driverba
文件 1712 2018-11-07 09:20 mvCameraTest01\mvCameraTest01\MV(2.29)\include\Driverba
目录 0 2018-11-20 13:58 mvCameraTest01\mvCameraTest01\MV(2.29)\include\FirmwareUpdates\
目录 0 2018-11-22 14:55 mvCameraTest01\mvCameraTest01\MV(2.29)\include\FirmwareUpdates\mvBlueCOUGAR\
目录 0 2018-11-22 14:55 mvCameraTest01\mvCameraTest01\MV(2.29)\include\FirmwareUpdates\mvBlueFOX\
目录 0 2018-11-20 13:58 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\
目录 0 2018-11-20 13:58 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvGigECaptureDriver(x64)\
文件 2575 2018-11-07 09:16 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvGigECaptureDriver(x64)\mvGigECapture.inf
文件 43344 2018-11-07 09:16 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvGigECaptureDriver(x64)\mvGigECapture.sys
文件 8046 2018-11-07 09:16 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvGigECaptureDriver(x64)\mvGigECapture_amd64.cat
文件 1647 2018-11-07 09:16 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvGigECaptureDriver(x64)\mvGigECapturem.inf
文件 7641 2018-11-07 09:16 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvGigECaptureDriver(x64)\mvGigECapturem_amd64.cat
目录 0 2018-11-20 13:58 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvUSB3Vision(x64)\
目录 0 2018-11-20 13:58 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvUSB3Vision(x64)\amd64\
文件 1721576 2018-11-07 09:16 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvUSB3Vision(x64)\amd64\WdfCoInstaller01009.dll
文件 76384 2018-11-07 09:16 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvUSB3Vision(x64)\amd64\libusb0.dll
文件 99128 2018-11-07 09:16 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvUSB3Vision(x64)\amd64\libusbK.dll
文件 45904 2018-11-07 09:16 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvUSB3Vision(x64)\amd64\libusbK.sys
文件 11687 2018-11-07 09:16 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvUSB3Vision(x64)\mvUSB3Vision.cat
文件 5664 2018-11-07 09:16 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvUSB3Vision(x64)\mvUSB3Vision.inf
目录 0 2018-11-20 13:58 mvCameraTest01\mvCameraTest01\MV(2.29)\include\KernelDrivers\mvUSB3Vision(x64)\x86\
............此处省略623个文件信息
- 上一篇:纯电动及混合动力学汽车设计基础
- 下一篇:virtio-windows驱动
相关资源
- 自己收集的Visio图库,电气,网络等等
- Computer and Machine Vision Theory Algorithms
- IBM服务器的visio形状
- NI Vision Assistant中文入门教程(带书签
- Visio图标库-史上最全
- Concise Computer Vision - An Introduction into
- Photogrammetric Computer Vision摄影测量计算
- label matrix 5.0 目前最好的版本,内有序
- Horn R A Johnson C R Matrix Analysis (CUP 19
- 最全VISIO图标集-附网络拓扑图
- VISIO各种图标超全(IT行业专用网络及
- Horn R A Johnson C R Matrix Analysis
- Handbook of 3D machine vision : optical metrol
- 计算机视觉算法与应用 电子版pdfCom
- Computer Vision: Algorithms and Applications 2
- 中文版无水印版计算机视觉:模型、
- 机柜VISIO模板.vsd
- 捷宇科技DoccameraOcx控件.exe
- 海康布防警报demo
- Computer-vision-for-visual-effects pdf
- Learning OpenCV Computer Vision with the OpenC
- ComputerVisionAModernApproach(中文版).p
- Matrix Computations 4th Edition G.H. Golub an
- Image Processing Analysis and Machine Vision 4
- Hi3516CV300 专业型HD IP Camera Soc用户指南
- 史上最全VISIO图标集
- Visio网络拓扑图模具Cisco、IBM、H3C
- MIT机器视觉讲义2compute vision
-
PCI Express® ba
se Specification Revision 4 - SingleSensorImagingMethodsandApplicationsforDi
评论
共有 条评论