The industrial adoption of material extrusion of polymers (MEX/P) is hindered by the geometric quality of manufactured parts. Contact image sensors (CISs), commonly used in flatbed scanners, have been proposed as a suitable technology for layer-wise characterization of contour deviations, paving the way for the application of corrective measures. Nevertheless, despite the high resolution of CIS digital images, the accurate characterization of layer contours in MEX/P is affected by contrast patterns between the layer and the background. Conventional edge-recognition algorithms struggle to comprehensively characterize layer contours, thereby diminishing the reliability of deviation measurements. In this work, we introduce a novel approach to precisely locate contour points in the context of MEX/P based on evaluating the similarity between the grayscale pattern near a particular tentative contour point and a previously defined gradient reference pattern. Initially, contrast patterns corresponding to various contour orientations and layer-to-background distances are captured. Subsequently, contour points are identified and located in the images, with coordinate measuring machine (CMM) verification serving as a ground truth. This information is then utilized by an adaptive edge-detection algorithm (AEDA) designed to identify boundaries in manufactured layers. The proposed method has been evaluated on test targets produced through MEX/P. The results indicate that the average deviation of point position compared to that achievable with a CMM in a metrology laboratory ranges from 8.02 µm to 13.11 µm within the experimental limits. This is a substantial improvement in the reliability of contour reconstruction when compared to previous research, and it could be crucial for implementing routines for the automated detection and correction of geometric deviations in AM parts.