libBGS released!

Today I release some of the code I’ve been using for my masters as libBGS. I created libBGS from modifying the original libBGS by Donovan Parks. The major changes include updating to use OpenCV 2.xx and making better use of the stl when appropriate. I also added several algorithms including a Gaussian Mixture Model (GMM) variant, simple frame differencing and some upgrades to the Eigenbackground implementation.

The code is use-able but still a WIP, I’d like to try and add serialization so that the background models and be saved and loaded nicely.

check out the project page: libBGS

read more


Finally got a chance to blog about the most recent architectural improvements to ARPool - Singletons! Singletons make so much sense for ARPool it’s insane, I can’t believe we didn’t have it like this before.

Backing up for those who aren’t familiar with what I’m talking about, a singleton is an object for which we enforce the constraint that there will only ever be a single instance of that object. How do we do this? easy make the constructor private, err okay but then how do we instantiate the singleton in the first place? This one isn’t hard but I wouldn’t say easy, we make a public method called getInstance which returns a pointer to the single instance of the class if it has already been initialized or creates it if it has not. The class also has 2 static variables to hold the single instance and a flag indicating whether it has been instantiated yet. The code looks like this:

// header
class Singleton

  static bool instanceFlag;
  static Singleton* single;

  Singleton* getInstance();

  // the rest of the methods...


// cpp file
bool Singleton::instanceFlag = false;
Singleton* Singleton::single = NULL;

Singleton* Singleton::getInstance()
    single = new Singleton();
    instanceFlag = true;
    return single;
    return single;

So why would we want to do this? when is this useful? The best example is whenever you are dealing with hardware or an actual physical element. For example in ARPool there is only one camera so it makes sense to make the camera class a singleton.

The major advantage of using singletons is that you can include the class where ever you like and simply ask for the instance - this can greatly simplify your code because you no longer have to pass all of these objects to each other to access them. A really basic way to think about Singletons is to treat them as safe global objects.

and thats really all there is to it! I’m just going to sit here and smile thinking about how much cleaner ARPool’s code is now mmmmmmmmmmmmm!

read more

New ARPool Website is Live!

In prep for our big show of ARPool at the Augmented World Expo 2013 (AWE) in Santa Clara California I got the okay to re-do the website a bit. Now I’m a far-cry from a front-end engineer (just have never had enough time to learn!) but I am pretty stoked with what I put together in a couple of hours.

Thanks to these great weekly events called Queen’s Hacks where a bunch of us get together and work on cool side projects I’d been exposed to Twitter Bootstrap, which is essentially the quintessential css and js library for building a modern website / web app. Big shout out to Twitter for this awesome tool and an even bigger shout out for making it open source! Go Twitter!

Anyways I am pretty hack and slash when it comes to css and js so I don’t have anything neat to report other than to say hey check out this flashy new site I made!

read more