rndmcnlly (rndmcnlly) wrote,
rndmcnlly
rndmcnlly

Selective Emphasis


Selective Emphasis
Originally uploaded by rndmcnlly
These two images are screenshots from a program I just wrote in Processing. The were taken just a few seconds apart under the same lighting conditions. The dramatic change in perceived lighting is due to a selective emphasis that has been applied automatically, in live, real-time, to images coming from the webcam on top of a modern iMac.

A region of interest is selected by the user by either moving object or the camera to place the interesting region in the center of the image. Given a rudimentary guess of a foreground-background segmentation using a circular lump about the center of the screen, the algorithm begins to repeatedly build a model of color likelihood given a segmentation label (a value between 0 and 255) then relabel each pixel with its most likely label. At the end of each pass the label image is smoothed with a small Gaussian kernel. Passes are synchronized with grabbing of new frames from the camera so, in this way, the label image from the previous frame becomes the prior labels for the next frame, exploiting temporal coherence.

The combined sharing of information across space and time allows the algorithm to track moving regions of interest even under drastic appearance changes. This comes with a trade-off for the region of interest shifting undesirably in some occasions. Though it is uncommon, it is quite possible for the region of interest to become disconnected. In the right image, several distinct blobs are visible on the door.

To create visual emphasis, the areas outside of the region of interest are darkened and blurred slightly.

Source and binary (128k, requires quicktime for camera access): http://adamsmith.as/typ0/sketch_070813a-001.zip
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

  • 1 comment