Not to come off as totally pedantic, but measuring the MTF is really hard and time-consuming because it's a complex-valued quantity. What you actually want to measure isn't even the the modulus of the MTF (the optical transfer function), but the "contrast transfer function" (CTF) because you have a sampled imaging system and not a continuous detector like film.
Measuring the CTF is fairly straightforward- print out a set of black-and-white bars, with the separation distance equal to 2x the bar width (so the black and white sections have equal width). Do this for a range of "line pair" spacings. At some point, you will need to convert the actual line pair spacing (say, 0.5 lp/mm) to line pairs/pixel, but that conversion will depend on your setup.
Then, simply image the target- the (normalized) contrast of your image as a function of line pair spacing is equal to the CTF. You can do this over the image area to compare the optical performance near the optical axis to the optical performance at the edge of the frame, determine the effect of stopping down the aperture, determine aberrations like astigmatism (by rotating the bars 90 degrees), etc. etc.
There's a clever alternative method you can use with a single image, taking advantage of the relations between the transfer function and point spread function, edge spread function, and line spread function- simply image an abrupt black-white transition and perform an FFT on the image pixel data normal to the transition. The FFT of that data is the CTF.
For hard-core details that covers sampled imaging systems including aberrations like aliasing, I recommend Vollmerhausen and Driggers "Analysis of Sampled Imaging Systems" (SPIE press).
Does that help?