Archived entries for opencv

Facial Appearance Modeling/Tracking

I’ve been working on developing a method for automatic head-pose tracking, and along the way have come to model facial appearances. I start by initializing a facial bounding box using the Viola-Jones detector, a well known and robust detector used for training objects. This allows me to centralize the face. Once I know where the 2D plane of the face is in an image, I can register an Active Shape Model like so:

After multiple views of the possible appearance variations of my face, including slight rotations, I construct an appearance model.

The idea I am working with is using the first components of variations of this appearance model for determining pose. Here I show the first two basis vectors and the images they reconstruct:

As you may notice, these two basis vectors very neatly encode rotation. By looking at the eigenvalues of the model, you can also interpret pose.… Continue reading...

Keyframe based modeling

Playing with MSERs in trying to implement an algorithm for feature-based object tracking.  The algorithm first finds MSERs, warps them to circles, describes them with a SIFT descriptor, and then indexes keyframes of sift vectors by using vocabulary trees.   Of course that’s a ridiculously simplified explanation, but look at what it’s capable of!!!:

 Continue reading...

OpenCV 2.0 Introduces CPP Style Coding and More

No more void *‘s apparently. And they’ve got constructors and destructors.

Check out the documentation here:

Notably, the memory management seems to be much nicer as destructors are called when there are no more references to the object.

As well, quickly accessing data row or plane major seems to be much easier now:

e.g. plane access:
// split the image into separate color planes
vector planes;
split(img_yuv, planes);

// access with iterators:
MatIterator_ it = planes[0].begin(),
                    it_end = planes[0].end();

As well, they have implemented STL-like class traits for easily declaring matrices with the normal c++ primitives without having to remember CV_64F etc…

Mat A(30, 40, DataType::type);
Mat B = Mat_ >(3, 3);

There is a whole lot more introduced including a revamped interface system, many more machine learning and computer vision algorithms, OMP integration, and probably a lot more.  I’ll be playing with it to see what else is going on.  Hopefully the openframeworks community will pick up on it as well and integrate it into their next major release.  I know I’ll be doing so for my projects.… Continue reading...

OpenCV 1.2.0 (2.0 Beta)

Win32 installer

Taken from the changelog:

New functionality, features: < << – General:
* The brand-new C++ interface for most of OpenCV functionality
(cxcore, cv, highgui) has been introduced.
Generally it means that you will need to do less coding to achieve the same results;
it brings automatic memory management and many other advantages.
See the C++ Reference section in opencv/doc/opencv.pdf and opencv/include/opencv/*.hpp.
The previous interface is retained and still supported.

* The source directory structure has been reogranized; now all the external headers are placed
in the single directory on all platforms.

* The primary build system is CMake, (2.6.x is the preferable version).
+ In Windows package the project files for Visual Studio, makefiles for MSVC,
Borland C++ or MinGW are note supplied anymore; please, generate them using CMake.

+ In MacOSX the users can generate project files for Xcode.

+ In Linux and any other platform the users can generate project files for
cross-platform IDEs, such as Eclipse or Code Blocks,
or makefiles for building OpenCV from a command line.

* OpenCV repository has been converted to Subversion, hosted at SourceForge:
where the very latest snapshot is at,
and the more or less stable version can be found

Continue reading...


I’ve recently finished up a project in collaboration with a Glass Artist, Agelos Papadakis. We built a structure of 25 glass neurons the size of a face and chainded them together in a 3x3x5 meter sculpture. We had 2 cameras hidden in the piece tracking peoples faces and a projector then creating visualizations of the recorded faces resembling something like a cloud of neurons firing in different patterns. We presented it first in Edinburgh at Lauriston Castle’s Glasshouse, and then at the Passing Through exhibit in the James Taylor Gallery in Hackney:






It’s a bit tricky trying to film the piece since it uses projection onto glass. Sadly I’m left with only a few images that try to portray what went on.

Here’s the code, It makes use of the openframeworks library so you will need to be familiar with how to setup an XCode project with the openframeworks library if you plan on using it.

The original idea was to use glass balls so that’s why all the code says glassBalls instead of say glassNeurons. If you manage to get it running, press ‘d’ to see the live video input. As it collects faces, it fills up … Continue reading...

OpenCV with Processing using Eclipse

My students for the Digital Media Studio Project here at the University of Edinburgh have asked me to present a small workshop on using some aspects of the environment. I’ve worked up something and thought I could share it online as well. I’ve setup a google code repository with the necessary files. The code simply highlights what you could find throughout the discourse and the OpenCV example files though is more thoroughly commented and organized.

A few notes, I really dislike the Processing IDE. Maybe it’s just because I’ve used IDE’s like VS, Netbeans, Eclipse, XCode etc… and I haven’t really played with Processing enough to have a well founded basis in the functions available. I believe going through a few extra steps to setup an IDE like Eclipse makes the task of programming much easier though at the cost of a bulky editor that may not be so easy to setup at first…

Eclipse is an (Integrated Development Environment) IDE for many coding languages, one of which is Java. Some advantages:

  • code completion – automatically see possible choices for all members belonging to a class definition, such as functions and their arguments.
  • javadocs – javadoc is
Continue reading...

Copyright © 2010 Parag K Mital. All rights reserved. Made with Wordpress. RSS