NI產品與技術 討論區

取消
顯示結果 
搜尋替代 
您的意思是: 

use 3 usb cameras with imaqdx

已解決!
前往解決方案

hello everyone:

 

I need to use 3 usb cams with imaqdx .How should I do?

 

any Example ?

 

vs2008 C#

 

VASAugust2010

 

Thanks for all your help !

0 積分
1 條訊息(共 5 條)
6,290 檢視
解決方案
由主題作者所接受 McLovin

Hi McLovin,

 

Firstly, you need to check whether your USB cams are DirectShow compatible with IMAQdx. If yes, then you might refer to the attached VI example of using 2 cams and extend it to 3 cams similarily.

 

Best Regards,

cpan

0 積分
2 條訊息(共 5 條)
6,281 檢視

Hello cpan:

Thanks very much for your reply.

But I used vs2008 C# for program with imaqdx,So I wish you have some Example under C#.Thank you very much.

0 積分
3 條訊息(共 5 條)
6,276 檢視

Hi McLovin,

 

Even LabVIEW and C# are different programming languages, in terms of programming, the main ideas are pretty similar: use different sessions to access different cameras, with proper allocation of image, then snap images from different cameras based on their corresponding session tokens.

 

 

 try
 {
  //-----------------------------------------------------------------------
  //  Open a session to the camera
  //-----------------------------------------------------------------------
  IMAQdxError status = IMAQdxOpenCamera (camName, IMAQdxCameraControlModeController, &session);
  if (status)
   throw status;
  
  //--------------------------------------------------------------------
  //  We need an image for display purposes. 
  //--------------------------------------------------------------------
  image = imaqCreateImage (IMAQ_IMAGE_U8, 0);
  if (!image)
   throw VisionError();

  //-----------------------------------------------------------------------
  //  Now it's time to snap and display an image. 
  //-----------------------------------------------------------------------
  status = IMAQdxSnap (session, image);
  if (status)
   throw status;

  //-----------------------------------------------------------------------
  //  Display the image
  //-----------------------------------------------------------------------
  imaqDisplayImage(image, 0, true);
 }

 

Hope that could be helpful to you...

 

Best Regards,

cpan

0 積分
4 條訊息(共 5 條)
6,272 檢視

Thank you very much.

0 積分
5 條訊息(共 5 條)
6,265 檢視