Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

usb camera acquisition - low cost

Hello, I'm evaluating a USB camera (Mightex) for use as a laser profiling camera with LV8.6.  I do not yet own IMAQ or vision toolkits but loaded the NI Vision toolkit to see how it worked.  The IMAQ routines, together with the USB IMAQ library, seems to work fine in that I can acquire images and change the vendor supplied image properties.  The only thing I need is to get the image into an array format so I can process the images, and I'd be happy.

 

Here's the problem: I cannot control the output format of the acquired image.   I specify an 8-bit monochrome image type but the IMAQ USB Snap routine seems to change the image to a u32 RGB format (although the color is still grayscale since each color of the pixels are identical).   That's not so bad except that I haven't found a way to use the standard IMAQ routines to convert the image to an array.  I found the colorImageToArray routine in the NI Vision palette but I do not want to spend an extra $2500 for the vison toolkit just for this privilege.  Is there something I am missing that would make this camera work with IMAQ alone?  Thanks, Rod

0 Kudos
Message 1 of 13
(4,825 Views)

The IMAQ ColorImageToArray is part of the Vision Utilities Palette given with Vision Acquisition Software according to our documentation here:

http://digital.ni.com/public.nsf/allkb/392E8F10F049918986256A3B005D484A?OpenDocument

 

-Zach

0 Kudos
Message 2 of 13
(4,798 Views)

Another thing I forgot to mention is that although you do not need the Vision Development module to use the ColorImageToArray function, you do need it to use the IMAQ for USB driver. This is outlined in the page here:

http://zone.ni.com/devzone/cda/epd/p/id/5030 .

So either way, you will need NI-Vision in order to use both the driver and functions you desire.

 

-Zach

0 Kudos
Message 3 of 13
(4,796 Views)

Zach, first I will begin with a thanks for clarifying what VIs are in each software package.  It is hard to figure out from the online help what's included where.  From your last comment however, I have a complaint!   You mean to tell me that I cannot use a USB camera without buying the complete NI Vision Development toolkit??  What the ?  Nice way to encourage 3rd party vendors - they make a cool $1k camera but it's going to cost me another $3k to use it with LV?  I've been a LV user since v3.1, and I usually respect NI's commitment to supporting hardware, but this is ridiculous.  VB isn't looking so bad.  Rod

0 Kudos
Message 4 of 13
(4,794 Views)

Hello,

 

If you would like to further voice your concerns over this matter, I would suggest that you fill out a product suggestion so that your points can be taken into consideration.

http://digital.ni.com/applications/psc.nsf/default?OpenForm


-Zach

0 Kudos
Message 5 of 13
(4,792 Views)
Yes, I just made a suggestion!  I encourage anyone else reading this who is thinking about using a USB camera to ask that IMAQ software support be compatible with the basic vision acquisition package (~$500), not the vision development package (~$3500).
0 Kudos
Message 6 of 13
(4,788 Views)

Hi, Rod,

 

Fully agree with you.

 

Anyway, there are other possibilities, how to get images from USB camera.

For example, you can try attached example (just run 00.Grab Test.vi). May be it will work for you (but without guarantees).

Here RGB images coming via OpenCV wrapper and converted to I32 array. Try this.

 

Andrey.

 

Message 7 of 13
(4,787 Views)

Andrey, thanks for the code.  It works.  I'll play around with it some more to see if it will do what I want, but it looks encouraging.  (And I don't need the IMAQ library? what a shame Smiley Very Happy )

 

Rod

Message 8 of 13
(4,764 Views)

Rod, thank you for feedback. The given code pretty "quick and dirty", for example, with big probability will be crashed if camera not connected, and so on. It was just small exercise with acquisition through OpenCV functions. Later I'll do it a little bit more robust and also will add some basic processing functionality (probably within next two weeks). And yes, IMAQ is not necessary for this 😉 .

 

Andrey.

0 Kudos
Message 9 of 13
(4,752 Views)

Hi Rob!

 

We have been listening to you and the many other users who are using the USB drivers/cameras, and Vision Aquisition Software will officially be supporting DirectShow devices (USB) as part of IMAQdx in the next release.  It is already in Beta release.

 

Take care!

Kameralina

0 Kudos
Message 10 of 13
(4,694 Views)