MTF Mapper target help needed

This area is for the discussion of what's new, what's on your mind, and general photographic topics. A place to meet, make comments on this site, and get the latest community news.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

bbobby
Posts: 64
Joined: Sat Jan 15, 2022 12:40 pm
Location: Indianapolis, IN

MTF Mapper target help needed

Post by bbobby »

I am not good with numbers, but always enjoy to see something clearly like 200 is bigger/better than 100 ;-)
Anyway, when I am sometimes running an image to get some numbers thru MTF Mapper (version 0.7.30) I am getting inconsistent results...
So I decided today to make an image file with photoshop - no optics, no aberrations, right... and I think I will order at the end a custom target so better to try some stuff before spending $$$...
mtfmapper02.jpg
mtfmapper01.jpg
Well, I made a black squares (RGB: 0 0 0), then rotated them +/- 5 degrees. All good, values were consistent in the center and in the corner of the frame.
I can use most of the inside portion for additional element like USAF1951 which is great!

Then I made 2 more gray squares this time with RGB values 59 59 59 and 119 119 119. MTF50 is going down as these squares are getting away from the pure black. Now here is my 1st question:
When I consider that the background is pure white (RGB: 255 255 255) and square is pure black (RGB: 0 0 0) contrast is "perfect" and I assume the MTF will be highest. Then contrast drop and MTF drops too. Logical.
But then when I use gray background (RGB 185 185 185) 1 of they gray squares is not even "mapped" (and I changed the MTF50 to MTF90 and MTF10) and the other drops the MTF just so slightly - 215 to 207. MTF50 values for the black squares are the same although the background is different... Why is that?
mtfmappercenter.jpg
mtfmappercenter02.jpg
My second question is about the angles - in the corner although both sides of the square are at 40 degrees the MTF50 value is different (257 - 187) and I cannot explain it myself why... at 10 and 15 degrees the values are about the same and consistent with 5 degree square.
mtfmappercorner.jpg
mtfmappercorner02.jpg
Any help will be greatly appreciated!

rjlittlefield
Site Admin
Posts: 23561
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Re: MTF Mapper target help needed

Post by rjlittlefield »

Thanks for prompting me to study MTF Mapper. I'm pretty new to that software, but here's what I think is going on.

To quickly summarize what it's important to know...

MTF stands for Modulation Transfer Function, which is a mathematical relationship that measures the ratio between input contrast and output contrast. A single value on the MTF curve says what fraction of contrast is retained, for the size of detail (spatial frequency) at which the contrasts were measured. In particular MTF50 tells you the size of detail for which 50% of the contrast will be retained.

The MTF Mapper software tries to compute MTF given an image file that meets certain assumptions. In particular, it assumes that the image file it's working with represents an optical image that was blurred without regard to pixel alignment, followed by sampling on a pixel grid, and recorded using a transfer function that the software knows how to invert (go from pixel value to relative amount of light). Given such an image file, it finds long straight edges, and then it uses the assumptions to figure out what is the overall system MTF in the direction orthogonal to each edge.

Image files that deviate from the assumptions can give strange results.

bbobby wrote:
Fri Mar 24, 2023 4:16 pm
MTF50 is going down as these squares are getting away from the pure black. Now here is my 1st question:
When I consider that the background is pure white (RGB: 255 255 255) and square is pure black (RGB: 0 0 0) contrast is "perfect" and I assume the MTF will be highest. Then contrast drop and MTF drops too. Logical.
That may seem logical, but it's not correct. MTF is based on the ratio between input contrast and output contrast. In a perfect world -- meaning that the calculation recovers the actual MTF -- you could use any bright and dark pixel values you like and the MTF would not change at all.

The fact that changing pixel values does change the calculated MTF mainly indicates that the image file deviates from the assumptions that the software relies on. When generating image files from scratch, it's very easy to make them deviate a lot. Even the pdf files that are provided with MTF Mapper generate strange results if their images are fed directly into the software, rather than being printed and photographed.
My second question is about the angles - in the corner although both sides of the square are at 40 degrees the MTF50 value is different (257 - 187) and I cannot explain it myself why... at 10 and 15 degrees the values are about the same and consistent with 5 degree square.
I expect this problem is due to using synthetic images that do not meet the assumptions of the software.

