Two Simultaneous USB Camera Image Acquisition and Saving

Hello everyone,
Recently my friends and I have begun a project which requires the simultaneous acquisition of images from two independent USB cameras. Throughout our project research we have encountered many difficulties. The major problem appears to be how to successfully interface two USB cameras and properly save the image to a median for further processing down the road.
Our first attempted at this was with the USB IMAQ drivers. Unfortunately, to our surprise, it does not support two independent and simultaneous camera acquisitions. To combat this problem we implemented a crude loop of closing a camera reference, then opening the other, acquiring an image, then closing, etc... This did provide us with functionality but was very inefficient, resulting insufficient acquisition speeds.
Afterwards we began looking at other ways of capturing and writing the image, which are listed below.
Various Acquisition Interfaces / Strategies
USB IMAQ Driver - USB interfacing kit available for public download, (not officially supported by NI) zone.ni.com/devzone/cda/epd/p/id/5030
Status - Abandoned because of the lack of dual web camera support
Avicap32.dll - Windows 32 DLL responsible for all web camera communication, and other media devices.
Status - Currently acquired two streams of video on the front panel but with no way of saving the images
Directx - The core Windows technology that drives high-speed multimedia on a PC.
Status - Currently researching.
.NET - Microsoft .NET framework, possibly a valid interface to a video stream.
Status - No development until further progress.
We are still currently developing the Avicap32.dll code but the major bottleneck is the learning curve on the property nodes, library calling nodes, .NET and other references. So far it’s been a tedious effort of trying to understand example code and piece them together. As a former programmer of C I know this is not the proper way of writing code web I can’t seem to grasp how these functions work. (Property nodes, library calling nodes, .NET and other references). Learning this may allow us the knowledge to code a proper system. Does anyone know any good tutorials or learning material for such functions? So far my research has come up empty handed.
We are currently working with these interfaces and other reference examples on the NI site. Unfortunately we cannot seem to properly integrate the code for our system. Does anyone know if this setup is even possible? Also, if anyone has any experience with similar systems and can offer advice, code snippets, or any other assistance it would be greatly appreciated.
Our current projects will be posted below if you have any suggestions. (More will be added when I get to my desktop tomorrow)
Two Camera Avicap32.dll - Currently stuck on how to save the image, various tweaks have gotten us stuck at this point ( will have another Avicap32.dll implementation posted tomorrow)
USB Capture Example - This USB capture VI was an example that immediate had problems. We used it as a baseline for crude open-close camera image grabbing system. (Will also be posted tomorrow)
Thanks for any help, it's much appreciated.
Taylor S. Amarel
Thanks,
Taylor S. Amarel
Learning is living.
Co-Founder and CEO of http://3dprintingmodel.com/
"If we did all the things we are capable of, we would literally astound ourselves."
-Thomas Edison
Attachments:
Two Camera Avicap32.dll.zip ‏84 KB
USB Capture Example.zip ‏17 KB

Thanks for the information but that's not exactly what I'm looking for. I've been to that URL and read the information before. I don't mean to disparage you help but I'm looking for ways that I can successfully implement a functional system, not information on an unfunctional method. Maybe I was unclear before, I'm looking for any advice, knowledge or help on how to make this system properly work.
Thanks, have a great day.
Taylor S. Amarel 
Learning is living.
Co-Founder and CEO of http://3dprintingmodel.com/
"If we did all the things we are capable of, we would literally astound ourselves."
-Thomas Edison

