Abstract:In order to detect wire diameter of spring quickly and densely,a middle section wire diameter measurement method of compression spring based on machine vision was proposed.The overall structure of the measurement algorithm was introduced.After obtaining key inflection points of the spring edge,each section of spring was separated,the edges of middle part closed to straight lines were reserved and the least square straight line fitting was carried out; the detection baselines were generated according to the fitted straight lines and the key inflection points,the detection line segments were generated according to preset detection density,and the wire diameter of each detection point was measured.In the precision measurement experiment,the maximum relative error was 2.84%.In the running speed comparison experiment under different detection densities,the average running time of the algorithm was 120.4~130.3 ms,when the difference of detection density was 16 times,the difference of detection speed was 7.60%.After batch verification,it is verified that the method is fast and reliable,and wire diameter measurement of dozens to more than one thousand measuring points in the middle of spring can be completed in one running within 200 ms.