Initial code commit.

This code works in MATLAB 20011b with the image processing toolbox.