If you want to work with synthetic images, then I strongly recommend to add a slight blur, the better to simulate what a real camera would do.

As an illustration of what I've written above, here are two displays generated by MTF Mapper. The first is when I feed it a jpg saved directly from the lensgrid_a0.pdf file that is provided with the software. The second is when I add a Gaussian blur with radius of just 0.5 pixels. Note that without the added blur, MTF Mapper computes MTF50 values that range from 166.3 to 142.0 in this region, where with the slight added blur, it gets only a range of 62.1 to 61.6. That's a variability of 17.1% for the original file, versus only 0.81% with the slight added blur.
2023-03-25_17-30-31.png
2023-03-25_17-31-00.png

When using MTF Mapper with your real camera, best practice is to shoot raw and expose to avoid clipping at either end.

I hope this helps!

--Rik

enricosavazzi
Posts: 1474
Joined: Sat Nov 21, 2009 2:41 pm
Location: Västerås, Sweden
Contact:

Re: MTF Mapper target help needed

Post by enricosavazzi »

I am also rather new to making my own MTF tests, so my understanding of MTF software and their results may be wrong in some respects.

I don't get paid to do lens tests. They are only for my information. So there are relatively strict limits to what I am willing to pay for test equipment and software.

My perspective is that I use MTF tests to complement my visually evaluated tests with standard targets (USAF 1951 and more recently NBS 1963A). I only do tests in photomacrography (and will probably do tests in photomicrography), so I only use relatively small chrome-on-glass resolution targets. I also use "accidental" resolution targets like silicon wafers, microscope test rulers, and photomasks used for semiconductor manufacturing, but the problem with these is that it is difficult or impossible to compare my results with tests made by others with different targets.

I am forced to use only MTF when, because of high magnification and high image resolution, my test targets don't have fine enough patterns. There are test targets with finer patterns, but I draw the line when the test target costs as much as, or more than, the lens I want to test. So, instead of buying a standard test target manufactured with electron-beam lithography, I just use one of the straight edges of my standard or accidental targets (photomasks work fine, often better than some standard targets) as an MTF target.

I did look at MTFmapper but decided not to use it because:
1- it requires somewhat special targets
2- I have no way to make or purchase suitable targets for this software for tests at high magnification.
It would otherwise be neat to leave most of the work to the software as MTFmapper does. There is commercial software that can use standard targets, but also in this case, I draw the line when the software costs as much as the lens I want to test.

So far I used mostly ImageJ by the NIH with the SE_MTF plugin by Carles Mitjà et al. It is also recommended by at least one of the makers/sellers of standard targets, I forgot which one. You have to do more manual/repetitive work than with MTFmapper, especially that you must manually enter the sensor specifications (it should be possible to hard-code them in the source code if one always uses the same test camera) and manually select the rectangular ROI (Region Of Interest) which the plugin uses to compute MTF.

I have read somewhere that the Image Processing Toolkit of Matlab can do MTF tests, but have not looked into it yet. There is some free MTF code for Matlab, but I would rather use something of better quality. I have access to a Matlab system with most toolboxes, so the cost factor is not important for me in this case. There is a free alternative to Matlab (Octave) but its toolboxes and code libraries are of very varying quality, from good to useless.

Some of the work with MTF and resolution targets I have done so far:
https://savazzi.net/photography/micro-four-thirds.html
https://savazzi.net/photography/resolution-targets.html
https://savazzi.net/photography/1951usaf.html
https://savazzi.net/photography/nbs-1963a-target.html
--ES

bbobby
Posts: 64
Joined: Sat Jan 15, 2022 12:40 pm
Location: Indianapolis, IN

Re: MTF Mapper target help needed

Post by bbobby »

