added closing operation, medianfilter and meanshift segmentation