Deep hole measurement is a crucial step in both deep hole machining and deep hole maintenance. Single-camera vision presents promising prospects in deep hole measurement due to its simple structure and low-cost advantages. However, the measurement error caused by the heating of the imaging sensor makes it difficult to achieve the ideal measurement accuracy. To compensate for measurement errors induced by imaging sensor heating, this study proposes an error compensation method for laser and vision-based deep hole measurement instruments. This method predicts the pixel displacement of the entire field of view using the pixel displacement of fixed targets within the camera's field of view and compensates for measurement errors through a perspective transformation. Theoretical analysis indicates that the perspective projection matrix changes due to the heating of the imaging sensor, which causes the thermally induced measurement error of the camera. By analyzing the displacement of the fixed target point, it is possible to monitor changes in the perspective projection matrix and thus compensate for camera measurement errors. In compensation experiments, using target displacement effectively predicts pixel drift in the pixel coordinate system. After compensation, the pixel error was suppressed from 1.99 pixels to 0.393 pixels. Repetitive measurement tests of the deep hole measurement instrument validate the practicality and reliability of compensating for thermal-induced errors using perspective transformation.