资源简介
gige vision PC端代码,在windows和linux平台上可用。 降分分享,希望能帮助有缘人
代码片段和文件信息
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include “GigEVision.h“
#include “Gvcp.h“
#include “GenICam.h“
GenICamManager::GenICamManager(GigEVision& gev):
m_gev(gev)
{
}
void GenICamManager::ReadxmlFile()
{
std::vector data = m_gev.Gvcp().ReadBlock(GENICAM_ZIPFILEINFO_ADDRESS 512);
std::string sTxt(data.begin() data.end());
std::vector aParts;
boost::algorithm::split(aParts sTxt boost::algorithm::is_any_of(“;“));
if(aParts.size() != 3)
throw std::runtime_error(“Error getting genicam file location on camera“);
int nAddr nSize;
std::stringstream ss;
ss << std::hex << aParts[1];
ss >> nAddr;
ss.clear();
ss << std::hex << aParts[2];
ss >> nSize;
data = m_gev.Gvcp().ReadBlock(nAddr nSize);
// TODO: find a way to decompress the zip-file in menory without writing the file to disk
// TODO: use a platform independent path
std::string sFilename(“/tmp/genicam.zip“);
std::string retData;
try
{
std::ofstream os(sFilename.c_str() std::ios::binary);
os.write((char*)(&data[0]) data.size());
os.flush();
struct zip* zz = zip_open(sFilename.c_str() 0 0);
if(zz == 0)
throw std::runtime_error(“Error opening genicam zipfile“);
struct zip_file* zf = zip_fopen_index(zz 0 0);
if(zf == 0)
throw std::runtime_error(“Error opening file in zip archive“);
boost::array buff;
int nRead = 0;
while((nRead = zip_fread(zf buff.data() buff.size())) != 0)
std::copy(buff.begin() buff.begin()+nRead std::back_inserter(retData));
// clean up file from disk
boost::filesystem::remove(sFilename);
}
catch(std::exception& e)
{
boost::filesystem::remove(sFilename);
throw e;
}
setenv(“GENICAM_ROOT_V1_1“ GENICAM_ROOT_PATH true);
m_cam._LoadxmlFromString(retData.c_str());
}
uint32_t GenICamManager::GetAddress(const std::string& sKey)
{
GenApi::INode* pN = m_cam._GetNode(sKey.c_str());
uint32_t nAddr = 0;
if(pN != 0)
{
GenICam::gcstring val att;
if(pN->GetProperty(“Address“ val att))
{
nAddr = boost::lexical_cast(val);
}
if(pN->GetProperty(“pAddress“ val att) && val.length() > 0)
{
std::string sTmp(val);
std::vector parts;
boost::algorithm::split(parts sTmp boost::algorithm::is_any_of(“\t“));
for(size_t i=0; i {
GenApi::INode* pAddrNode = m_cam._GetNode(parts[i].c_str());
assert(pAddrNode);
GenICam::gcstring sAddr sAtt;
assert(pAddrNode->GetProperty(“Value“ sAddr sAtt));
nAddr += boost::lexical_cast(sAddr);
}
}
}
else
throw std::runtime_error(str(boost:
- 上一篇:初等数论-潘承洞
- 下一篇:netlogo中文使用手册
相关资源
- 基于FPGA和万兆网的GigE Vison设计方案
-
PCI Express ba
se Specification Revision 2.1 - flash及air等移动设备 开发者证书ios证
- 数字图像处理标准测试图片335张
- Keil4破解版下载150129
- Edge Computing: Vision and Challenges
- 07-5123-07-ZigbeeClusterLibrary_Revision_7.pdf
- HIKVISION工业相机的SDK二次开发的QT
- HIKVISION iVMS-8700 综合安防管理平台软件
- labview vision 视觉例程
- GigE协议文档
- Keil uVision4 汉化包
- Markov random fields for vision and image proc
- A Guide to Convolutional Neural Networks for C
- Numerical Algorithms Methods for Computer Visi
- hikvision-isapi
-
pci express ba
se Specification 2.0 规范 - GigE Vision Specification 2-0-02
- dalsa线扫描相机用户手册_Linea_GigE_Se
- Papervision3D236223
- vision2016版本 带破解工具
- PCI Express® Card Electromechanical Specifica
- Multiple View Geometry in Computer Vision
- Jan 2012 GigE Vision v1 2.pdf
- simvision user guide8.2
- aia Gige vision 摄像机协议
- 超详细VisionPro 视觉工具-原理及讲解
- usb3 vision spec
- Multiple View Geometry in Computer Vision(第二
- Hands-On Computer Vision with Julia
评论
共有 条评论