Production of integrated circuits necessitates measurement of critical dimensions to guarantee yield and quality. Employment of electron-beam techniques for this metrology purpose is required by the shrinking of device feature size. This document explains and demonstrates a metrological scanning electron microscope (SEM) image edge detection algorithm. It is the essential part of the metrological SEM software to realize the measurement of line width combined with the position information of each pixel. The procedure of the algorithm proposed in the paper is that SEM image is first analyzed by noise type according to the histogram characteristics. Image noise is reduced by specific filters. Then a specific interesting object image region is selected and pixel gray level values of the region are obtained by lines can. SEM image edges are determined by the characteristic of the pixel information in two possible cases. This algorithm preserves the edge details of the original image and detects the image edge automatically in an easy and fast way.