rjlittlefield wrote:
Sat Mar 25, 2023 6:07 pm
... add a Gaussian blur with radius of just 0.5 pixels... If you want to work with synthetic images, then I strongly recommend to add a slight blur, the better to simulate what a real camera would do.
Thank you, this did work and the results now are more or less consistent. I remember I read somewhere long time ago to avoid 0°, 45° and 90° when making files.
Maybe you can help a bit more...
The author of the program wrote:
... MTF Mapper’s output is split into meridional and sagittal plots ... The sagittal MTF50 values are derived from edges that are oriented along radial lines (with respect to the centre of the image), and the meridional MTF50 values come from the other edges, that are oriented to be tangential to a circle centred at on the image...
mer-sag.png
When I check the angles of most trapezoids I do not see that. The 7 elements in red are the same and I examined in detail the last one. The sagittal edges are 8.71 and 2.17 and meridional edges 3.01 and 3.07. When drawing a lines along these edges they are not passing thru the center of the image and they are not perpendicular either... Any particular reason behind that? Maybe it just does not matter...
matrix angles.png
trapez.png
rjlittlefield wrote:
Sat Mar 25, 2023 6:07 pm
...MTF is based on the ratio between input contrast and output contrast. In a perfect world -- meaning that the calculation recovers the actual MTF -- you could use any bright and dark pixel values you like and the MTF would not change at all... When using MTF Mapper with your real camera, best practice is to shoot raw and expose to avoid clipping at either end.
I did some experiment here, based on the original pdf file... added 0.5 pixels Gaussian blur too ;-)
I see the values are going down from 100% black (84) to 51% (70) black on pure white background. OK.
But then when I am changing the background to be darker from 0% to 40% I was expecting to see more values changes than that... the element which is 51% black is gone at some point, 61% black is going from 71.2 to only 68.5. The element which is 100% black goes from 84 to 83.9, practically no difference. Why? The contrast ratio changes considerably more...
And in practical terms maybe this mean when shooting such target to underexpose a bit so to clip the blacks to some degree?
20-30-40.png
0-0-10.png
20-30-40 annotations.png
0-0-10 annotations.png

bbobby
Posts: 64
Joined: Sat Jan 15, 2022 12:40 pm
Location: Indianapolis, IN

Re: MTF Mapper target help needed

Post by bbobby »

enricosavazzi wrote:
Sun Mar 26, 2023 2:22 am
I am also rather new to making my own MTF tests, so my understanding of MTF software and their results may be wrong in some respects.

I don't get paid to do lens tests. They are only for my information. So there are relatively strict limits to what I am willing to pay for test equipment and software.

My perspective is that I use MTF tests to complement my visually evaluated tests with standard targets (USAF 1951 and more recently NBS 1963A). I only do tests in photomacrography (and will probably do tests in photomicrography), so I only use relatively small chrome-on-glass resolution targets. I also use "accidental" resolution targets like silicon wafers, microscope test rulers, and photomasks used for semiconductor manufacturing, but the problem with these is that it is difficult or impossible to compare my results with tests made by others with different targets.

I am forced to use only MTF when, because of high magnification and high image resolution, my test targets don't have fine enough patterns. There are test targets with finer patterns, but I draw the line when the test target costs as much as, or more than, the lens I want to test. So, instead of buying a standard test target manufactured with electron-beam lithography, I just use one of the straight edges of my standard or accidental targets (photomasks work fine, often better than some standard targets) as an MTF target.

I did look at MTFmapper but decided not to use it because:
1- it requires somewhat special targets
2- I have no way to make or purchase suitable targets for this software for tests at high magnification.
It would otherwise be neat to leave most of the work to the software as MTFmapper does. There is commercial software that can use standard targets, but also in this case, I draw the line when the software costs as much as the lens I want to test.

So far I used mostly ImageJ by the NIH with the SE_MTF plugin by Carles Mitjà et al. It is also recommended by at least one of the makers/sellers of standard targets, I forgot which one. You have to do more manual/repetitive work than with MTFmapper, especially that you must manually enter the sensor specifications (it should be possible to hard-code them in the source code if one always uses the same test camera) and manually select the rectangular ROI (Region Of Interest) which the plugin uses to compute MTF.

I have read somewhere that the Image Processing Toolkit of Matlab can do MTF tests, but have not looked into it yet. There is some free MTF code for Matlab, but I would rather use something of better quality. I have access to a Matlab system with most toolboxes, so the cost factor is not important for me in this case. There is a free alternative to Matlab (Octave) but its toolboxes and code libraries are of very varying quality, from good to useless.

