Added function documentation for segmentation.m