Code for performing simple color segmentation.