Some of the work with MTF and resolution targets I have done so far:
https://savazzi.net/photography/micro-four-thirds.html
https://savazzi.net/photography/resolution-targets.html
https://savazzi.net/photography/1951usaf.html
https://savazzi.net/photography/nbs-1963a-target.html
Well, I am testing lenses for fun in my spare time. If I decide at some point that I am pretty good at that and if there is a way money to be made - great. And of course when I see a good target to cost $500 and in many cases over $1000 I am not happy. But I can buy one if it combines many features... Thorlabs are making "Customer Inspired!" targets, but they are not what I want. For example:
thorlabs.png
In the last few years I found companies in US which can make a targets for considerably less money - a USAF target which goes to Group 9 Element 6 for about $200 is acceptable. The issue is that it takes too much time testing - because the target is only 1 it must be photographed many times to cover all the image circle.
I want to have (even if I must create it myself) a target which has some standard elements like USAF 1951 pattern, but also a way to get the MTF. I think it is really neat to see testing results in a easily seen table with values from software. According the documentations MTF Mapper can do few things, but I am most interested for now in: "Measure and visualize camera system MTF / SFR curves...and produce plots that are similar to those produced by lens manufacturers... Measure longitudinal chromatic aberration... Checking test chart orientation (built-in “chart orientation” option)."

I will also check ImageJ too.

Thank you for the response!

rjlittlefield
Site Admin
Posts: 23561
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Re: MTF Mapper target help needed

Post by rjlittlefield »

rjlittlefield wrote:
Sat Mar 25, 2023 6:07 pm
...MTF is based on the ratio between input contrast and output contrast. In a perfect world -- meaning that the calculation recovers the actual MTF -- you could use any bright and dark pixel values you like and the MTF would not change at all..
Let me illustrate what I meant by that.

2023-03-28_20-23-13.jpg

To point out the obvious, all the numbers are the same, despite the wide variation in dark and light levels.

The preceding image is NOT fudged. This is a direct screen capture of MTF Mapper showing its analysis of an image that I made from its lensgrid_a0.pdf file. The trick was only that I took care to process the image in ways that are consistent with MTF Mapper's assumptions.

Before continuing the discussion, I think I should stop here to get your thoughts.

This result is clearly quite different from what you've been showing.

Is my screen capture surprising to you? If so, why? If not, then why not?

--Rik

enricosavazzi
Posts: 1474
Joined: Sat Nov 21, 2009 2:41 pm
Location: Västerås, Sweden
Contact:

Re: MTF Mapper target help needed

Post by enricosavazzi »

Also a thing that may not be immediately obvious, is that to combine the MTF of different elements in the imaging chain from subject to image, you multiply their MTF.

Say for example that you have a lens that gives you 80% MTF at a given lp/mm and a camera that gives you 60% MTF at the same lp/mm. To get the total MTF of the system you do 0.8 * 0.6 = 0.48. i.e. 48% MTF. With multiple stages of the system, MTF gets pretty low pretty fast.

This is also related to why I prefer software like the SE_MTF plugin, which gives me an MTF curve between 0 and 1, rather than just a single value like MTF Mapper. The latter is very practical when you only need lots of numerical results quickly. An MTF curve conveys more subtle information, like when I tested the OM System 90 mm macro lens. Compare for example the center and right graphs in Figure 24 at https://www.savazzi.net/photography/omsys90macro.html . The center graph shows the MTF of the lens at 1x with the focus limiter set at 0.25-0.5m or 0.25m-∞ at f/3.5. The graph on the right shows the lens, still at 1x, after switching the focus limiter to S Macro. This changes the nominal lens speed from f/3.5 to f/5 and dramatically bumps up the MTF near the top of the curve (=high MTF), but not so much along the rest of the curve. So the focus limiter in this lens does a lot more than just setting the focus interval, it actually does some optical optimization of lens performance in spite of the slower nominal aperture. This type of information may be lost, or at least not obvious, when one only gets a single numerical value.
--ES

