Vision system

Overview

Our solution

Download webcam software


Overview

With the term 'Atificial vision system' we mean the optical, mechanical and elettronic devices necessary to acquire and process the images.
Essentially, it is possible to distinguish two different technical solutions that allow to realize a vision system.
The first solution uses a camera with an acquisition board; the second solution, more recent, less flexible, but also cheaper, uses a webcam.
There is a great variety of cameras in commerce, that can be distinguished in analogic and digital.
The analogic cameras are made with Vidicon tube. An electrons beam is projected on a screen with positive charge and variable resistence with the light to capture the images. The digital camera instead, todays very popular, are made with solid state sensors: the CCD or CMOS chips, devices chiper and long-lasting.
To connect a camera to a computer it is however necessary to use an acquisition card.
The acquisition boards may be frame grabber, devices whos main function is to collect the images into files of different formats, or devices that directly produce a digital video. When it is used a frame grabber, the video is generated via software. The programs are often expensive, and the best can cost as much as a good frame grabber.

The devices that directly produce a digital video can be divided into five categories: analog M-JPEG (motion JPEG), analog MPEG, DV (digital video), analog/DV combined and all the others (non standard). The acquisition boards of these systems can also be divided in real-time and non-real-time devices.
For analog boards we mean devices that receive in input an analog signal but naturally produce in output a digital signal.

It is not always possible to replace a conventional camera with a webcam, but in all the applications where the purpose of the vision system is only to make a video, without using the images as feedback signals in control loop, the features of a webcam are often sufficient.

The webcams can be often thought as closed systems, with few available details about the technical features, and it is hard to program them at low level. Nevertheless for some webcam models it is possible to find the API (application program interface) needed to program the drivers. In that cases a webcam can be freely used instead of a conventional and more expensive camera also in low level programming projects, replacing by software what is typically provided by hardware.


Our solution

In the telelab we use a webcam just to make possible for a user to follow the experiment in real time.
We have choosen the webcam on the basis of the availability of open drivers that allows to program directly in C the device. Next figure shows a logical scheme of a driver. The driver is generally made of several software modules, that interact with the operating system and the peripheral.

Usually, a commercial product like a webcam is sold as a closed system. To have more possibility to find a programmable webcam we have decided to look for a Linux compatible webcam, since the Linux world is certainly more close to the programmers. This is the reason why the Grab server is a Linux program.

Our webcam is a Philips webcam (model PCVC740).

It is possible to aquire images at the maximum frame rate of 60 FPS. The best resolution is for the VGA format. Unlike for the frame grabber, the webcams operate only at fixed resolutions. The images must be scaled via software, with algorithms very hard in term of time of execution.
The output signal of the Philips PCVC740 webcam is available only in the YUV 4:2:0 planar format. In the YUV format every pixel is mapped with three information: one for lumincance (Y) and two for colors (U and V). In the 4:2:0 format, the U and V datas are decimated horizontally and vertically for every 2x2 pixels block. At last, the planar format means that the informations are in the following order:

YYYY... YYYY
YYYY... YYYY
UU... UU
VV... VV

Finally, there many way to realize a digital video starting from the grabbed frames. All of them are based on compression algorithms to riduce the file dimension and obtain something suitable for Internet trasmissions. A lot of these algorithm uses a proprietary compressed format, so the users are often obliged to download and install a specific decoder, like Real Video or Quick Time. To avoid this disadvantage we have decided to use the freely distributed Berkeley MPEG-1 video encoder to produce digital video in MPEG format.


Downloads webcam software

Download here a simple program that will help you to test your webcam and to understand how do to program it. This program is for Linux only!
The zip file contains the executable files and the C source code.

grabber.zip


Grabber brief description

This program creates a video MPEG file using a usb Philips webcam (compatible with the models 657/680/690/730). It works starting from a collection of frames grabbed off line. Actually it runs at 24 frames per second. If you want to use a different FPS, modify the variable FPS in the source code.
The program creates a set of .jpg files, named "webcamImageX", where X is a progressive number. These files are the frames used to realize the video MPEG. Every frame is a RGB24 image in the format 320 x 240.
It also creates the configuration text file "mpegspec", that is used by the MPEG encoder, and the file named "video.mpg", that is the final result.
To create a file in the MPEG format I used the freely distributed Berkeley MPEG-1 Video Encoder. The executable file is packed in grabber.zip.

My program uses the library for Linux jpeglib. You should install it before using the grabber.
Download the source code or the compiled files:

libjpeg v6 source code

libjpeg compiled

For information about the Philips webcams, Linux support and API guide see:

http://www.smcc.demon.nl/webcam/index.html

About the Berkeley MPEG tools see:

http://bmrc.berkeley.edu/frame/research/mpeg/


| Architecture | Vision system | Software details | People |