The invention discloses a method for positioning bottle bodies on a production line based on machine vision. The method comprises the following steps of: 1, acquiring images of the bottle bodies and preprocessing the images; 2, extracting edge point sets outside a plurality of groups of bottle bodies, namely scanning the preprocessed images along a longitudinal linear trace and a fixed-point circular trace twice, and effectively eliminating error points by a minimum deviation absolute value sum method; 3, integrating the edge point sets, performing least square method on the integrated edge point set, and then performing linear fitting, thus obtaining an edge characteristic line set; and 4, calculating positioning characteristic angle points of bottle bodies of special bottles according to an intersection relation among elements of the line set, thus obtaining bottle body characteristic information, such as a deflection angle of each bottle body, the height of each bottle, the width of each bottle and the geometric center according to the characteristic angle points. According to the method, the bottle bodies can be automatically identified and quickly and precisely positioned.