1

I'm having difficulty of installation/ compilation of cvBlob into OpenCV Microsoft Visual Studio 2010 in WINDOW. I understood that there is a installation guide work on linux but I couldn't find how it can be done in Window.

I would appreciate if someone may provide me the installation guide in WINDOW as I found that cvBlob is very useful for my project.Thanks

karlphillip
  • 92,053
  • 36
  • 243
  • 426
user1097675
  • 33
  • 1
  • 2
  • 6

2 Answers2

4

For the moment there is no pre-built cvBlob for Visual Studio, so you are going to have to compile it yourself.

So before you start, make sure you have OpenCV installed in your computer.

Download CMake for Windows. CMake creates the Visual Studio project files that are needed to compile cvBlob.

Once you open cmake-gui, fill in the edit boxes "Where is the source code" and "Where to build the binaries" accordingly (adjust these to your settings):

  • C:/Documents and Settings/user/Meus documentos/Downloads/cvblob-0.10.3-src/cvblob
  • C:/Documents and Settings/user/Meus documentos/Downloads/cvblob-0.10.3-src/cvblob/build

Note: the build folder was created manually.

Click on button Configure to check for dependencies (CMake will try to find OpenCV on your computer) and then on Generate so it can generate the Visual Studio project files.

From here on it's the standard compilation procedures.

karlphillip
  • 92,053
  • 36
  • 243
  • 426
3

karlphillip's answer is correct, and you should follow it. Be advised, however, that if you're building the files using VS 2010, a few of them will fail and return this error:

LINK : fatal error LNK1104: cannot open file '..\lib\Debug\cvblob.lib'

To get around this, add the following to your cvblob.h file:

#define EXPORT __declspec (dllexport)

In the extern "C" block below that, add EXPORT before every function. For example:

EXPORT double cvContourPolygonArea(CvContourPolygon const *p);

After running into this error myself, I found the explanation here (which I adapted to make this post; all credit belongs to this link's author): https://code.google.com/p/cvblob/issues/detail?id=34

Just something you might want to watch out for. Hope it helps!

Connor
  • 199
  • 1
  • 2
  • 10