Archive

Archive for the ‘C++’ Category

Config opencv in EclipseC++

July 26, 2012 Leave a comment

To use Eclipse C++ for your opencv related project, there are two key parts in configuration.  This post give a very clear instruction.

Note

If you do not know where your opencv files are, open the Terminal and type:

pkg-config --cflags opencv

For instance, that command gave me this output:

-I/usr/local/include/opencv -I/usr/local/include

So if you check the files under the ‘include folder’:

$ls /usr/local/include/opencv
cv.h        cvaux.hpp    cxcore.hpp    highgui.h
cv.hpp        cvwimage.h    cxeigen.hpp    ml.h
cvaux.h        cxcore.h    cxmisc.h

If you don’t know where your libraries are (or you are just psychotic and want to make sure the path is fine), type in Terminal:

pkg-config --libs opencv

My output (in case you want to check) was: .. code-block:: bash

-L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann

 

1. Include the right path

 

2. Put in right liker information(search path and filenames)


If check the linker path:you may find that opencv related libs are with prefix of lib, and suffix as x.x.x.dylib

the right way to put these files into the linker librarys, you need to strip off the prefix(lib) and suffix(dylib), but you need to keep the version number is there is any.  You could include all of them or just few top ones, which really depends on your application.

$ ls /usr/local/lib
QtCore.framework            libjasper.1.0.0.dylib
QtDeclarative.framework            libjasper.1.dylib
QtDesigner.framework            libjasper.a
QtDesignerComponents.framework        libjasper.dylib
QtGui.framework                libjpeg.8.dylib
QtHelp.framework            libjpeg.a
QtMultimedia.framework            libjpeg.dylib
QtNetwork.framework            libopencv_calib3d.2.3.1.dylib
QtOpenGL.framework            libopencv_contrib.2.3.1.dylib
QtScript.framework            libopencv_core.2.3.1.dylib
QtScriptTools.framework            libopencv_features2d.2.3.1.dylib
QtSql.framework                libopencv_flann.2.3.1.dylib
QtSvg.framework                libopencv_gpu.2.3.1.dylib
QtTest.framework            libopencv_highgui.2.3.1.dylib
QtWebKit.framework            libopencv_imgproc.2.3.1.dylib
QtXml.framework                libopencv_legacy.2.3.1.dylib
QtXmlPatterns.framework            libopencv_ml.2.3.1.dylib
gcc                    libopencv_objdetect.2.3.1.dylib
libQtCLucene.4.8.1.dylib        libopencv_ts.2.3.1.dylib
libQtCLucene.4.8.dylib            libopencv_video.2.3.1.dylib
libQtCLucene.4.dylib            libtbb.dylib
libQtCLucene.dylib            libtbbmalloc.dylib
libQtCLucene.prl            libtiff.3.dylib
libQtUiTools.a                libtiff.a
libQtUiTools.prl            libtiff.dylib
libQtUiTools_debug.a            libtiffxx.3.dylib
libQtUiTools_debug.prl            libtiffxx.a
libfrtbegin.a                libtiffxx.dylib
libg2c.0.0.0.dylib            node
libg2c.0.dylib                node_modules
libg2c.a                phonon.framework
libg2c.dylib                pkgconfig
libg2c.la                python2.7
libiberty.a

 

 

Categories: C++, OpenCV

3D Reconstruction (I)

January 25, 2012 Leave a comment

Today’s my first test on Bundler http://phototour.cs.washington.edu/
I didn’t use the source cause there are many packages needed to be set up first, so I follow the recommendation using the binary package (bundler-v0.3-binary.zip).
There are some error I encountered cause I carelessly NOT copying the libANN_char.so into the the required path. Well this can be easily fixed by changing/adding the dir-path of libANN_char.so to your LD_LIBRARY_PATH. In my case, the LD_LIBRARY_PATH is empty, so I simply create this env-variable.

export LD_LIBRARY_PATH=./bin/

This should be the directory path to the libANN_char.so, otherwise you will get error that ‘error while loading shared libraries: libANN_char.so: cannot open shared object file: No such file or directory’.

So read carefully for the ‘Before you begin’ section. Also, if you are trying older version, e.g. v0.2, you will need to change the BASE_PATH for multiple files, such as the sift.txt. Just check if there is BASE_PATH for your ‘TO-DO’.

Find my gtk version on ubuntu
$ dpkg -s libgtk2.0-0|grep ‘^Version’

For the 3D models in Python
http://wiki.python.org/moin/NumericAndScientific
Blender.org
http://www.vrplumber.com/py3d.py
http://make3d.cs.cornell.edu/

# http://se.cs.ait.ac.th/cvwiki/matlab:tutorial:3d_reconstruction_with_calibrated_image_sequences#section_23d_reconstruction

# http://www.timzaman.nl/?lang=en

# [Vision] Depth estimation from Blur estimation

# http://www.timzaman.nl/?p=495&lang=en
http://www.timzaman.nl/?p=179&lang=en
http://www.timzaman.nl/?p=501&lang=en

#Camera Calibration Toolbox for Matlab
http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/links.html

# FIT3D
http://www.fit3d.info/”>http://www.fit3d.info/

# OpenSceneGraph
Install OpenSceneGraph on Windows: http://dwightdesign.com/2009/05/installing-openscenegraph-280/
Install on Ubuntu:
apt-get build-dep openscenegraph
apt-get install openscenegraph