Abstract:As one of the important components in the antenna, the ceramic antenna PIN needle, its size deviation will directly affect the product quality of the antenna. In order to realize the fast and precise online detection of PIN needles, an online detection device for PIN needles was designed and developed, and a PIN needle size detection method based on an improved sub-pixel algorithm was proposed. First, start to collect images and perform pixel equivalent calibration, perform distortion correction on the image, obtain ROI area, and image preprocessing, then use the sub-pixel edge detection algorithm based on the improved Sobel operator and Gaussian peak position estimation to extract edge points, and use the least squares method, then the edge points are fitted into a pair of parallel straight lines, and the pixel width between the lines is calculated, and the diameter of the measured PIN needle at the ROI area is obtained by converting the pixel equivalent. The experimental results show that the average relative error of this method is less than 0. 25%. While ensuring ±0. 005 mm detection accuracy, its average time is reduced by 64. 32% compared to traditional sub-pixel detection algorithms based on Gaussian fitting.