Installation

From OpenCV on the Cell

Jump to: navigation, search

This page shows how to install the OpenCV library and the CVCell module. If you succeed installing, run demonstration. Please experience the Cell/B.E..

Steps of a procedure

First of all, please uninstall the OpenCV Library and the CVCell module, if you already have installed them.


Step 1: Install the OpenCV library and the CVCell module

Get the RPM package from https://sourceforge.net/project/showfiles.php?group_id=204037 .

Exexute as follows. The OpenCV Library and the CVCell module are installed to /opt/cvcell:

$ rpm -ivh opencv-1.0.0-cell.ppc.rpm 
$ rpm -ivh opencv-1.0.0-cell-devel.ppc.rpm 
$ rpm -ivh cvcell-0.1.0-1.ppc.rpm 
$ rpm -ivh cvcell-demo-0.1.0-1.ppc.rpm 


Step 2: Run demonstration

Facedetect Sample

This sample is the example which executed the sample program attached to OpenCV. The following figure is an example of the face detection program.

Output of Facedetect
facedetect


You can set the number of SPE when you run programs if you specify the value of CVCELL_SPENUM environment variable. Please execute as follows:

$ cd /opt/cvcell/bin
$ export LD_LIBRARY_PATH=/opt/cvcell/lib:$LD_LIBRARY_PATH
$ CVCELL_SPENUM=0 ./facedetect --cascade=../share/opencv/haarcascades/haarcascade_frontalface_alt.xml 
detection time = 832.045ms

In this case, PPE only was running. The average of detection times is about 840ms.

Please execute the following:

$ CVCELL_SPENUM=6 ./facedetect ---cascade=../share/opencv/haarcascades/haarcascade_frontalface_alt.xml 
detection time = 102.563ms

In this case, PPE and SPE*6 were running. Compare with the previous detection time. The average of detection times is about 102ms.

The value of CVCELL_SPENUM must be reffered to when the optimized function runs. All applications are made as usual OpenCV applications. It is time when runs the optimized function in there is a modified OpenCV Library and CVCell module.

If you cannot find any changes between previous two results, execute the following. Please execute the second command ls /spu while the program that was executed by the first command is running:

$ ./facedetect ---cascade=../share/opencv/haarcascades/haarcascade_frontalface_alt.xml &
$ ls /spu
 spethread-2349-268517544  spethread-2349-268520704 spethread-2349-268521440
 spethread-2349-268520040  spethread-2349-268521368 spethread-2349-268521628


The output shows threads of SPE that is running. As you know, if the program ends, anything doesn't occur even if the second command is executed. Installation is successful when you can see SPEs were running.

If you are enable to use webcam (See Installing the Webcam), facedetect runs on movie that is captured from webcam. If not, runs on lena.jpg.

Views
Personal tools
Toolbox