MTF mapper

A forum to ask questions, post setups, and generally discuss anything having to do with photomacrography and photomicroscopy.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

Adalbert
Posts: 2427
Joined: Mon Nov 30, 2015 1:09 pm

MTF mapper

Post by Adalbert »

Hello everybody,
A discussion about this point has already been started in the following thread:
http://www.photomacrography.net/forum/v ... 5&start=45
but I think it is better to create a new one for it.

Enclosed you will find the result of my current test (with a really white paper :-)

Image
( LSA 50mm & LU PLAN 5x & 200*133 px )

Mapper:
Image

BR, ADi

Lou Jost
Posts: 5945
Joined: Fri Sep 04, 2015 7:03 am
Location: Ecuador
Contact:

Post by Lou Jost »

Now that looks a lot nicer!!! Congratulations on your persistence. It has paid off.

Adalbert
Posts: 2427
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello Lou,
It's very nice of you :-)
And many thanks for your help!
BR, ADi

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

Post by rjlittlefield »

Refresh my memory, please: what optics and camera was this shot with? I see that you say "( LSA 50mm & LU PLAN 5x & 200*133 px )", but I don't know what "LSA 50mm" means and I'm not sure what the NA of the LU Plan is.

Also, can you clarify please that the 200x133 pixels image is simply a crop, done without resizing? The fact that the aspect ratio is 3:2, same as the whole frame, is making me a little nervous.

What has me spooked here is that the curves now look too good, as in way too high. When I run a calculated MTF based on what I think your optics are, I get numbers like diffraction-limited cutoff (MTF=0) occurring at about 0.4 cycles per pixel. Your curve is a lot higher than that. In fact it's within a few percent of a synthetic clean edge that I generated by a few steps of 50% downsizing with bicubic spline in Photoshop, starting with a high resolution image that was made with select-and-fill.

So I'm looking for things that might be messing up the test.

Accidentally downsizing instead of cropping will certainly produce an unrealistically sharp edge.

I also notice that your background is blown out to pure white, and I'm concerned that overexposure of the background might push the curve up as an artifact.

Then, I notice in re-reading your earlier thread that you were using stacked output. There's plenty of room for mischief in stacking, especially if you're aligning and/or running PMax. DMap done with alignment turned off should be pretty safe (assuming that your physical apparatus maintains alignment well enough).

But even so, the TIFF and JPEG outputs from stacking will typically use some nonlinear profile with gamma around 2.

MTF mapper really prefers to work with linear data, like what it would have if you gave it a raw file to work with.

I don't know any way to crop a raw file and have it still be raw, but it seems to me that you could have dcraw output with a linear color space and run that into MTF mapper.

Zerene Stacker should also be able to handle linear color space (though it's been a while since I checked that), if you want to continue running from stacked outputs.

--Rik

Adalbert
Posts: 2427
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello Rik,
what optics and camera was this shot with?
Sorry, I didn’t copy the information from the original thread:
- camera = CANON EOS M3 (pixel pitch 3,7)
- tube-lens= Sigma Life-Size Attachment 52mm
- tube-length=50mm
- lens= NIKON LU Plan 5x / 0.15
- illumination= 4*YN660
- subject= razor blade on white paper
- stack method= PMax
- stack size=70 pictures
Actually I wanted to compare the quality of the images dependent on the length of the tube-lens (this time=50mm). MTF-chart was only one part of this test.
So, I was not looking for the general method for the analysis of the resolution of the microscope-lenses but only for the comparison of the results of my setups pro tube-length.
After I had learnt the option with one slanted-edge of the MTF-mapper I executed this test with the mapper.

Maybe we can establish such general method, we only have to find a test-target :-)

BR, ADi

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

Post by rjlittlefield »

ADi, thanks for the data. They confirm that I was imagining the correct configuration. The key bits for me are 5X and NA 0.15, which establish the diffraction limits.

Again, by my calculations your computed MTF curve cannot possibly be correct because it is way better than diffraction permits. This means that your test protocol is not valid, which means that using it to compare configurations will be a waste of time.

So let's go back to things that might be causing the problem.

First, you should not be over-exposing the light background. Background should be uniform light gray. To make this happen, just position the paper far back from the razor blade, so that it is completely out of focus. At 5X NA 0.15, placing the paper an inch or two behind the razor blade should be OK.

Second, it is critical that the small image that is fed to MTF mapper is constructed by cropping without resizing. With your optics, MTF mapper at 100% should be showing that the edge transition takes place over a span of 2-3 pixels, as shown in your other thread at http://www.photomacrography.net/forum/u ... _prg_1.jpg :

Image

I suggest to try again, paying special attention to these issues.

--Rik

Lou Jost
Posts: 5945
Joined: Fri Sep 04, 2015 7:03 am
Location: Ecuador
Contact:

Post by Lou Jost »

Rik, it was my fault that Adalbert used a white background. I don't understand how an arbitrary shade of light gray would be appropriate to measure contrast. Surely then the result would depend on the shade of gray used? Can you explain this choice a bit?

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

Post by rjlittlefield »

The sharpness of an edge is determined by how quickly the gray level transitions from A to B. It doesn't really matter what values A and B are because those can be determined from the image.

The problem is that if the image is over-exposed, the edge can become artificially sharpened because the gray levels go quickly from 0 to 255 on their way to (say) 1000 which cannot be represented in the image file. Clipping of gray levels is not your friend in slanted-edge analysis.

--Rik

Smokedaddy
Posts: 1953
Joined: Sat Oct 07, 2006 10:16 am
Location: Bigfork, Montana
Contact:

Post by Smokedaddy »

For my background, I used to tape a razor blade to my computer monitor while I had Notepad up and running.

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

Post by rjlittlefield »

Smokedaddy wrote:For my background, I used to tape a razor blade to my computer monitor while I had Notepad up and running.
That will work fine as long as you're shooting from far enough away that the monitor pixels are nowhere near resolved on the camera sensor. If the monitor pixels are resolved, then you get messed up numbers because the slanted-line analysis assumes that the actual edge is a sharp line between two regions that each have a uniform gray level.

--Rik

lothman
Posts: 958
Joined: Sat Feb 14, 2009 7:00 am
Location: Stuttgart/Germany

Post by lothman »

Adalbert wrote: Maybe we can establish such general method, we only have to find a test-target :-)

BR, ADi
such a chrome mask on glass should work when backlit, shouldn't it?

https://www.ebay.de/itm/0-01MM-5-Scales ... Sw3ydVzWBq

Adalbert
Posts: 2427
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello Rik,
OK, this time 5cm distance between the paper and razor blade and a cut of 200x200 px.

Image

Image

BR, ADi

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

Post by rjlittlefield »

This looks much more believable.

The portion of the curve between 0.3 and 0.5 cycles/pixel looks like what's expected from the diffraction-limited tail end of any curve for 5X NA 0.15.

The rapid drop from 0.0 to 0.1 cycles/pixel with the plateau from 0.1 to 0.3 is typical of an aberration-limited curve with wavefront error around 1/2 lambda.

If you were not focus stacking, then I would suggest testing each of a series of frames closely surrounding best focus, to find the best one. Since you are focus stacking, there's not much point in doing that.

However, if you're currently using PMax, then I would be interested to see the curve for a properly done DMap output also. "Properly done" means to set the contrast threshold very high, so that the DMap mask covers everything except a narrow strip along the edge of the razor blade. This will be simplest to do if you set the mask color to something other than black, for example as discussed at http://www.photomacrography.net/forum/v ... 149#215149 .

As a separate issue, it would be interesting to see the test repeated, but with an added aperture that restricts the exit pupil of the objective to about 70% of its current diameter. This can be expected to significantly reduce the main aberrations. In that case the portion of the curve from 0.0 to 0.2 can be expected to rise significantly, while the tail end of the curve will drop to a cutoff maybe around 0.25 or 0.3 due to worse diffraction from the smaller aperture.

I look forward to further results -- thanks for all your hard work!

--Rik

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

Post by rjlittlefield »

lothman wrote:such a chrome mask on glass should work when backlit, shouldn't it?
https://www.ebay.de/itm/0-01MM-5-Scales ... Sw3ydVzWBq
I have one of those. There's nothing on that slide that is the proper size and shape to be handled automatically by MTF mapper, even in single ROI mode. With some careful work in Photoshop, it may be possible to use one of the long bars that point to the central dots, by using select-and-fill to turn the bar into a block that has one legitimate edge.

A better possibility would be to use the square blob part of a USAF 1951 target. I have one of those too, but unfortunately at this moment most of my photo stuff is still put away because of some recent house repairs.

I'm actually pretty happy with the results that ADi is getting with his razor blade. Perhaps the razor blades that I have looked at in the past were just badly made. I'll get another sample next time I go to the grocery store.

--Rik

Smokedaddy
Posts: 1953
Joined: Sat Oct 07, 2006 10:16 am
Location: Bigfork, Montana
Contact:

Post by Smokedaddy »

I used to use this one (the smaller one) for telescope eyepiece testing and Imatest (or I was trying to). <g>

Image

Post Reply Previous topicNext topic