A project of using machine vision to detect the quality of coil winding was introduced based on current application of machine vision in size measurement to solve the difficulty of measuring product size on production line. A simplified pinhole model was applied to calibrate camera. Improvement method to correct measurement error was put forward to solve the nonuniformity problem of CCD imaging unit. The feasibility of the method was verified. The purpose was to provide reference for size measurement by machine vision.