To visualize the MTF curve (or SFR curve, if you prefer), load up any suitable image in MTF Mapper using the menu option "File -> Open". Select the "Annotated image" output mode, like so:
Make sure "Annotated image" is selected in the desired output types box |
Click the "Open" button, and wait for the outputs to start appearing in the "Data set" tree-view panel. Expand the entry in the tree-view to expose the "annotated" entry, and click on it:
Note the cyan-coloured text superimposed on the edges of your black target squares. These values are the MTF50 values of the edges, expressed in cycles per pixel. |
A brief digression: If the text label is displayed in yellow (rather than cyan), then it indicates that MTF Mapper has deemed the edge to be of "medium" quality. This usually means that the edge orientation is poor, that is, close to one of the critical angles that could mean the displayed MTF50 value is less accurate than the ideal. The edge will also be displayed in yellow if the edge length is sub-optimal (meaning too few pixels along the edge), which also degrades the MTF accuracy. Normally the values displayed in yellow are still usable, but be careful.
Occasionally you will see some of the MTF50 labels displayed in red, like in this example:
The leftmost red label coincides with an edge with a ~25 degree orientation, which is within 2 degrees of the critical angle at 26.565 degrees |
Back to the main story: clicking on an edge label pops up the MTF curve display window,
The result of a single left-button click on an MTF50 label |
The vertical gray bar is a cursor that follows the mouse, which will read off the actual contrast value corresponding to the MTF curve at the indicated spatial frequency; the read-out of this cursor is displayed just below the plot ("frequency: 0.098 contrast: 0.403" in the example). Again, the colour of the "contrast: <xyz>" readout matches that of the plotted curve.
While the MTF curve window is open, you may left-click on any other edge in the "annotated" image to replace the contents of the MTF curve window with the data corresponding to the newly selected edge. This includes clicking on edges in any other "annotated" output available in the "Data set" tree-view.
If you would like to compare the MTF curves of two edges, select the first edge as above, but hold down <shift> while left-clicking on the second edge. This adds the second edge to the plot:
Note the addition of the green curve, and the two green text labels, corresponding to the newly added edge's MTF |
Lastly, you can add a third curve to the plot using the same <shitf>+left click method.
Adding a third curve behaves as expected |
If you already have three curves plotted, the last curve is replaced by this action. If you left click on a new edge without holding down shift, the plot reverts back to displaying only a single MTF curve (using the newly selected edge's MTF).
Update (2017/04/16)
I have since added the two save buttons, grab a copy of version 0.5.19 or later to give it a try.
Future improvements
It might be useful to drop a pin, or some other visual marker onto the "annotated" image to indicate which edge was selected. It might be even more useful to show the actual ROI used by MTF Mapper, but that information is not currently available in the outputs.
Is there a way to access the score used to create the annotation color or some other parameter from the command line? I know I can grab an annotated edge image and look for the color. I am scoring individual edges. Ralph
ReplyDeleteHi Ralph,
ReplyDeleteUnfortunately the "edge quality" value is not recorded in any of existing text output files (such as edge_mtf_values.txt), and I have to maintain backwards compatibility for those outputs.
What you can do, though, is to look at the MTF50 value in the edge_mtf_values.txt file (see section 5.6 of the user guide). If this value is 1.0 cycles/pixel, then the edge will have been coloured red (possibly marked as "N/A") in the annotated output.
The edge will be coloured yellow in the annotated output if the edge is shorter than 25 pixels, which you might be able to infer from your image dimensions if you are processing individual edges with the --single-roi option. If by "scoring individual edges" you meant that you still process a whole chart, then you can infer the size of the squares from the edge centroids (second and third columns in edge_mtf_values.txt, see chapter 5.6 of the user guide). I would recommend that you use larger edges if possible, if you regularly end up with such short edges.
The last condition that would produce a yellow annotation would be if the relative edge angle was close to 26.565 degrees; in the code I check for closer than 1 degree to 26.565. You can extract the relative edge angle as column 4 in edge_sfr_values.txt.
There are two more angle checks that produce a red annotation: relative angles below 1 degree, and above 44 degrees. These do not typically produce a N/A.
If I may ask, what do you want to do with the edge quality score?