A linear filter is applied to omit pixels within certain range. Then morphological operation is
performed in order to reduce the noise and unnecessary pixels and thus acquire a uniform valued set
of pixels which is necessary for proper labeling of the image.