Pheromones, path selection, and probability transfer functions are the main factors that affect the performance of computer text recognition. The path selection function is the most important factor affecting the recognition rate. In response to the difficulties in path selection and slow algorithm convergence in the text recognition, an edge detection algorithm based on improved ant colony optimization algorithm is proposed. The strong denoising performance of the ant colony optimization algorithm reduces the interference of textured backgrounds. The edge extraction effect is analyzed in the connected domain to overcome complex effects. Finally, the improved Otsu binarization algorithm is used to recognize the text. According to the results, the proposed method could effectively preserve the edge information of characters in images. The positioning effect of the text area was good. The accuracy rate reached around 85%. The tuned threshold improved the binarization effect. The text recognition rate of the improved ant colony algorithm proposed in the research has generally reached 80%, with good text positioning accuracy and recognition rate, which has great practical significance in computer text recognition.