Archive for July, 2012

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.


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                python2.7



Categories: C++, OpenCV

paw detection

July 11, 2012 Leave a comment

really really Awesome post. — A paw detection using Python ndimage.

Categories: Image Processing, Python

Config mex for Matlab on macOS

July 7, 2012 Leave a comment

I have been trying a lot to make the ‘mex’ working on my mac. But a lot of errors such as can’t find the ‘float.h’, although it is there! multiple tries… finally fix this problem today 🙂

I searched a little bit and finally found this link is quite useful. Basically, you have to make some changes of the ‘’ file. I have Matlab 2012a, and x-code 4 installed. I didn’t try the suggestion of downloading Xcode3, but the following suggestions work. Find the block of ;; maci64, and change MACOSX_DEPLOYMENT_TARGET to ‘10.6’. Also remove -isysroot in CFLAGS and CXXFLAGS (there are two -isysroot).  Here’s my final file.

 CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" 
 CFLAGS="$CFLAGS -fexceptions"
 CLIBS="$CLIBS -lstdc++"
 CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" 
 CXXLIBS="$MLIBS -lstdc++"



Categories: MacOS, Matlab

Animal Camouflage

July 5, 2012 Leave a comment

It’s quite interesting when I saw the page of the animal camouflage. I always assume that animal color/pattern are only for preventing themselves being seen by the predators. But I was wrong.

Dazzle Pattern is repeating pattern with high contrast. It is not so useful for hiding but quite useful to confuse the predator when it’s moving (see the figure for Zebra). And I surprisingly found that people have been using this on ship since early 19th.  🙂  This site gives more history information.

Zebra                        USS West Mahomet in dazzle camouflage, 1918

Categories: Interesting Stuff

Random Picking

July 3, 2012 Leave a comment

Here’s some interesting link I found from ‘ IMAGE AND VISUAL REPRESENTATION GROUP IVRG ‘

1. The free book of ‘joy of visual perception

2.CVonline: Vision Related Books including Online Books and Book Support Sites

Their algorithmRadhakrishna Achanta and Sabine Susstrunk, Saliency Detection using Maximum Symmetric Surround, International Conference on Image Processing (ICIP), Hong Kong, September 2010.

is dealing with the problem of “salient regions comprise more than half the pixels 
of the image, or if the background is complex, the background gets 
highlighted instead of the salient object. “. Tested on several images, though not working for all cases, but it’s quite a nice saliency detection since it dose avoid some problems  by most of the saliency detection — focusing mostly on high frequency, dense edge  region.


Also, it seem that a website is built based on their research for automatically cropping image to give the best composition.