enricosavazzi
Posts: 1474
Joined: Sat Nov 21, 2009 2:41 pm
Location: Västerås, Sweden
Contact:

Re: MTF Mapper target help needed

Post by enricosavazzi »

One thing I wonder about software for computing/measuring MTF is that the calculations are designed for optics, but seem to ignore the discrete pixel structure of sensors. The MTF graphs from all software packages I tried so far (not so many, so perhaps not a representative sample) span the MTF range between 0 and 1 and usually produce a sigmoid curve with a "floor" pretty low, often around an MTF of 0.1-0.2. If the imaging chain contains a sensor with discrete pixels, however, image resolution cannot be higher than the Nyquist limit (the sensor cannot resolve line pairs narrower than 2 pixels - at best, with narrower line pairs it only produces some sort of moiré or interference at a larger scale than the Nyquist limit).

The Nyquist limit is typically located higher up on the curve (sometimes as high as MTF 0.3-0.4). Thus it would seem that the part of the curve below the Nyquist limit should be discarded and replaced with a horizontal line with y at the Nyquist limit. Or perhaps the y scale of the MTF graph should not start at 0 but at the Nyquist limit.

PS - In the meantime I found BS ISO 15529:2010 Optics and photonics — Optical transfer function — Principles of measurement of modulation transfer function (MTF) of sampled imaging systems
The key is "sampled imaging systems", which translates to pixel oriented. It is not directly applicable to our case of test images recorded with cameras, because the test equipment described in the document uses an optical slit moving sideways to scan the pixel matrix in sub-pixel increments, but at least it shows that the MTF-related properties of pixel-oriented sensors/displays have been considered in depth. The ISO document would be quite expensive to purchase, especially for a reader only interested in self-education, but has been leaked on the web and can be found with some searching.
Last edited by enricosavazzi on Wed Mar 29, 2023 7:45 am, edited 2 times in total.
--ES

bbobby
Posts: 64
Joined: Sat Jan 15, 2022 12:40 pm
Location: Indianapolis, IN

Re: MTF Mapper target help needed

Post by bbobby »

rjlittlefield wrote:
Tue Mar 28, 2023 10:16 pm

Is my screen capture surprising to you? If so, why? If not, then why not?

--Rik
Yes, it is surprising. I would expect different and lower values for the pictures where the contrast is lower, in your example the bottom pictures.
My understanding - maybe this is not the right word - lets say assumption is that this and similar programs are looking for an edge and then count the pixels which form that edge and their color/contrast values. With long enough edge it can be sampled many times and then calculate the MTF for this part of the picture based on the pixel pitch.
In this case I am seeing 17 pixels which go from light to dark horizontally and every pixels on the right is 2-3% darker till the cutoff... I would expect that if the pixels are in the 5-79% range (as it is here) the the MTF will be higher than the same pixels in the 19-50% range...
example.png

enricosavazzi
Posts: 1474
Joined: Sat Nov 21, 2009 2:41 pm
Location: Västerås, Sweden
Contact:

Re: MTF Mapper target help needed

Post by enricosavazzi »

bbobby wrote:
Wed Mar 29, 2023 6:53 am
Yes, it is surprising. I would expect different and lower values for the pictures where the contrast is lower, in your example the bottom pictures.
My understanding - maybe this is not the right word - lets say assumption is that this and similar programs are looking for an edge and then count the pixels which form that edge and their color/contrast values. With long enough edge it can be sampled many times and then calculate the MTF for this part of the picture based on the pixel pitch.
In this case I am seeing 17 pixels which go from light to dark horizontally and every pixels on the right is 2-3% darker till the cutoff... I would expect that if the pixels are in the 5-79% range (as it is here) the the MTF will be higher than the same pixels in the 19-50% range...
example.png
I think what Rik is emphasizing is "ratio". As long as there is no saturation or non-linearity in the transfer function, the MTF is indeed independent of subject luminosity, contrast etc. There might be a small rounding error when the dynamic range is reduced by the transfer function, especially if the input and output images are only 8 bit/channel, but not substantial.

