quinta-feira, 14 de agosto de 2008

Computational Vision in Scilab

In this post I will share knowledge about Scilab and SIVP (Scilab Image and Video Processing toolbox).

To Ubuntu (and similars) users the Scilab can be downloaded and installed by package manager (synapic, apt-get, adept, ......), you just to download all files. The SIVP can be downloaded from here.

To install the SIVP is very simple, only do this steps as root:

  1. Unpack the file;
  2. In shell: cd {SIVP's directory}
  3. In shell: ./configure
  4. In shell: make
  5. In shell: make install
After this proceeding, the Scilab is all set to use computational vision resources: webcam's access, files (images and videos) readers, image display, ......

The SIVP uses the OpenCV API, and it can be downloaded and installed by package manager.

Before of start the Scilab, test your webcam with the Camorama (it can be downloaded and installed by package manager too).

This is the initial Scilab's screen:


The toolboxes button is detached.

To load the SIVP is only select it in toolboxes button.

This code is a example to use the webcam and display the images.

// Display images from webcam

Cam = camopen(); // open the webcam
nFrames = 1000; // set number of frames

for n = 1:nFrames, // main loop
im = avireadframe(Cam); // read the frame from webcam and hold the image in 'im' as a matrix of vectors RGB

imshow(im); // display image
end; // finish of the main loop

This example is the first step to complex computational vision algorithms.

Nenhum comentário: