In most integral image analysis and processing tasks, accurate knowledge of the internal image structure is required. In this paper we present a robust framework for the accurate rectification of perspectively distorted integral images based on multiple line segment detection. The use of multiple line segments increases the overall fault tolerance of our framework providing strong statistical support for the rectification process. The proposed framework is used for the automatic rectification, metric correction, and rotation of distorted integral images. The performance of our framework is assessed over a number of integral images with varying scene complexity and noise levels.