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

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  … 


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 

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:”, you should:

$ echo "/usr/local/lib" >> /etc/ 
$ 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/ Permission denied”

    When trying to Run the last command

    “/usr/local/lib” >> /etc/

    Any ideas?


Leave a Reply

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

You are commenting using your 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