Optical Character Recognition (OCR) plays a pivotal role in enhancing the operational efficiency of container ports. However, challenges such as angle limitations and the complexity of container fonts in traditional OCR systems lead to tilted text and text adhesion, thereby reducing the recognition rate. Recognizing containers at a high speed is equally crucial for port operations. In this study, we address these challenges by introducing an Enhanced OCR (EOCR) system, incorporating Line Segmentation Mask (LSM)-based detection and Scanline-based recognition. LSM tackles the issue of text adhesion caused by traditional segmentation, while recognition based on scan lines accelerates efficiency. Additionally, we propose the arbitrary angle quadrilateral fitting algorithm targeting sloping quad areas in images taken at a container terminal. Experimental results on a dataset of container images from the Shanghai Port demonstrate superior performance compared to existing algorithms, achieving a recognition accuracy rate of up to 98.7%. Furthermore, an ablation study confirms that our EOCR significantly enhances recognition accuracy while ensuring real-time performance.