Preprocessing for Edge Detection