added feature for segmenting image