First of all, Tesseract OCR technology is used to automatically identify English words on the picture, including English words in the horizontal direction, vertical direction and a certain tilt Angle direction on the picture. Then, the automatic translation system is used to translate English words into Chinese words. Finally, OpenCV technology is used to automatically fill the translated Chinese words into the corresponding position in the English of the original picture, replace the original English words, and realize the automatic recognition and translation of foreign words in the picture. This research greatly improves the efficiency of machine translation. The research content of the project can also be applied to the automatic translation of images between any other languages.