Re: A "slanted edge" analysis program
- From: "Bart van der Wolf" <bvdwolf@xxxxxxx>
- Date: Wed, 28 Sep 2005 19:06:50 +0200
"Lorenzo J. Lucchini" <ljlbox@xxxxxxxxxx> wrote in message news:L3l_e.674$133.670@xxxxxxxxxxxxxxxxxxxxxxxx
Bart van der Wolf wrote:SNIP
The image code values should be linarized at this stage, so film/sensor non-linearity and gamma adjustments can't influence the calculations.
Yes, I am currently ignoring gamma, as my test images are gamma=1.0 anyway.
For real accurate results, that remains to be verified ... Testing a (transparent) step wedge may/will reveal 'interesting' features of hardware *and* of scanner driver software.
If I'm not mistaken, though, this all boils down to a "Pixel=InputPixel^Gamma" instead of just "Pixel=InputPixel", so I'll > be be very easy to add.
Yes, for straight Gamma only (sRGB profiled images use a 'slope-limited' Gamma). Also beware that Gamma adjustment may mean 1/Gamma, depending on what is being adjusted where. This does assume that Gamma is the only non-linearity.
SNIP
I think that, especially on non-linear image codes, this will influence the MTF results, because the contrast is expanded. On a perfectly symmetrical brightness distribution its effect will be small, but the possibility of clipping in later stages should be avoided.
I'm not sure I understand why it can affect the MTF, but I'll take your word for it.
Assume all it takes is a lowering of the highlight clipping point, which essentially is the same as multiplying all luminance levels by a fixed factor. That would work out differently for shadows/highlights if the response was non-linear.
SNIP
Also a check for at least 20% edge modulation should be made, in order to avoid a too low input S/N ratio.
I'm taking note, but I think I'll leave such checks for later when the program is somewhat stable.
Obviously, I know how actual programming works (tackle large issues first, and get a working alpha version before working on the 'icing of the cake'), but just don't forget some obvious boundary checks in the end.
It is however perfectly normal to normalize the ESF output to a range between 0.0 and 1.0, and later to normalize the SFR/MTF to 1.0 (100%) at zero spatial frequency.
Currently, I'm normalizing the ESF, the LSF and the MTF to between 0.0 and 1.0.
Just note that actual MTFs can exceed 1.0, assuming correct normalization to 1.0 at zero cycles. Edge sharpening halo can achieve that easily.
SNIP
>The ISO suggests to [...] determine the centroid of the LSF (by calculating the discrete derivative of the ESF). The centroids can be used for regression.The derivative suggested by the ISO is: "for each line of pixels perpendicular to the edge, the edge is differentiated using the discrete derivative "-0,5 ; +0,5", meaning that the derivative value for pixel "X" is equal to -1/2 times the value of the pixel immediately to the left, plus 1/2 times the value of the pixel to the right".
Sorry if I'm thick, but mathematics isn't my best friend...
Hey, I also know my limitations in that field ... ;-)
You're implying that, for each line of pixels, the edge center(oid?) will be the absolute maximum of the above derivative, aren't you?
Yep.
But isn't the absolute maximum of the derivative precisely the maximum gradient?
Rereading it, yes, but it actually is where the increasing contrast turns into decreasing contrast (the first derivative being the slope of the curve).
(Though the formula I use is currently simpler than the one you cite: simply y'[i]=y[i+1]-y[i])
Yes, and it'll produce a difference, but actual nodes will on average be displaced by half a pixel. Nevertheless, the sample code from the ISO seems to do what you did, so I'd suggest leaving it that way.
SNIP
See earlier remark, and provisions need to be made to detect multiple maxima (caused by noise/graininess).
What kind of provisions?
With noisy images, there can be multiple LSF maxima from a single ESF. One should decide which maximum to take. I dug up some old Word document with C code for the SFR calculation. It takes the average between the leftmost and rightmost maxima.
If your email address in your signature is valid, I can send you that document.
SNIP
Even though the SourceForge description currently says little more than "calculates the MTF from a slanted edge", ultimately I'd like this program to do automatic deconvolution (or whatever is best) of images based on the edge results.
Yes, that's a good goal, although it will take more than a single slanted edge to get a two-dimensional a-symmetric PSF). What's worse, the PSF can (and does) change throughout the image, but a symmetrical PSF will already allow to improve image quality. Some hurdles will need to be taken, but the goal is exactly what I am looking for.
SNIP
My main resource has been http://www.isprs.org/istanbul2004/comm1/papers/2.pdf
where I took the evil alternative to the "4x bins" that I'm currently using, with all the regression nighmares it brings ;-) But it was an interesting document, anyway.
Yes, we're not the only ones still looking for the holy grail, it seems.
I'm working on a method that will produce a PSF, based on the ESF derived from a slanted edge. That PSF can be used in various deconvolution methods, and it can be used to create a High-pass filter kernel. Could be useful to incorporate in the final program.
Bart
.
- Follow-Ups:
- Re: A "slanted edge" analysis program
- From: Lorenzo J. Lucchini
- Re: A "slanted edge" analysis program
- References:
- A "slanted edge" analysis program
- From: Lorenzo J. Lucchini
- Re: A "slanted edge" analysis program
- From: Bart van der Wolf
- Re: A "slanted edge" analysis program
- From: Lorenzo J. Lucchini
- A "slanted edge" analysis program
- Prev by Date: Re: A "slanted edge" analysis program
- Next by Date: Re: A "slanted edge" analysis program
- Previous by thread: Re: A "slanted edge" analysis program
- Next by thread: Re: A "slanted edge" analysis program
- Index(es):
Relevant Pages
|