91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 53KB
    文件類型: .cs
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-05-23
  • 語言: C#
  • 標(biāo)簽: Visionpro??Basler??C#??

資源簡介

這個類封裝把封裝了pylon Viewer 的API 方便設(shè)置參數(shù)(適用于Basler_pylon_5.0.11 以上)。采集到圖片后轉(zhuǎn)換成VisionPro圖片格式發(fā)出一個彩圖完成事件。轉(zhuǎn)換為Halcon圖片格式代碼注釋掉了。需要用到可自行去掉注釋。

資源截圖

代碼片段和文件信息

using?Basler.Pylon;
using?Cognex.VisionPro;
using?CommonServiceLocator;
using?MovementVision.Infrastructure.Interfaces;
using?System;
using?System.Collections.Concurrent;
using?System.Collections.Generic;
using?System.Diagnostics;
using?System.Drawing;
using?System.Drawing.Imaging;
using?System.Linq;
using?System.Text;
using?System.Threading;
using?System.Threading.Tasks;
using?System.Windows;

namespace?MovementVision.Infrastructure
{
????public?class?BaslerCam
????{
????????private?Camera?camera?=?null;
????????private?PixelDataConverter?converter?=?new?PixelDataConverter();
????????private?String?strUserID?=?null;
????????int[]?FailCount?=?new?int[9];
????????IntPtr?latestframeAddress?=?IntPtr.Zero;
????????public?long?imageWidth?=?0;????????????????????????//?圖像寬
????????public?long?imageHeight?=?0;???????????????????????//?圖像高
????????public?string?TirggerMode?=?““;
????????public?double?LineRateAbs?=?0;??????????????????????//外觸發(fā)幀率
????????public?double?minLineRateAbs?=?0;???????????????//最小外觸發(fā)幀率
????????public?double?maxLineRateAbs?=?0;???????????????//最大外觸發(fā)幀率
????????public?int?numWindowIndex?=?0;
????????public?ConcurrentQueue?ImageList?=?new?ConcurrentQueue();
????????private?long?grabTime?=?0;????????????????????//?采集圖像時間

????????//private?Hobject?hPylonImage?=?null;/////////////////////////////////////////////////////////////刪除halcon的
????????private?ICogImage?CogImg;?????????????????//VisionPRO圖片
????????//private?IntPtr?latestframeAddress?=?IntPtr.Zero;
????????private?Stopwatch?stopWatch?=?new?Stopwatch();

????????///?計算采集圖像時間自定義委托
????????public?delegate?void?delegateComputeGrabTime(long?time);
????????///?計算采集圖像時間委托事件
????????public?event?delegateComputeGrabTime?eventComputeGrabTime;

????????///?圖像處理自定義委托
????????//public?delegate?void?delegateProcessHImage(Hobject?hImage);/////////////////////////////////////////////////////////////刪除halcon的
????????public?delegate?void?delegateProcessHImage(ICogImage?CogImg?long?n);
????????///?圖像處理委托事件
????????//public?event?delegateProcessHImage?eventProcessImage;/////////////////////////////////////////////////////////////刪除halcon的
????????public?event?delegateProcessHImage?eventProcessImage;

????????///?if?>=?Sfnc2_0_0說明是USB3的相機
????????static?Version?Sfnc2_0_0?=?new?Version(2?0?0);
????????/**************************************************************????實例化相機????******************/
????????///?實例化第一個找到的相機
????????public?BaslerCam()
????????{
????????????try
????????????{
????????????????camera?=?new?Camera();
????????????}
????????????catch?(Exception?e)
????????????{
????????????????ShowException(e);
????????????}
????????}
????????///?根據(jù)相機序列號實例化相機
????????//public?BaslerCam(string?SN)
????????//{
????????//????camera?=?new?Camera(SN);
????????//}
????????///?根據(jù)相機UserID實例化相機
????????public?BaslerCam(string?UserID)
????????{
????????????try
????????????{
????????????????strUserID?=?

評論

共有 條評論