Foreground detection algorithms are commonly employed as an initial module in video processing pipelines for automated surveillance. The resulting masks produced by these algorithms are usually postprocessed in order to improve their quality. In this work, a postprocessing filter based on the Pearson correlation among the pixels in a neighborhood of the pixel at hand is proposed. The flow of information among pixels is controlled by the correlation that exists among them. This way, the filtering performance is enhanced with respect to some state of the art proposals, as demonstrated with a selection of benchmark videos.