Silhouette extraction algorithm



As shown in the video above I have been working on an algorithm to extract a person's silhouette for an arts installation I am working on. The main idea is to use the depth map provided by Microsoft's Kinect so only a small range of distances are used to identify the person standing on a certain spot marked on the floor. By discarding those pixels that are too far away and those too close what is left is the person or other obstacles placed a that desired distance from the camera.

It is a bit tricky to make depth and RGB cameras to match exactly the same image (as they are located a few inches apart) so video shows some discrepancy between the dancing user and the drawn contour line.

Code was written in Processing using Daniel Shiffman's kinect library for Macs, OpenCV library and MovieMaker library to create an output video file of the action. In the mean time I was developing this, Daniel updated his library and some changes were needed. Unfortunately, OpenCV for Processing only includes some functions and simplifyDP was missing, so I was forced to implement my own version of Douglas-Peucker polyline simplification algorithm.

Comments

Popular posts from this blog

VFD control with Arduino using RS485 link

How to get sinusoidal s-curve for a stepper motor

Importing OpenSCAD designs into Onshape