In this digital information era, utilization of images are essential for various media, and the edge is an important characteristical information of an object in images that includes the size, location, direction and etc. Many domestic and international studies are being conducted in order to detect these edge. Existing edge detection methods include Sobel, Prewitt, Roberts, Laplacian, LoG and etc. which apply fixed weight value. As these existing edge detection methods apply fixed weight mask to the image, edge detection characteristic appears slightly insufficient. Accordingly, in order to supplement these problems, this study used bottom-hat transformation from mathematical morphology and opening operation in improving the image and proposed an algorithm that detects for the edge after calculating mask-based gradient. And to evaluate the performance of the proposed algorithm, a comparison was made against the existing Sobel, Roberts, Prewitt, Laplacian, LoG edge detection methods, in illustrating visual images, and similarities were compared by calculating the MSE value based on the standard of each image.