This paper proposes several adjustments to the ISO 12233 slanted edge algorithm for estimating camera MTF. First, the Ridler-Calvard binary image segmentation method is used to find the line. Secondly, total least squares, rather than ordinary least squares, is used to compute the line parameters. Finally, the pixel values are projected in the reverse direction from the 1D array to the 2D image, rather than from the 2D image to the 1D array. Together, these changes yield an algorithm that exhibits significantly less variation than existing techniques when applied to real images. In particular, the proposed algorithm is largely invariant to the rotation angle of the edge as well as to the size of the image crop.
Stan Birchfield, "Reverse-Projection Method for Measuring Camera MTF" in Proc. IS&T Int’l. Symp. on Electronic Imaging: Image Quality and System Performance XIV, 2017, pp 105 - 112, https://doi.org/10.2352/ISSN.2470-1173.2017.12.IQSP-254