Planar object detection - which technique to use?

I’m looking at the various object detection algorithms, such as SURF, SIFT, Ferns, BazAR…

Can anyone recommend the most robust technique for object tracking?
I want to track a logo in real-time, but not sure where to start!

Thanks.

I don’t think there’s a “most robust”. Of the ones I’ve worked with a bit they come in 2 types.
Non-training: SIFT SURF GoodFeaturesToTrack and ORB

http://mirror2image.wordpress.com/2009/01/25/fast-with-surf-descriptor/
http://computer-vision-talks.com/2011/07/comparison-of-the-opencvs-feature-detection-algorithms-ii/

The comparison makes ORB look really good, but, and this is a big but, ORB sucks at scaling. SIFT and SURF are reliable but slow, the biggest difference between them being that SURF is proprietary and SIFT isn’t. Both identify key points in an image and locate those keypoints in an incoming frame. GFTT is not as accurate, drifts all over, but is super fast. None of these involve training.

Then there’s training based ones: FERN
http://cvlab.epfl.ch/alumni/oezuysal/ferns.html

FERN is fast training, It makes a model of what the important features of the image look like and compares that to the incoming video frame. You can see Theo using it here:

http://vimeo.com/10078874

The other kind of training is building a Haar classifier, which requires hundreds or thousands of images and takes a few hours to parse through them all and see what works, and you don’t know whether you have a good model until you’re done and then you test it.

A lot of that you probably knew, but just in case, I’m trying for thoroughness in general :slight_smile:

Thanks Joshua,

I’ve already dug into SIFT and got a demo working. Results are ok, but not stellar.
I guess I’m curious whether training will give much better results. Can anyone confirm this?
I’d had also thought of Haar but felt that some of the other algorithms were better suited to this problem…but maybe a really well trained Haar tracker could be better.

I think Active Appearance Models could also be in the list, but again I’m not sure how it compares.

I haven’t used AAM, depending on what your image to track looks like, you might want to try FERN, Jeff Crouse posted a nice example here: http://forum.openframeworks.cc/t/boards—interactive-magazine-cover/3483/39

FERN is pretty robust, I’ve found it to be better than SIFT usually.

for planar object detection, the best i’ve tried is ferns. There’s an updated ofxFerns in the artvertiser for android code. I modified the library to run slightly faster in mobile platforms and the parameters of the training generate a model that is not so big as theo’s but not so robust either so you probably want to mix the 2

Thanks, found it!
When you say updated, do you just mean optimised for Android or have you made other changes?

internally ferns uses gaussian filters to create a gaussian pyramid (as most of this algorithms). Ferns used their own implementation for the gaussian filter, i changed it with openCV one which seemed to be a enough faster than theirs to make it usable on a mobile. You can actually enable and disable it with a constant in artvertiser_constants.h:

  
  
#define USE_CV_GAUSS  
  

if you want to get rid of that file, you can also remove the include in fine_gaussian_pyramid.cc

but the main difference with the original example and theo’s ofxFerns is in the parameters to do the training. The original was 300Mb which was unusable on a mobile, with the parameters i’m using it’s about 20Mb but not so robust as the original (although it works still pretty well)

you can change those parameters in ofxFern::initTracker in the call to planar_pattern_detector_builder::build_with_cache

My version also has some method to get the quad of the planar object and the state of the detector

Not to hijack the thread, but I’m curious about the FernClassifier and FernDescriptorMatch in OpenCV 2.3, I haven’t seen anyone using them in anything yet though.

i tried to used them but in the example implementation in the ferns page there’s some tracking stage, once the detector finds the object in the image that makes it super fast and doesn’t seem to exist in the openCV version. Even the detection phase seems way slower than the original but didn’t really tried very much so perhaps there’s some parameter that can be adjusted.

This is all very interesting, def. not off topic!

Regarding SIFT, if anyone’s interested, I managed to get these two examples working:
http://blogs.oregonstate.edu/hess/code/sift/
http://ivt.sourceforge.net/ (there’s a SIFT example in there)

SIFT seems to work, but didn’t give great results for my images, but perhaps my selection wasn’t very good. One of the demos works very well with the supplied example images.

After fixing some errors in the installation, I finally managed to compile Bazar (http://cvlab.epfl.ch/software/bazar/index.php), but couldn’t get a visual demo working (the command-line demos worked, but were pretty cryptic). Bazar seems a little out of date and unmaintained.