On the other hand, I can see some uneven mottling in the magnified picture of the edge in your post. I don't know in what file format Rik posted his screen dumps, but if along the way they were converted to a lossy-compressed format like JPG, some compression artifacts may crop up. There is always a risk in doing quantitative pixel-peeping on an image published on the web.
--ES

bbobby
Posts: 64
Joined: Sat Jan 15, 2022 12:40 pm
Location: Indianapolis, IN

Re: MTF Mapper target help needed

Post by bbobby »

enricosavazzi wrote:
Wed Mar 29, 2023 8:05 am
I think what Rik is emphasizing is "ratio"...
I did noted that Rick is emphasizing on ratio: "...measures the ratio between input contrast and output contrast..."
Maybe I cannot get it right where the input and output contrast value are coming from...
In the example bellow I think these lines got the same contrast ratio if I count from the left to the right pixels (5-50, 25-70, 55-100).
5 10 15 20 25 30 35 40 45 50
25 30 35 40 45 50 55 60 65 70
55 60 65 70 75 80 85 90 95 100
ratio.png
But then if I made the same line with the same steps but instead of increasing them with 5% I increase them with only 3% then ratio is less...
20 23 26 29 32 35 38 41 44 47
ratio1.png

enricosavazzi
Posts: 1474
Joined: Sat Nov 21, 2009 2:41 pm
Location: Västerås, Sweden
Contact:

Re: MTF Mapper target help needed

Post by enricosavazzi »

OK, there are several different definitions of contrast, but what most of them have in common is that contrast is defined, and adjusted, relative to some kind of average luminance value.
See e.g. https://en.wikipedia.org/wiki/Contrast_(vision) .

I think what you are talking about in your example is actually luminance rather than contrast. I prefer to think of luminance values as numbers, rather than % of something else. In an 8-bit monochrome luminance scale, luminance is an integer that starts at one end of the range (0 = black) and ends at the opposite end (255 = white). Each pixel has its own luminance value (but does not have its own contrast value). There are many ways to increase the luminance of an image, but the two simplest ways are:
1 - Add a constant offset value to each luminance value. This does not change the contrast (i.e. the difference between the darkest and the lightest pixels), only the average luminance of the image.
2 - Multiply each luminance value by a constant. This changes both the average luminance and the contrast.

Either way, the luminance of one pixel cannot be less than 0 or greater than 255. Whenever you try to increase luminance above the maximum, or decrease it below the minimum, the luminance remains at 255 or 0, respectively. We say that the luminance is clipped, and clipping destroys image data that cannot be recovered by further manipulations of luminance or contrast. In order not to get false MTF results, you need to avoid clipping during the recording of the original image and the subsequent processing of the data.

PS - in your last picture, the pixel luminance in each square, left to right, is 210, 203, 196, 190, 184, 177, 171, 165, 160, 117. So there is a much bigger difference between the last and the next to last, than between each adjacent pair of other squares.
--ES

bbobby
Posts: 64
Joined: Sat Jan 15, 2022 12:40 pm
Location: Indianapolis, IN

Re: MTF Mapper target help needed

Post by bbobby »

enricosavazzi wrote:
Wed Mar 29, 2023 11:04 am
OK, there are several different definitions of contrast, but what most of them have in common is that contrast is defined, and adjusted, relative to some kind of average luminance value.
See e.g. https://en.wikipedia.org/wiki/Contrast_(vision) .

I think what you are talking about in your example is actually luminance rather than contrast. I prefer to think of luminance values as numbers, rather than % of something else. In an 8-bit monochrome luminance scale, luminance is an integer that starts at one end of the range (0 = black) and ends at the opposite end (255 = white). Each pixel has its own luminance value (but does not have its own contrast value). There are many ways to increase the luminance of an image, but the two simplest ways are:
1 - Add a constant offset value to each luminance value. This does not change the contrast (i.e. the difference between the darkest and the lightest pixels), only the average luminance of the image.
2 - Multiply each luminance value by a constant. This changes both the average luminance and the contrast.

Either way, the luminance of one pixel cannot be less than 0 or greater than 255. Whenever you try to increase luminance above the maximum, or decrease it below the minimum, the luminance remains at 255 or 0, respectively. We say that the luminance is clipped, and clipping destroys image data that cannot be recovered by further manipulations of luminance or contrast. In order not to get false MTF results, you need to avoid clipping during the recording of the original image and the subsequent processing of the data.

