Monday, 7 November 2011

Getting thresholding right

Eric Saund told me ages ago that good thresholding is the key to working with captured sketch images. So today has been spent putting together a (hopefully) moderately competent adaptive thresholding algorithm for background removal. The basic approach is inspired by the technique that Pierre Wellner created for the Digital Desk, and that has been used for years in the Rainbow Group and elsewhere since then. However, I've added some enhancements based on the histogram method that Alistair Stead used in his adaptive blob detector last year.

Here's a lovely image, created from a bunch of images that I happened to have lying around my desktop as I was testing auto-detection and alpha blending of white and black backgrounds.

On the purely mechanical side, a couple of hours wasted trying to get access to the built-in MacBook camera from Java so that I could wave arbitrary bits of paper in front of the screen. Unfortunately, this seems to get you implicated in some kind of religious war between Quicktime and Java Media Framework, such that nobody wants to tell you how to do it.

No comments:

Post a Comment