CameraGrabber

From Lehigh RTMD Wiki
Jump to: navigation, search

CameraGrabber is a Java application meant to be run under Linux that allows a user to capture images from multiple webcams based on a SCRAMNet counter or time-based. It creates a separate directory for each webcam JPEG source and appends the trigger number at the end of the file. It will pad the number with the correct amount of zeros so the file names stay in the correct order.

The source lives under the RTMD Projects section of the Subversion code repository as edu.lehigh.nees.util.CameraGrabber. If cameragrabber.jar file must be rebuilt, it must include edu.lehigh.nees.scramnet.ScramNetIO.class. The application lives on neestele under /usr/rtmd/CameraGrabber. A wrapper named 'run' is supplied.

Contents

Types of streams

There are currently three used JPEG streams:

  • AXIS: 192.168.1.1/jpg/image.jpg
  • Sony: 192.168.1.2/oneshotimage.jpg
  • DCS-9000: 192.168.1.3/IMAGE.JPG

Capturing images based on SCRAMNet counter

This function requires the SCRAMNet to push out an integer counter at a specified address. The recommended address is 61 as specified in Configure SCRAMNet Memory Map. This can be done in Matlab, Java, xPC or any other applications that have access to the SCRAMNet.

Below is an example to capture 2 web cams triggered from SCRAMNet address 61.

./run --trigger 61 192.168.1.1/jpg/image.jpg 192.168.1.2/oneshotimage.jpg

Below is an example of how to write a SCRAMNet integer to address 61 in Java.

ScramNetIO scr = new ScramNetIO();
scr.initScramnet();
int count = 1;
scr.writeSCRint(61,count);

Capturing images based on a timer

This function captures images based on the system timer. It can be no less than 10ms however the best response of cameras is about 100ms or 10fps. Dropped frames may occur at faster speeds.

Below is an example to capture 2 web cams triggered at 5fps.

./run --timer 200 192.168.1.1/jpg/image.jpg 192.168.1.2/oneshotimage.jpg

Password Protected streams

Some streams are password protected (ie, DCS-9000). In order to capture these streams you must append the username and password to the end of the stream using commas to separate each token.

./run --timer 1000 192.168.1.3/IMAGE.JPG,username,password

Capturing FlexTPS streams

In some cases, it is easiest to capture the feeds provided by FlexTPS. To do this, a special wrapper called 'runflextps' is provided in the same directory. The arguments are the same however the path for a FlexTPS camera is denoted as the following:

./runflextps --trigger 61 http://[flextps server]/feeds/[Feed Name]/mjpeg/[Required FPS]
Personal tools