Similar Messages

  • Is vision development module in labview 8.6. sufficient for real-time image acquisition and analysis using a webcam

    Hi, 
    I'm new to labview and trying to develop an eye-tracker using labview 8.6. It has the vision development module and i was wondering if this was sufficient for real-time image acquisition and processing or would i be needing any other software tools.
    Solved!
    Go to Solution.

    Hello, certainly it is possible and sufficient for real-time tracking!
    About eye tracking - if you need an example, you can find the code here:
    https://decibel.ni.com/content/blogs/kl3m3n/2013/10/08/real-time-face-and-eye-detection-in-labview-u...
    The code uses OpenCV functionalities along with the LabView UI (and some other functions like overlay).
    Hope this helps a bit.
    Best regards,
    K
    https://decibel.ni.com/content/blogs/kl3m3n
    "Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."

  • Which is better for usb camera between VISA and imaqdx in labview 2010?

    i have done a program for usb camera to acquire images with imaqdx.
    now i want to know which is better between VISA and  imaqdx in labview 2010?
    i didn't study visa before
    thans for help.

    VISA is primarily used to communicate with instruments via GPIB/TCP-IP/Serial/USB. In order to use easily VISA with an instrument over USB the instrument must adhere to the USBTMC spec. A camera is not likely to have this. Otherwise you have to use USB RAW, and that requires detailed knowledge of the data that is transmitted by the instrument. Manufacturers rarely give this information out. Normally they will provide a DLL to communicate with the instrument.
    Thus, in your case, VISA is not going to be an appropriate API to use for a USB camera.
    Out of curiosity, what prompted this question?

  • No changes appear when batch editing Camera Raw Files and saving as jpegs

    When I batch edit my raw files, including saving the file as a jpeg, from bridge or photoshop the resulting file saved never includes any changes I made in the Camera Raw editor. For example if I have lightened the photo by changing the exposure in Camera Raw as a saved jpeg after batching the file is still as dark as when originally shot. Is there some little box I forgot to check or something? Thanks!
    andy

    I've seen something like this, but have not figured out why yet. In my situation I select a group of images in Bridge and go to Tools / Photoshop / Image Processor.
    There I click the "open first image to apply settings" box.
    Save in Same Location
    Save as JPEG, resize to fit (1200 pixels), Convert Profile to sRGB.
    No Action selected
    Include ICC Profile
    Run it and in Camera Raw roll the saturation down to -100 (convert to b&W).
    Click "Open Image"
    The process runs and the first image is converted to b&w, but the others are not.
    John

  • CRIO 9067 remote USB vision image acquisition

    I have a 9067 connected to a Basler USB camera.  I'm able to successfully view images via MAX and via the Grab example as long as I run the Grab example on the RT Target.  However, I don't need the images processed on the RT or FPGA in this application.  Is it possible to open a remote connection to the camera from my host computer using IMAQdx?
    I was hoping I could use something like "[cRIO IP Address]::cam0" in the camera address, but that doesn't seem to work.
    Is this possible or do I have to manually pipeline the images from the RT target?
    Thanks,
    Omar
    Solved!
    Go to Solution.

    Hello Omar,
    You cannot access the camera image directly by addressing it through the cRIO. You will have to implement image transfer between the cRIO and host PC. Fortunately you can do this rather easily by using an image shared variable or network stream.
    Earl C
    Applications Engineer
    National Instruments

  • Euresys Picolo image acquisition and LabVIEW

    Hi all,
    Unfortunately I have bee asked to use a Euresys piccolo image acquisition card in LabVIEW. I my case I only need to display the image on / on top of a LabVIEW front panel. Yes – I know it would have been much better to use an NI card but sometimes other people........
    Anyway my question is - has anyone out there managed a reliable interface to the piccolo dll yet? I’ve been looking at the ActiveX interface but it looks like an exceptionally tricky job. I see there are few previous discussions that will be of help should I have to start from a blank VI.
    Any advice appreciated,
    -Martin
    Certified LabVIEW Architect

    Hi Martin
    I have had a look for you this afternoon to see if I can find an example for you as to how to communicate to you Euresys frame grabber in LabVIEW but an example or driver is not available. It should though be possible to comunicate with your board using the manufacturers dll. You mentioned that you were aware of other forum posts that will be helpful in you starting to develope you code but I thought it might be helpfull to post some links below.
    Forum posts:
    Is it possible to use Euresys Picolo card with IMAQ vision and LabView?
    activex help!!!
    calling picolo.dll in Labview
    Other Resources
    Using External Code in LAbVIEW
    Integrating External Code with the Import Shared Library Wizard
    I hope this helps

  • Wireless signal acquisition and saving signal in text format simultaneously for 5 mins

    Hi,
    I am acquiring ECG signal wirelessly and displaying it in in waveform chart. And simultaneously i need to save it in Text format for 5 mins. The problem i am facing is that for saving the signal i am using Write to Measurement File which saves the file in text format..... but while saving the plotting speed decreases.
    i am very new to labview.. so plz can any one tell me whether i am missing any thing in it... plz help.....
     

    Why do people always post pictures of their VIs rather than the VIs themselves or at least Snippets?  We can't tell from the picture what Version of LabVIEW you are using (so if we post code, you might not be able to open it), and we can't "play with" your code and try it out without, ourselves, by hand, trying to recreate it from your (sometimes very tiny) diagram.  Please Help Us to Help You!
    Here's help anyway to get you started with the Producer/Consumer Design Pattern.
    Open LabVIEW.
    Click "File", choose "New ..." (not New VI), and choose (from the templates) Producer/Consumer Design Pattern (Data).
    Study the Template and adapt it to your problem.
    The Producer would be anything that Generates data.  Once you have the data, you put it on the Queue and send it to the Consumer for all the rest of the processing.  The idea is that the Producer has an inherent timing that it has to meet, otherwise you lose data points.  The Consumer, on the other hand, just needs to "more or less" keep up (actually, the Queue can/will expand, so if the amount of data isn't megabytes, the Consumer can really be quite slow, though you usually want the Consumer, on average, to be at least as fast as the Producer).
    Bob Schor

  • NI USB 6008 AI acquisition and DO pulse genereation

    Dear LabVIEW users,
    Greetings for everyone. I am a beginner of LabVIEW and I have a problem, which I have solved partially. I would really appreciate your help and suggestions as I searched for days without any luck. The problem is as following:
    I am acquiring AI voltage (continous) from 4-8 accelerometers. At the same time, I am sending a digital output signal each time when the sample rate is clicked (i.e. 1000, 2000, 3000, .... if sampling rate is 1000). In other words, trying to send a digital output signal (at some frequency 'n' Hz) at regular 1 second interval (according to hardware level). So that the digital output signal will blink an LED at every one second. Further, I need to write the AI (voltage) signals, and LED blink PC (software) timestamps separately. All the above said steps are followed in my .vi program but the real hardware/software level operations are killing my timestamps. In other words each LED blink timestamps are not accurate when I use LabVIEW measurement file express VI (difference is not atleast to the third decimal place). In addition, the timestamping is somewhat OK when I disable the LVM file write VI. Onemore thing I noticed is that, physically LED blinks every two second once, I suspect this is due to the shift register and loop delay of second. Is there a way to control the blink speed (i.e. boolean state has to change at every 500ms without delaying the inner while loop).
    Results and observations:
    LabVIEW 2011 .vi, timestamp files with and without LVM file generator (express VI) are all attached. Please note that there is a considerable amount of drift in consecutive timestamps when LVM file generator is used, on the other hand there is 0.001 ms drift when LVM file generator is not used. The reason for PC timestamps are to roughtly align different measurements or observations or events in global time scale.
    Please give me any suggestions or help me to make it atleast accurate for milliseconds within the witten VI. Lastly, is there any relatively inexpensive USB DAQ module which can send a pulse to directly from pulse channel to digital output channels when sample rate of 'n' Hz is achieved by hardware level which could be every accurate, so that software delay is fully minimized. Although there are highly sophistiated hardwares from NI, but our goal of this project is to build and test cost effective system.
    Thank you and I really appreciate your inavluable time and effort. Have a great weekend!
    With Regards,
    Paghalaya
    Solved!
    Go to Solution.
    Attachments:
    LabVIEW File Folder.zip ‏113 KB

    Paghalaya,
    Software timing when using a desktop operating system will never be precise to the millisecond level.  The USB-6008 has hardware timing only for the AI function. The DO is software timed.
    To get precise 500 ms intevals for the DO, you will need to use a device with hardware timed digital outputs.
    Some things which might improve your VI, although they will not solve all your problems:
    1. Consider a parallel loop architecture (suche as Producer/Consumer). Moving the File writes to a separate loop from the data acquisition may reduce the timing jitter on the DO.
    2. Acquire 500 samples twice per second rather than 1000 samples once per second.  That will allow you to get the DO timing closer to what you want.  It will not be perfect, but the hardware timing of the AI will help.
    3. Dev1/ai0:3 (maybe Dev1/ai0:ai3) should get all four channels at once.  I do not have DAQmx so I am not sure of the syntax.
    4. You have the Write to Measurement File Express VI set to overwrite the file.  Is that what you really want?
    Lynn

  • Raw Images opened and saved as TIFF of PSD in photoshop not added to LR library

    Images opening from LR to PS6 are opened as CR2 files (canon) and then saved in PS - the resulting saved images are PSD files. These files are not added to the LR catalog without re-importing them. This behavior is different than it was in CS5 - in CS5 they are opened as PSD and immediately added to the LR catalog. I want the same bahavior in CS6. In LR I have set preferences to open files as PSD but they are not PSD until they are saved in PS.

    The behaviour you are now seeing when using CS6 is normal when Lightroom and Photoshop are in sync in respect of the ACR level, i.e. the derivative PSD/TIFF is NOT created until you hit Save in PS. When the ACR levels are not in sync (i.e. the PS version is lower than the LR version, as is the case using LR4 and CS5) the "ACR Mis-match" dialog appears (though you may have ticked the "Do Not Show Me Again" box after selecting "Render Using Lightroom") and in that situation the derivative file is created by Lightroom, so you see it appear in LR before it is opened into PS. The fact that the filename that you see in CS6 shows the CR2 extension is not an issue (PS always retains the raw file's full name until it is saved as a derivative file....try opening a raw file directly into CS5/CS6 from outside Lightroom and you'll see), and it will change as soon as you select Save, at which point you should also see the PSD/TIFF appear in Lightroom.
    So the only question is, why are you not seeing it? Can you confirm that when you are done in PS that you are selecting "Save" and not "Save As"? And that Lightroom is still running when you do that? And what source are you working from: Folder, Collection, Smart Collection? When you import the PSD, is "Do not import suspected duplicates" cheched or unchecked?

  • Image editing and saving it

    Hello all,
    i am an iPhone Developer,
    i want to edit an image using another image you can say that i want to paste a smaller image(in size)
    on to the larger one and then want to save this image and wants a single image as a result.
    i did the code for imposing image on to the first one and even code for saving image to the photo gallery but i am getting stuck with one issue, that is:
    while saving the image we have to give the image reference as the first parameter to the following method..
    UIImageWriteToSavedPhotosAlbum( UIImageView.image, self, @selector(imageSavedToPhotosAlbum: didFinishSavingWithError: contextInfo, nil);
    and the problem i am facing is
    there is one UIImageView object for the UIView and while using UIImageView.image i get the first image not the mixed image that i want.
    please help me for getting the desired image.
    thanks

    If you already posted on the developer forums, why didn't you say so?
    I pointed you to the developer forums, because I assumed that you didn't know the right place where to post developer questions (a user-to-user and iPhone usage discussion forum is not the place for programming questions).

  • Picking up image drawan on panel into image object and saving itto file.

    hi dear friends,
    please help me out , My problem is:
    On challan generation screen we want to make provision for signeture.So for that purpose we have placed panel inside the frame where user can do the signeture.
    Signeture drawing is working .But now the next step is that i want to store it in a file(I mean to say whatever drawn on panel) so that that file can be saved in database and later on it can be retrived when ever required.
    will be thankful if anyone helps me.
    waiting for replays.

    try to use following code :
    BufferedImage im = new BufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_INT_RGB);          
                             Graphics2D g2 = im.createGraphics();
                             //you may want to set background color, etc...     
                             comp.paint(g2);          
                             try          
                                  GIFEncoder gif = new GIFEncoder(im);
                                  gif.Write(new FileOutputStream(file));
                             catch(Exception e)          
    GifEncoder can be obtained from net. if u want i can mail u also.

  • Image uploading and saving to database

    hi ,
               I am developing application for summer placement . i want to upload image with candidate's details and save it to database. How to do this? I hv got tutorials for uploading image but want to know how to save it to database table along with  candidate's details.
    Kavita

    Hi kavita,
                   In Webdynpro u r using attribute of type Resource ,which is binded to FileUpload UI element. From this attribute, u get file in Input stream format which can be converted into byte array like this
    byte fileData[] = null;
          try{
                InputStream fileIs = wdContext.currentFile().getFileData().read(false);
                ByteArrayOutputStream bOut = new ByteArrayOutputStream();
                int length;
                byte[] part = new byte[10 * 1024];
                while ((length = fileIs.read(part)) != -1) {
                      bOut.write(part, 0, length);
                fileIs.close();
                fileData = bOut.toByteArray();
                bOut.close();
          } catch (Exception e) {
                wdComponentAPI.getMessageManager().reportSuccess(e.toString());
    In webservice u can take a the byte array as input parameter where the uploaded file will be passed as byte array .
    In DB u can store it as BLOB .
    in case of any other doubt u can revert back to me.
    regards
    Sumit

  • Acquisition and saving(for Annette Perez)

    Hi Annette,
    I?m luiart.
    First of all thanks for help.I?ve read your answer and I?d like to know something more.
    I?m not familiar with references; as you told me thanks to a reference value I could have a marker to point a common istant in wich I have acquired those values.Is what I said right?
    How can I do it?
    Are there examples about it?
    Thanks luiart.

    Hello Luiart,
    Well, I did not find any examples that do exactly what you are trying to do, but I did find two Application Notes that give a pretty clear explanation on how to do this.
    Here are the links:
    Control References: Overview
    Using LabView to create Multithreaded DAQ Applications
    Keep up with the great work!

  • Acquisition and saving(for Serenity)

    Hi Serenity I?m luiart.
    I ?ve read your answer and I think what you told me can help me very much.
    Now I?d like to ask you something to understand better:
    1. Wich is the function that let me copy datas to another VI?
    2. Has the memory VI a buffer in wich it must hold datas?
    3. I?m working in multithreading; must the VI called work in multithreading?
    4. Are there examples abou it?
    Thanks, luiart.

    Luiart,
    I think this forum is for general questions towards the LV-community, not some selected person. But I will try to answer you.
    1) You copy data by connecting the data you want to copy to an input terminal of the vi you want to copy the data to.
    2) "The memory vi" is just a vi you can make for your use. It uses a shift-register to hold the data (like a 2D array). The vi has different states.
    In one state you can write (add) a new data-point to the array.
    In another state you can read-out data from this array (It could be all, but you could also make a selection).
    3) It is wise to give this vi a thread that is not time/processor intensive.
    4) I will send this later.

  • MAX cannot find two usb cameras at same time

    Hi,
    I want to use two usb cameras (Thorlabs DCC 1545M) in NI-IMAQdx in Labview, but it can only find one camera (the one plugged in earlier), and also only one camera is shown in MAX. Both cameras works in the software from the manufacturer, and if I unplug the 1st camera, the 2nd will show up in MAX after a refresh. 
    I found online that up to one camera is supported for each USB hub in Labview, and all USB ports in this computer are corresponding to a same hub. I don't know if this is causing the problem.
    Actually I don't need to take picture in both cameras at the same time, a programmed switch between the two cameras will work for me. 
    Any suggestion and comment will be appreciated.
    Solved!
    Go to Solution.

    Hello JYang,
    According to this link, you can acquire from multiple USB cameras simultaneously.  The limitation is on the manufacturer and how they interface with the DirectShow bus.  When you are using two cameras of the same make and model, it is sometimes the case that not enough information is present for IMAQdx to distinguish between the two cameras.  When you switch the cameras in MAX, do they come in as different cameras, or do they show up virtually the same?
    Since you said switching between them would work, I found an example that does just that.  Just make sure to give each camera a unique camera name.  Hopefully this will be useful for you.
    Also, there is quite a bit of discussion on this topic available on the discussion forum already.  Check out these related threads, or use the Search box to search for more.  There is quite a lot of information available!
    http://forums.ni.com/t5/LabVIEW/multiple-USB-cameras-in-Labview/m-p/833517
    http://forums.ni.com/t5/Machine-Vision/two-USB-camera-identification/m-p/2193960
    http://forums.ni.com/t5/Machine-Vision/Synchronized-capture-for-multiple-USB-cameras/td-p/1879647
    http://forums.ni.com/t5/LabVIEW/Multiple-USB-Camera-Image-Acquisition-using-Vision-Acquisition/td-p/...
    Patrick
    CLA

Maybe you are looking for

  • Executed and failed alternatively while testing a bpel process

    I have created a bpel process such that the response from the bpel is posted to a Queue. I have deployed the bpel and esb process successfully. While testing the bpel process,it is completely executed for the first time.(no error in esb and bpel cons

  • Managing photos (non-indesign related)

    I have a bunch of folders with a bunch of images and I've added the metadata into all the images to caption every photograph. What's the best way to print these photos with captions from the metadata - without using InDesign. Captions added with Phot

  • Touch Screen windows 8 internet explorer

    The computer has 2 different types of internet explorers. One is in the desktop area, this is the normal internet explorer browser. Then the 2nd one is the the apps start window, this internet explorer is the new version for easy touch screen use. Bu

  • Representing Time to millisecond precision

    I am looking for ideas for representing times down to the millisecond within an Oracle database... It looks like DATE is only good to a one second precision. I'm looking to store times (and dates) down to millisecond precision. I could store the date

  • IPhoto shared messages appear blank

    If I use share from iPhoto, the recipient often times gets a lengthy blank message. It seems like it's waiting for the images to download, but they never show up. Are there any solutions? Thanks! OS X and iPhoto fully up to date