Tutorial

Set up camera

Adjust luminosity and contrast

penguin640x480.jpg

640x480 image of example setup

While doing the physical setup, you should choose image size, sampling rate and the threshold for the edge detector. Depending on the underlying hardware, you can also adjust brightness and contrast.
    cd micron-vision/micron-vision
    ./edgecam -t 12 -s 2 --v4l -w 320 -h 240 --brightness=15000 --contrast=50000
    

You should choose to cut the camera-image with the option '-f <number of pixels>', if the images are showing a black frame creating edge-features!

To get all available options, there is the --help option

    ./edgecam --help
    
edges.gif

160x120 edge image

Try an empty test-run

Create a copy of the file empty.xml to work on and adjust the entries for the camera-size (micron-vision/calibration/image-size/(x|y)) using a text-editor.
    cp empty.xml myconf.xml
    

Do a dry-run of the vision-software with the following command:

    ./micron -c myconf.xml --v4l --brightness=15000 --contrast=50000
    

This will check, wether the driver really is giving images of the requested size.

If the camera cannot be adjusted to the desired size, you'll get an error-message. You should always try twice, as some drivers will give you an image of the desired size only after the second run.

You can get all command-line options by doing

    ./micron --help
    

Grab focus set

Grab focus stack

There is a separate package with a script for grabbing focus stacks called capture_stack_images.py. The documentation is in capture_stack_images.txt.

penguin320x240.jpg

320x240 image of example setup

Simple image sequences can be grabbed with the cam tool (not in this software package either).

Crop images

Use a graphics-program (f.e. xv) to get the desired area of the focus-set. Then you can crop all images with ImageMagick. F.e.:
    for i in input*.png; do convert $i -crop 248x188+83+60 cropped$i; done
    

penguincropped.jpg

Cropped image only showing penguin

Alternatively you can use the python script crop_images.py (not part of this package).

Setup recognition

Create configuration-entry.

Modify the configuration-file. recognition.xml is an example of a minimal configuration for recognising an object (with comments).

It's recommended to use an editor with syntax-highlighting for XML.

You should test your configuration on live image-feed

    ./micron -c myconf.xml --v4l --brightness=15000 --contrast=50000 --verbose
    
or on a image-sequence:
    ./micron -c myconf.xml --verbose testimages*
    

Setup tracking

Create a copy of the working recognition-file. Modify the configuration-file. test.xml is an example of a configuration-file (with comments), where recognition has been optimised and tracking has been added.

You should test your configuration on live image-feed

    ./micron -c myconf.xml --v4l --verbose --brightness=15000 --contrast=50000
    

penguinscene.jpg

Recognition of penguin

penguinscene2.jpg

Subsequent tracking of penguin

or on a image-sequence:
    ./micron -c myconf.xml --verbose testimages*
    

doxygen-1.4.5 documentation for micron-vision - Tue Jan 17 15:29:15 2006