Example Code

Acquire Images from High Speed Camera and Save them to a Binary File

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Vision Development Module
  • LabVIEW

    Driver

  • NI Vision Acquisition Software

Code and Documents

Attachment

Overview

The example demonstrates how to acquire images and save them to a binary file with buffering.

 

Description

The example acquires images from a color camera and then converts the image data into an array. In another loop decoupled from the acquisition loop with a queue the array data is written to a binary file.

If your camera acquires grayscale images, change the IMAQ ImagetoColorArray to an IMAQ ImagetoArray function.

 

Requirements

 Software

  • LabVIEW 2012 Base Development System (or compatible)
  • Vision Development Module 2012 (or compatible)
  • NI-IMAQdx 4.0 (or compatible) (example would generally work with another (IMAQ type) driver too)

 Hardware

  • NI-IMAQdx driver supports the following buses and standards:
    Gigabit Ethernet Cameras Supporting GigE Vision, FireWire IEEE 1394 Cameras, USB 2.0 Cameras Supporting Microsoft DirectShow (often called 'webcam'), USB 3.0 Cameras Supporting USB3 Vision

 

Steps to Implement or Execute Code

  1. Open the attached file
  2. Select the path to the binary file
  3. Select the camera name
  4. Run the VI

 

Additional Information or References

Acquire Image from Camera and Save to Binary File - Front Panel.png

 

Acquire Image from Camera and Save to Binary File - Block Diagram.png

 

KnowledgeBase: What Is the Difference Between NI-IMAQ, NI-IMAQdx, and NI-IMAQ I/O?
http://digital.ni.com/public.nsf/allkb/0564022DAFF513D2862579490057D42E
 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text 'NIVerified'. Read here for more information about the new Example Guidelines and Community Platform.**

Applications Engineer
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
tomkut
Member
Member
on

How much faster is it to use the image binary format?

What's the advantage of using a queue as a saving buffer instead of the camera acquisition buffer itself?