Decoding Video With JavaScript

3 Comments | May 05, 2010
With all the hoopla surrounding which web browsers will support HTML5 video (and which codecs they will support), a buddy of mine mused about decoding video in JavaScript. I mean with a canvas tag, people have been able to produce some amazing things. And these browser JavaScript engines just keep getting faster and faster. So why don't we just go ahead and make a JavaScript video decoder? Yep, let's do it.

Microsoft Research presents...Infer.NET

3 Comments | Jan 21, 2009
Happened to be cruising the Microsoft Research projects page...looking for something cool to mess with. Lo and behold, I came across Infer.NET. I could tell you what it's about...but it's better to get it straight from the horse's mouth (so to speak).

PDC 2008...Here I Come

Add Comment | Jul 02, 2008
Just finished registering for PDC this year. It'll be my first time attending. I'm extremely excited (like a kid in a candy store). Now only if I could think of a good idea for the "ShowOff"...I'd be set. Everything I can think of is just a mash-up of stuff that's already been done. *Sigh*...oh well.

Face Detection in (pure) C#

4 Comments | May 03, 2008
Have you ever heard of the Open Source Computer Vision Library (OpenCV)? Well if you haven't, you might want to head over to the project's Wiki page or Intel's project page. In short, OpenCV is an cross platform open source library (written in C++) that provides a great deal aid for developing computer vision applications. OpenCV can be used for biometrics, security, human-computer interfacing, etc. The brilliant people behind OpenCV have given us the ability to quickly implement such advanced techniques as Face Detection and Fast Object Tracking.
   About a week ago, a friend of mine told me a he was interested in implementing some basic face/feature detection features in a web-based surveillance system (well...a viewer at least). Now, after some research, you can quickly come across some .Net wrappers such as OpenCVDotNet, but what he needed had to be either Java or 100% C# (so he could convert it  to Java...haha) so that the functionality was as (easily) portable as possible. I chose to write a quick proof-of-concept in C# (at least for the face detection piece). So I did my best to quickly port the face detection functionality from OpenCV. OpenCV is great, but there are some knocks against its face detection...the most prominent ones being that it doesn't take lighting into account enough (it won't find faces in some images that other libraries will and it will report false negatives sometimes) and the fact that it may actually violate a patent.
    Below you will find what my code as a library project, and a sample project that uses the Yale Face Database. Keep in mind that the code below is just a proof-of-concept and that it can definitely be optimized. I've also skipped doing image histogram equalization which might find more faces in certain images. OpenCV also uses a k-nearest neighbor algorithm which i didn't really bother to port...I just used Euclidean distance (I'm not sure if that is what OpenCV was already using)...which should work most of the time. In my testing with the Yale Face Database, faces can be detected in ~1.4 seconds on a 300x300 image. That's nowhere near realtime detection, but that's mostly due (I think) to the bounds checking in .NET arrays and lists. Quick profiling show that for a 300x300 image, there are about 52 million array accesses in that ~1.4 seconds which ain't too bad for C#. So here are some with 'em.

Face Detection Library
Face Detection Sample Application

Office Fun: Key Flipper

Add Comment | Feb 18, 2008
I read in my bathroom reader that the top three "problem" employees according to the Wall Street Journal are: "The Non-Stop Talker"  "The Screamer" and the "The Practical Joker." I guess that makes me a problem employee then. I don't scream as much I as used to, but I do play practical jokes when appropriate (hehe). Recently we had one of our programmers give his two weeks notice, and because he's a good natured guy (and he's quitting) -- I thought it would be appropriate to give him hell this week. Seeing as I'm a developer, my pranks tend to leverage my aptitude/proclivity for system intrusion and wreaking random havoc. So today (Monday) I decided that I would make a program that hooks his keyboard input and types a predefined, yet configurable, amount of text -- no matter what keys he presses (ex. type "0123456789" and the output is "I love ham"). Hence -- the KeyFlipper program which leverages the KeyboardHooker library. The KeyboardHooker library exposes a KeyboardListener class that can be used to log keystrokes or stop them. The library also exposes the KeyInterceptor class which does all the "real" work required to torture said co-worker(s). This program also goes in the largely useless bin...but seeing the look of joy on his precious little face more than makes up for it. Tomorrow (Tuesday) will feature something similar involving hooking the mouse. Ahhh....I can't wait until tomorrow.

KeyFlipper (requires KeyboardHooker)

Convert Web Pages to PDF

Add Comment | Jan 22, 2008
I did something that's probably unnecessary. I converted dynamic web pages into static PDFs.

New Host...New Year...New Stuff

Add Comment | Jan 20, 2008
Another year has come and gone...I wonder what's gonna happen in 2008.