Considering actual industrial production, precise positioning for irregularly shaped workpiece is required. If the workpiece is located by the method of machine vision, the critical step is to get the position of workpiece contour in image. However the edge information quality in image can be affected by workpiece shape, material, lighting method and other factors. Especially for the complex edge information, the traditional edge detection algorithm is usually hard to eliminate the noise points near the true edge, these noise points will be misjudged as true edge points, which will reduce the accuracy of the contour positioning results. In this paper, a precise contour positioning method for workpiece with irregular shape was proposed. Firstly, based on the initial results of template matching, edge detection region with variable size according to the edge normal direction was created, then a set of edge points can be obtained. Secondly, according to the correlation between true edge points, the position deviation of each point was calculated, and the edge point evaluation function was defined by combining gradient amplitude and position deviation. Finally, removing the points with lower defined scores to obtain final set of edge points, which determines the position of workpiece contour in image. The experiments show that this method can effectively exclude noise points in edge point set, obtain the true contour of workpiece with any shape, and overcome the shortcomings that the traditional edge detection algorithm is greatly influenced by edge noise. The method has high accuracy, stability and strong practicality.