- Cleaned up and optimized image segmentation function for MATLAB code
  Performance tested on personal computer, saw reduction from ~2.7
  to ~1.8 second average time for segmentation