Visual guidance is widely used in industrial robots. At present, the traditional method of template matching and positioning is often used in industrial robots under monocular vision guidance. However, for complex workpieces with height differences, if the angle and position of the workpiece are not consistent with the template, the projection will be different, and the positioning accuracy will be obviously reduced. A new method is proposed to solve this problem by dividing the whole contour of the workpiece and using the weighted method of the contour module to correct and match the workpiece image. First, the contour region of the template image is divided according to the position of the grasping points. Then the weight is assigned according to the distance from each contour region to the grasping points. Then, a fast feature point matching method is used to match the initial image of the workpiece to be measured. Finally, accurate contour matching is carried out for each weighted contour region so that the robot can grasp the object accurately. A large number of experiments show that the method has the design requirements of high stability and high accuracy.