Basic tutorial to Cv4Logo

This short introduction describes use of the component Cv4Logo in Imagine Logo. The best way to read this tutorial is with your hands on the keyboard of a running Imagine Logo session.

First, a cv4logo object has to be created, resulting in a new window with an image, which can be shown, and hidden, and it can display images from various sources, for example from the first available camera:

    new "oleobject [comname cv4logo name cv]
    cv'show	cv'hide	cv'show
    cv'source "cam 0
or it can contain a video:
    cv'source "avi "hello.avi
or static image:
    cv'source "file "tomas.jpg
which can even be downloaded directly from the Internet (if connected):
    cv'source "url "|http://www.bioinformatics.uwaterloo.ca/~tvinar/tomas.jpg|
If the image is changing meanwhile, we can require that the window will reflect the changes:
    cv'source "livefile "tomas.jpg
or:
    cv'source "liveurl "| http://www.uakom.sk/kamera/jpeg/bbb.jpg|
The update rate can be controlled as required:
    cv'updaterate 10   ; 10-krát za sekundu
The component is able to detect faces (or other characteristic patterns according to learned description):

The tracking can be turned on or off, and the coordinates of the detected faces can be retrieved by:

    cv'tracking "on	  cv'tracking "off  	print first parse cv'getfaces
In this way, we could for example control a robot by movements of our face:

cv4logo will track the face position, and according to the changes, we can send movement commands to the robot.

To change a recognition pattern, we can use the following command:

    cv'trackingparameters
      "|haarcascades\haarcascade_upperbody.xml|     ; or a different pattern-describing file
If the image contains a scene with contrasting polygons, for example:

they can be detected using:

    print cv'detectpoly "false   ; where the detection is controlled by severeal parameters adjustable by:
    cv'detectpolyparam threshold sensitivity minperimeter maxperimeter
where threshold determines the boundary between white and black, sensitivity determines the minimum length of side to be taken into account (relative to the size of the polygon), minperimeter and maxperimeter are allowed intervals for the dimensions of the detected polygons.

The image retrieved from usual cameras is often not regular, but distored, that is straight lines are forming curves. In order to use the image for more accurate information about the observed environment (for example for robot localisation, or detecting dimensions in a geometric task), the camera needs to be calibrated:

A set of commands controls the calibration and image clipping using standard algorithms. (see readme.txt for more details)

The current image can be stored to a file or memory, and retrieved and used later. A local image source (for example USB camera) can be made available to other computers on the same network. To turn the image server on, use:

    cv'frameserver "on
so that any user can connect to the same image, by specifying the IP address of the image server as its image source, for example:
    cv'source "remote "192.168.145.146
The users can send messages one to another in a client-server mode: Server:
    make "servId cv'listen 12345		; or some other port number
Client:
    make "connId cv'connect "192.168.145.62 12345
Server:
    make "client1 cv'accept :servId
And on both sides:
    cv'send connection_id message
    print cv'receive :connId
For example:
    cv'send :client1 "hello
    cv'send :connId "hiThere!
    print cv'receive :client1
See the ReadMe.txt file for detailed description of Cv4Logo component.