In industry, there are needs to accurately measure the 3-D profile of edges parts in order to evaluate edge condition. Optical methods are increasingly used for this purpose due to its advantages such as being noncontact, fast, accurate, and easy to integrate with software for data acquisition and feature analysis. We utilized structured line projection technology to measure edge's profile. In this method a structured light distribution, created by the transmission of a sinusoidal grating, was projected onto the inspected parts at a certain incidence angle. The projected light lines were deformed due to the depth change on the edge surface. A CCD camera sitting at a different angle was used to record the deformed fringes. From the deformed fringes the 3D surface profile was extracted based on triangulation principal. Because the projected grating pattern can be interpreted as an interference pattern, we used the spatial carrier phase shifting and phase unwrapping method as in classic interferometry to extract the phase information from the intensity distribution of fringes. Due to the limited depth-of-range of the fringe image and depth-offocus of the imaging lens on the CCD camera, the observed deformed fringes have different widths and frequencies at different depth. According to the definition of depth-of-focus, the fringe width out of focus can be on the order of the square root of 2 wider than that which is in focus. The width change can also be due to a tilt across the object. This width change affects the accuracy of the spatial carrier phase shifting and subsequently the accuracy of extracted profile. In this paper, we proposed to monitor the change of the fringe width with imaging depth. According to the width of the fringes, we defined a parameter called compressing rate, to use in computing the edge profile. For different edge types, the compressing rate was optimized in order to get the profile that can match the results from traditional the methods. By using this method, the system repeatability can be improved significantly.