This function runs in Matlab for retrieving color after segmentation. This function is commonly needed for color feature extraction and this instance is just very simple code.