PS - in your last picture, the pixel luminance in each square, left to right, is 210, 203, 196, 190, 184, 177, 171, 165, 160, 117. So there is a much bigger difference between the last and the next to last, than between each adjacent pair of other squares.
Yes, last square on the right is way darker than my intentions, my mistake, not intentional... trying to do 2-3 things at the same time...
OK... another example... start the same way and this time moving the contrast slider only. I hope this time I got it right...
32 37 41 44 47 49 50 52 54 56
22 28 33 38 42 47 50 55 59 62
13 18 24 30 36 44 50 57 63 68
6 9 15 21 29 39 50 61 71 77
2 4 7 12 19 33 50 68 79 85
contrast 6.png

blekenbleu
Posts: 146
Joined: Sat May 10, 2008 5:37 pm
Location: U.S.
Contact:

Re: MTF Mapper target help needed

Post by blekenbleu »

bbobby wrote:
Wed Mar 29, 2023 6:53 am
assumption is that this and similar programs are looking for an edge and then count the pixels which form that edge and their color/contrast values. With long enough edge it can be sampled many times and then calculate the MTF for this part of the picture based on the pixel pitch.
The slanted edge test for MTF was devised when sensor resolution was typically much lower than optical resolution,
e.g. NTSC television cameras (nominally 640x480), where perhaps only a single pixel would be some middle gray when scanning across an edge.
By scanning at a highly acute angle to the edge, starting scans well into dark areas and ending well into light areas,
maximum available contrast is established for some sensor and optics,
so that absolute contrast ratios can be sorted from MTFs.
By changing only optics, differences in MTF were measured based on abruptness of transitions between normalized dark and light.
Such measurements suppose that both scan and edge are straight lines...
With modern high resolution sensors, multiple pixels obtain intermediate gray values for scans directly across edges,
making slant line tests quaintly anachronistic.
Metaphot, Optiphot 1, 66; AO 10, 120, and EPIStar 2571
https://blekenbleu.github.io/microscope

rjlittlefield
Site Admin
Posts: 23561
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Re: MTF Mapper target help needed

Post by rjlittlefield »

bbobby wrote:
Wed Mar 29, 2023 9:49 am
I did noted that Rick is emphasizing on ratio: "...measures the ratio between input contrast and output contrast..."
Maybe I cannot get it right where the input and output contrast value are coming from...
Let me try a different type of explanation.

MTF Mapper assumes that the original thing being imaged is a sharp edge.

That original thing will have one constant brightness value on one side of the edge, and a different constant brightness value on the other side of the edge, with a sudden transition between those two brightnesses.

What the imaging process does is to spread the edge. Far away from the edge, the image has a (nearly) constant brightness value on one side and a different (nearly) constant value on the other side. But the edge itself has gotten blurred out into a progression of values.

In the illustration below there are two sharp edges. One has high contrast, the other has low contrast, but they are both sharp. Below each sharp edge is a blurred version of that same edge. Both edges have been blurred by the same amount. I have marked in the illustration where the blurred edge has reached values that are 10% and 90% of the way from the locally constant dark to the locally constant bright.

2023-03-29_13-08-32.png

If we were trying to describe how big the blur is, we might use the width of that 10%-90% transition region as an indicator. In this case that blur width number would be 10. That is, the blur is 10 pixels wide, measured between 10% and 90% of the total range.

Note that the blur width is a constant value, despite that the first edge has high contrast and the second edge has low contrast.

Very roughly speaking, what MTF Mapper does is to look around and find the values of locally constant dark and light on opposite sides of edges, and then it measures the width of the blurred edge that transitions between those values. Sharp lenses will give narrow blurs, soft lenses will give wide blurs. The MTF50 value that is reported by MTF Mapper is an indication of the width of the blur.

So, the answer to your question is that all the information comes from the image. MTF50 is a measure of how quickly the pixel values change from A to B, not how much different the values of A and B are.

Make sense?

--Rik

Post Reply Previous topicNext topic