Install cvBlob on Raspberry Pi

cvBlob is a library for computer vision to detect connected regions in binary digital images. cvBlob performs connected component analysis and features extraction.
Before you start to install cvBlob, you must ensure Pi has installed OpenCV-2.4.2. cvBlob can help you to detect color blob quickly, because cvBlob is writen by C++, so your code must be .cpp format.
Let’s start:
1. Download cvBlob source

$ cd /home/pi
$ wget http://cvblob.googlecode.com/files/cvblob-0.10.4-src.tgz

2. Extract cvBlob Source

$  tar -zxvf cvblob-0.10.4-src.tgz

3. Go to extracted cvBlob folder and modify code

$ cd /home/pi/cvblob/cvBlob

Open cvlabel.cpp and find lines 30 and 40,manually change

const  char  movesE … 
const  char  movesI  … 

to

const  signed  char  movesE … 
const  signed  char  movesI  … 

Once you changed code, save cvlabel.cpp and go back to LXTerminal.

$  cd /home/pi/cvblob

4. Configure cvBlob build by running cmake

$  cmake . -DOpenCV_DIR=/home/pi/OpenCV-2.4.2/release

5. Compile by using make and install

$ make
$ sudo make install 

cvBlobInstall
6. Reboot your Pi

$ sudo reboot

7. cvBlob Testing
Connect webcam to your Pi

$ cd /home/pi/cvblob/samples
$ make
$ ./red_object_tracking

If you see “error while loading shared libraries: xxx.so”, you should:

$ echo "/usr/local/lib" >> /etc/ld.so.conf 
$ ldconfig

If red_object_tracking can run, means that you have successfully installed cvBlob, this example code provide one color detection(VERY GOOD), it’s similar to my single color detection.
Have a good night!

3 thoughts on “Install cvBlob on Raspberry Pi

  1. I get
    “bash: /etc/ld.so.conf: Permission denied”

    When trying to Run the last command

    “/usr/local/lib” >> /etc/ld.so.conf

    Any ideas?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s