A New Automatic Algorithm for Three-dimensional Edge Detection