Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Customer Solutions

Synchronizing Machine Vision and Data Acquisition for Data Streaming Applications

Author(s):

Adriaan Brebels, CIT Engineering nv

Industry:

Life Science

Product:

Data Acquisition, LabVIEW, PXI/CompactPCI, Vision

The Challenge:

Developing a PC-based system for logging, editing, and transmitting back synchronous data and video signals.

The Solution:

Building multipurpose instruments using National Instruments LabVIEW software and hardware for compression, synchronization, and visualization.


Storing Data and Video Signals
SDVD tools store several hours of data and video signals on local disk. We use a gunlock to achieve synchronization between NI-DAQ and frame-grabber boards. We add a timestamp to each image, and several coding and decoding standards (CODECs) for compression of video (MJPEG, MPEG4) compress the video stream.

We can store, edit, and save information on CD or another storage device with the SDVD tools supplied. The SDVD tools are useful in revalidation study, modeling, and sleep laboratory applications.

In 2000, a surgeon approached CIT Engineering with a request for a complete and flexible PC-based video recorder for performing operations. The system we developed allows the surgeon to select easy and fast time slots used for references or training. The system writes the selected time frames directly to CD or DVD, so a standard PC can read the images. The system is capable of putting additional information, such as timing and identification, into each video frame. The quality of the system’s extracted images is acceptable for further use.

The cameras used during the operation, under microscope, deliver full Phase alternating Lines (PAL) (or other standard video signals) quality. The system transforms 25 frames of true color images of 768 *576 pixels per second. Without compression, this is approximately 32 Mbytes or 20 minutes on a 60 Gbyte hard disk with Redundant Arrays of Inexpensive Disks (RAID) controller.We also designed a system that can handle data and video in the same manner.

True Color Video Digitizer (TCVD)
One requirement of the system was the ability to add information to each frame of the video stream. We selected NI PCI-1411 to begin experiments, because we could not use a frame grabber with an on-board compression. For the compression, we connected to available CODECs, so we could use advances in compression algorithms immediately in our product. It was important that the compression time was nearly equal for each frame to prevent us from overlooking images. With software compression, like MPEG4, we achieved more compression, although the compression time depends on the movement in the images. The MPEG4, and implementations based on this standard, behave properly because the system stores a reference frame once a second.

After grabbing the frame, we added the specific information (time stamp, name) into the first line. We used the Morgan Multimedia Motion JPEG (MJPEG) CODEC. For the software development, we used NI LabVIEW and IMAQ Vision software. To achieve more flexibility for visualization, we wrote our own Active-X visualization component.

All these components were built together to form the True Color Video Digitizer (TCVD). Surgeons now use this product to operate under microscopes. During the operation, they can add comments from a separate information file. Directly after the operation, they roughly select the sequences of interest. These sequences combine into a new file with MJPEG, allowing us to write them directly to CD. If these sequences require more than 10 minutes, a CD stores one hour.

If we use the Microsoft Multimedia Player or QuickTime, we can view the video, but the timing and identification information from the first line is lost. Our specific viewer restores the original information.

Synchronous Data and Video Digitizer
Synchronization of data and video requires that we choose which one will trigger the other. The trigger can come from the image to do the data acquisition or from data acquisition to trigger the video. The most flexible option is to trigger an image from the acquisition board. We choose this method when the frame rate was less than 25 frames. If there are exactly 25 frames, we must complete the synchronization from the video signal. We used the horizontal synchronization (HSYNC) signal as basic clock for the data acquisition. A counter of the data acquisition board can divide the HSYNC. We need the same number of samples for each image, so the data rate can be 25 S/s, 125 S/s, 625 S/s, 3,125 S/s and 15,625 S/s on each data channel.

We add a timestamp into each frame. We store the data into a separate data file, which contains the number of channels and the sample rate. Using the software, we calculate the corresponding data for each image into the video stream. Since we do not compress the data of these signals, the size of the file can become quite large. For eight signals, at 5,000 S/s we have, depending on the data type of the signals, about 1 Gbyte per hour.The current system can capture 10 frames/s and eight signals at 5 kS/s over the course of more than 10 hours.

While editing the data, the system correlates the signals with the selected time frames of the video signal. The results of the editing phase are two new files – one for the video, and one for the corresponding data signals.

We can view the video with standard applications, such as the Windows Media Player or QuickTime, but the corresponding data is not shown. The SDVD viewer provides the only method for playing the video and the digitized data at the same time.

Applications and Video Toolkit
With the SDVD, we can store video and data signals over several hours. We use this for security, experiments in hydrodynamics, sleep labs, revalidation, and chemical reactions with long dead time. This SDVD replaces equipment everywhere we use video recorder and data applications.

For those who wish to write their own applications with synchronized data and video, there is a LabVIEW video toolkit to support the engineer. The toolkit hardware includes a printed circuit board, the National Instruments CA1000 box. This hardware consists of a video amplifier and a genlock to reach the HSYNC signal. The trigger signal from the data acquisition board communicates with the trigger input of the frame-grabber board. The box automatically selects from the different trigger modes.

We choose LabVIEW for virtual instrumentation, IMAQ for compression applications, and an Active-X window for selecting and retrieving frames out of compressed files and visualization.

For more information, contact
Adriaan Brebels
CIT Engineering nv
Kleinhoefstraat 6 B.E.M.T.
B-2440 Geel Belgium
Tel: 32 14 57 96 50
Fax: 32 14 57 96 51
E-Mail: adriaan.brebels@citengineering.com

View the PDF
citbelgium.pdf

View the entire user solution in Adobe Acrobat PDF format.