Precise mechanical operation of a linear accelerator (linac) is critical for accurate radiation therapy dose delivery. Quantitative procedures for linac mechanical quality assurance (QA) used in the standard of care are time consuming and therefore conducted on a relatively infrequent basis. We present a method for evaluating the mechanical performance of a linac based on a series of projection portal images of a prototype cylindrical phantom with embedded radiopaque fiducial markers. The marker autodetection process included modeling imager response to the radiation beam where the projected cylinder attenuation yielded a non-uniform image background. The linac mechanical characteristics were estimated based on nonlinear multi-objective optimization of the projected marker locations. The estimated geometry parameters for the tested commercial model were gantry angle deviation 0.075 ± 0.076°(1 SD), gantry sag 0.026 ± 0.02°, source-to-axis distance SAD 998.3 ± 1.7 mm, source-to-detector distance SDD 1493 ± 5.0 mm, couch vertical motion 0.6 ± 0.45 mm, couch rotation 0.154 ± 0.1°and average linac rotation center (1.02, -0.27, -0.37) ± (0.36,0.333,1.20) mm relative to the laser intersection. The imager shift was [-0.44, 2.6] ± [0.20, 1.1] mm and the imager orientation was in-plane rotation 0.05 ± 0.03°, roll -0.14 ± 0.09°and pitch -0.9 ± 0.604°. The performance of this procedure concerning marker detection and optimization was examined by comparing the detected set of marker coordinates to its back-calculated counterpart for three subgroups of markers: central, wall and intermediate relative to the center of the phantom. The maximum difference was less than 0.25 mm with a mean of 0.146 mm and a standard deviation of 0.07 mm. The clinical use of this automated procedure will allow more efficient, more thorough, and more frequent mechanical linac QA.