The use of Camera based Electronic Portal Image Devices (EPIDs) for online patient positioning is limited by their performance characteristics including image quality, mechanic stability and both geometric and intensity distortion. Geometric distortion of the EPID images arises in the imaging chain from lens or mirror distortions or from misalignment of the mirror. Correcting this geometric distortion requires mapping the EPID images into flat Cartesian space. In this work, we describe a simple method to measure this image distortion and to develop the appropriate image‐to‐physical space transforms using the properties of the MLC. An well characterized geometric pattern is created in the image plane by the superposition of two images. The individual images are created having every second MLC leaf pair fully closed while the adjacent pair is fully open. A second image is produced using exactly the same leaf configuration, but with the collimator rotated 90 degrees. The composite image is the sum of the two images and produces a well‐defined geometric pattern. A threshold function is applied to the composite image to produce a binary grid and the centroid of each dark/light square was determined. An affine transformation matrix is then generated to map the image of grid back to the virtual grid (physical space), thus correcting the spatial distortion. The mapping function was tested at various gantry angles and demonstrated to be robust.