Vision Acquisition Software
:該軟件爲NI視覺採集集成環境web
NationalInstruments.Common
NationalInstruments.Vision.Common
NationalInstruments.Vision.Aquisition.Imaqdx
ImaqdxCameraInformation[] cameraList = ImaqdxSystem.GetCamerInformation(true);
public bool OpenCameraDevice() { try { List<ImaqdxSession> cameraSessionList = new List<ImaqdxSession>(); foreach(var camera in cameraList) { cameraSessionList.Add(new ImaqdxSession(camera.Name)); return true; } } catch() { return false; } }
public void CloseCameraDevice() { foreach(ImaqdxSession session in cameraSessionList) { if(session != null) session.Close(); } }
public bool SnapPictureAndShow(int cameraIndex) { VisionImage image = new VisionImage(); try { cameraSessionList[cameraIndex].Snap(image); Algorithms.Copy(image, NI_ImageViewer.Image); return true; } catch() { return false; } }