Abstract:To address the low efficiency and accuracy of traditional captcha recognition methods, we designed a captcha processing solution that involves segmentation and recognition stages. In the preprocessing stage, we applied median filtering for noise reduction and used the Hough transform to correct the image characters. In the character segmentation stage, we used the vertical projection algorithm to determine the number of character blocks and their coordinates, and then used the color filling algorithm for preliminary segmentation. We also performed a second segmentation for connected characters based on the number of segmented character blocks. In the recognition stage, we improved the LeNet-5 network by modifying the input layer and replacing the C5 layer with a fully connected layer for character recognition. Experimental results showed that for non-connected and connected captchas, the segmentation time for a single image was 0.14ms and 0.15ms, respectively, with segmentation accuracies of 98.75% and 97.25% and recognition accuracies of 99.99% and 97.7%. These results demonstrate that our algorithm has good performance for captcha segmentation and recognition.