Luminous Landscape Forum

Equipment & Techniques => Digital Cameras & Shooting Techniques => Topic started by: bjanes on October 17, 2011, 12:30:55 pm

Title: Resolution and alaising challenge
Post by: bjanes on October 17, 2011, 12:30:55 pm
Bart van der Wolf has published an innovative resolution test target (http://www.openphotographyforums.com/forums/showthread.php?t=13217) based on a Siemens star with sinusoidally varying radial bars. The target avoids error generating sharp edges and records real resolution in many orientations with a single shot. Shooting distance is noncritical, and a target distance of 20-50x the focal length of the lens is suggested.

Aliasing artifacts stand out by their seemingly hyperbolic divergence from the expected radial direction. Frequencies beyond the Nyquist limit will either be blurred to zero contrast or aliased. One can determine the resolution in cycles per mm or cycles per pixel as Bart describes in his post (the maximal resolution of an ideal sensor is 0.5 cycles per pixel). Results of shooting this target with the Nikon D3 are shown below. The image must be viewed at 100% on the screen to avoid screen induced aliasing. The circle indicates the Nyquist limit of the sensor, which is 59 cycles/mm. Some aliasing with Moire is present beyond Nyquist. Calculated resolution is 56 cy/mm or 0.46 cy/pixel.

(http://bjanes.smugmug.com/Photography/Alaising/i-xBwNRTT/0/O/BartNyquist.png)

The image was taken with the 60mm/f2.8 MicroNikkor, which likely out-resolves the sensor of the camera. However, a good lens improves image quality even with a relatively low resolving camera by providing good MTF below the Nyquist limit. One can calculate MTFs at various frequencies by using the slanted edge portions of Bart's target with Imatest. Results for this camera are shown with the image rendered by ACR ver 6.5 with default settings (including sharpening). The MTF at Nyquist is an indication of aliasing.

(http://bjanes.smugmug.com/Photography/Alaising/i-38Zps2G/0/O/StarSep2720110001YL702cpp.png)

The extent of aliasing can be shown with Bart's target. Aliasing and Moire beyond Nyquist are evident and are not completely eliminated by the blur filter that this camera uses.

It would be interesting if users of other cameras, especially those without blur filters, would post their results. MFDB results would be of special interest, since this method clearly demonstrates aliasing. The effects of aliasing on image quality is debated, but Canon and Nikon provide these on their dSLRs for a reason despite their considerable expense. (I can anticipate practical photographers stating that they take photographs of landscapes, etc, and not test targets  :)).

Regards,

Bill
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 17, 2011, 02:29:52 pm
Its a great pattern, exactly what you need for testing your new lens. I'm still unclear on the diameter measurement. If it had small lines at right angles along one direction stating % of picture height or something similar it would be perfect. Please fill me in if I did not understand something. After taking the shot you convert the raw looking carefully (probably zoomed in) for where the lines start to fail. Marking the diameter is easy. Now you have to decide on how many pixels it is relative to the whole shot? Does the software imatest do this for you?
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 17, 2011, 02:37:49 pm
I guess you can crop the center circle out to a new picture which will give you the number of pixels rather than having to counting them. Then the ratio of that vs the number of pixels in the whole shot should be straightforward.
Title: Re: Resolution and alaising challenge
Post by: bjanes on October 17, 2011, 03:43:40 pm
Its a great pattern, exactly what you need for testing your new lens. I'm still unclear on the diameter measurement. If it had small lines at right angles along one direction stating % of picture height or something similar it would be perfect. Please fill me in if I did not understand something. After taking the shot you convert the raw looking carefully (probably zoomed in) for where the lines start to fail. Marking the diameter is easy. Now you have to decide on how many pixels it is relative to the whole shot? Does the software imatest do this for you?

Read the explanation on how to use the target on Bart's web site. One simply views the rendered image at 100% and then measures the central blur diameter with the Photoshop ruler tool set to read in pixels. The resolution of the whole optical chain (not just of the lens) is (144/pi)/diameter, which can be expressed as the number of pixels multiplied by the pixel pitch.

In the example, the blur radius was 96 pixels. The pixel pitch of the D3 is 8.46 microns, so the diameter is 96 * 8.46 / 1000 or 0.812 mm. One then plugs this value into the formula.

Regards,

Bill
Title: Re: Resolution and alaising challenge
Post by: Guillermo Luijk on October 18, 2011, 05:14:21 pm
Hi Bill, could you please try the experiment to visualize a single RAW channel from your test chart (dcraw -v -d -r 1 1 1 1 -4 -T file.nef plus 50% nearest neighbour rescaling in PS) to seek for aliasing artifacts there?.

I wonder what results can be obtained leaving demosaicing aside, and considering the sensor as 4 independent sensors working at half the spatial sampling frequency each. Colour moiré can be produced by the RAW development algorithms, not because of capture aliasing itself, so this would be a way to find out if aliasing really exists in the individual RAW channels or it's a produce of the Bayer interpolation process.


(I can anticipate practical photographers stating that they take photographs of landscapes, etc, and not test targets  :)).

I admire your politeness towards those obnoxious anti-geeks infesting interesting forum threads.

Regards

Title: Re: Resolution and alaising challenge
Post by: bjanes on October 18, 2011, 07:05:24 pm
Hi Bill, could you please try the experiment to visualize a single RAW channel from your test chart (dcraw -v -d -r 1 1 1 1 -4 -T file.nef plus 50% nearest neighbour rescaling in PS) to seek for aliasing artifacts there?.

I wonder what results can be obtained leaving demosaicing aside, and considering the sensor as 4 independent sensors working at half the spatial sampling frequency each. Colour moiré can be produced by the RAW development algorithms, not because of capture aliasing itself, so this would be a way to find out if aliasing really exists in the individual RAW channels or it's a produce of the Bayer interpolation process.

Guillermo,

I used DCRaw (DCRawms for my 64 bit Windows 7 machine) as requested and used bicubic 50% nearest neighbor in Photoshop. Since the image was dark, I used a levels command to reset the white point with the results shown on the right. I then used Iris split_cfa to split out the green 1 channel and saved the *.fit as *.tiff, and the result is shown on the left (without resizing).

The results are similar, with the blur area of the low-pass filter about half the size as previously, but there is additional aliasing in the surrounding area. I don't know how to interpret this.  Perhaps you or Bart (if he sees this thread) can help.

Bill

Results:
(http://bjanes.smugmug.com/Photography/Alaising/i-tRF3H8n/0/O/CompositeIrisDCRaw.png)

Screen capture of DCRaw command:
(http://bjanes.smugmug.com/Photography/Alaising/i-DbgFCZf/0/O/DCRaw.png)

Title: Re: Resolution and alaising challenge
Post by: Guillermo Luijk on October 18, 2011, 07:57:31 pm
the blur area of the low-pass filter about half the size as previously, but there is additional aliasing in the surrounding area. I don't know how to interpret this.  Perhaps you or Bart (if he sees this thread) can help.

Results:
(http://bjanes.smugmug.com/Photography/Alaising/i-tRF3H8n/0/O/CompositeIrisDCRaw.png)

My interpretation is that for being this a sampling of the same scene with the same AA filter but at half the sampling frequency (double spatial interval), much more aliasing artifacts take place and they begin at lower (half?) spatial frequencies of the scene (i.e. they begin earlier than considering the whole interpolated Bayer pattern).

This means the Bayer sensor + demosaicing, in terms of effective sampling frequency, actually behaves like (or close to) a real sampling at a spatial interval of one photosite (like a Foveon sensor would). I had my doubts about this, which is always regarded as correct, because the interpolation process involved is not strictly related to the sampling process, but something done afterwards by combining the 4 sets of data (RGGB) sampled at 2 photosite intervals.

This also means the AA filter is well tuned to avoid aliasing in the demosaiced image, being too weak to avoid it on each individual Bayer channel. In other words, the AA filter is as weak as it can be.

I guess that colour moiré in the slightly aliased areas (now I refer back to your original image) is the only real drawback of Bayer vs Foveon regarding aliasing issues, and it can anyway be kept to a minimum with a good interpolation algorithm.

Thanks for taking your time. Let's see if we have Bart's feedback.
Title: Re: Resolution and alaising challenge
Post by: joofa on October 19, 2011, 01:31:38 am
This means the Bayer sensor + demosaicing, in terms of effective sampling frequency, actually behaves like (or close to) a real sampling at a spatial interval of one photosite (like a Foveon sensor would).

A Bayer CFA can be treated as a regular sampling with a spatial interval of one photosite as you say. Here is a simplified 1-D diagram of this concept:

(http://djjoofa.com/data/images/bayer_demosaic_filtering.jpg)
Title: Re: Resolution and alaising challenge
Post by: Bart_van_der_Wolf on October 19, 2011, 04:36:39 am
The results are similar, with the blur area of the low-pass filter about half the size as previously, but there is additional aliasing in the surrounding area. I don't know how to interpret this.  Perhaps you or Bart (if he sees this thread) can help.

Hi Bill,

What you are effectively seeing here is the result of 'poor' downsampling/decimation, by skipping every other sensel, and you'll get a better view on the effects of more point sampling rather than area sampling. You'll get a similar effect when you downsample your initial demosaiced version with nearest neighbor resampling to 50% size.

When you compare these R/G/G/B sub-images (not really images but rather datasets), the Nyquist frequency is now at 46 (45.8 ) pixels diameter (because half of the pixels were removed), and what Guillermo was asking is shown as mild aliasing inside that 46 pixel center diameter. So the task for the Raw converter includes having to deal with aliasing which as usual mimicks as lower frequency detail but cannot be separated from actual detail. The aliasing is not a product of the demosaicing, although it may produce some challenges in filling in the 2 missing colors per pixel position.

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: Bart_van_der_Wolf on October 19, 2011, 05:09:47 am
My interpretation is that for being this a sampling of the same scene with the same AA filter but at half the sampling frequency (double spatial interval), much more aliasing artifacts take place and they begin at lower (half?) spatial frequencies of the scene (i.e. they begin earlier than considering the whole interpolated Bayer pattern).

Hi Guillermo,

That's how I see it as well. Sampling at every other sensel, and decimating the image by removing the 'empty' columns/rows. That will introduce jaggies on edges, and lower frequency aliases for under-sampled fine repetitive detail. The decimation issues manifest themselves mostly between the Nyquist frequency (46 pixel center diameter on the decimated image) and half of Nyquist (witin the 92 pixel center diameter). Thanks to this target not having sharp edges, but only sinusoidal patterns the effect is limited to the (expected) problem area. Sharp edges will show stairstepping and would make it much harder to see the real issues.

Quote
This means the Bayer sensor + demosaicing, in terms of effective sampling frequency, actually behaves like (or close to) a real sampling at a spatial interval of one photosite (like a Foveon sensor would). I had my doubts about this, which is always regarded as correct, because the interpolation process involved is not strictly related to the sampling process, but something done afterwards by combining the 4 sets of data (RGGB) sampled at 2 photosite intervals.

Also remember that the 4 sub-images are offset by 1 pixel position to eachother, but that will be dealt with when interpolating the 'empty' positions in the color grid. The offset could pose a problem with haphazard alignment with the sensel grid, if there were no AA-filter, and by using sinusoidal patterns.

Quote
This also means the AA filter is well tuned to avoid aliasing in the demosaiced image, being too weak to avoid it on each individual Bayer channel. In other words, the AA filter is as weak as it can be.

Yes it seems to be well dimensioned.

Quote
I guess that colour moiré in the slightly aliased areas (now I refer back to your original image) is the only real drawback of Bayer vs Foveon regarding aliasing issues, and it can anyway be kept to a minimum with a good interpolation algorithm.

Color moiré is an inherent problem when the sampling densities of Green versus Red and Blue differ, and the sampling positions are offset by a pixel. However, it is handled very well by modern demosaicing algorithms in the majority of situations.

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: bjanes on October 19, 2011, 09:54:14 am
That's how I see it as well. Sampling at every other sensel, and decimating the image by removing the 'empty' columns/rows. That will introduce jaggies on edges, and lower frequency aliases for under-sampled fine repetitive detail. The decimation issues manifest themselves mostly between the Nyquist frequency (46 pixel center diameter on the decimated image) and half of Nyquist (witin the 92 pixel center diameter). Thanks to this target not having sharp edges, but only sinusoidal patterns the effect is limited to the (expected) problem area. Sharp edges will show stairstepping and would make it much harder to see the real issues.

Bart's explanation fits the observed pattern. Here is the decimated sub-image of the green one channel. The central area that is well blurred by the low pass filter (inner red circle) is about 46 pixels as Bart predicted, and the surrounding decimated region (outer red circle) is slightly larger than predicted, measuring about 110 pixels.

(http://bjanes.smugmug.com/Photography/Alaising/i-jqHcZss/0/O/F1circles.png)

It would be interesting to see the results of similar tests with cameras lacking a low-pass filter, but thus far no one has stepped up to the plate. Users of those cameras do not appear to be interested in technical analysis or perhaps they are afraid of what such an analysis would show.

Regards,

Bill
Title: Re: Resolution and alaising challenge
Post by: Bart_van_der_Wolf on October 19, 2011, 10:27:53 am
It would be interesting to see the results of similar tests with cameras lacking a low-pass filter, but thus far no one has stepped up to the plate. Users of those cameras do not appear to be interested in technical analysis or perhaps they are afraid of what such an analysis would show.

Which would be a pitty, because they can learn a lot about their tools and technique. It can also reveal real issues like mirror shake, or a not sturdy enough tripod/head (or street traffic), or a lens issue. An image of the target, e.g. in a product shot, will allow to estimate the AA-filter effect of diffraction and/or defocus, or point out sub-optimal downsampling in the post processing workflow, and allows to determine the best pre-downsampling blur compromise. The list of learning experiences is even longer than that, e.g. which MFDB would be better suited for shooting fashion and avoiding fabric related artifacts, to name just one.

A non-OLPF fitted camera will usually perform flawlessly up to the Nyquist frequency (only limited by technique, lens and Raw converter), and show aliasing artifacts inside the 92 pixel central blur circle, and less noticeable artifacts with smaller sensel pitch DBs.

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: ErikKaffehr on October 19, 2011, 01:59:10 pm
Hi,

Sony Alpha 55 SLT, 50/1.4 focused using LV at f/1.4 and shot at f/5.6 at 2.00 m from focal plane. Could it be it has only one layer of OLP filters?

I also include a corresponding image from the Sony Alpha 900.

Best regards
Erik
Title: Re: Resolution and alaising challenge
Post by: Bart_van_der_Wolf on October 19, 2011, 02:51:52 pm
Sony Alpha 55 SLT, 50/1.4 focused using LV at f/1.4 and shot at f/5.6 at 2.00 m from focal plane. Could it be it has only one layer of OLP filters?

Hi Erik,

Thanks for participating, it will also help others.

It doesn't look like a single OLPF layer, that would cause a more elliptic blur. It is probably a slightly less effective OLPF filter, or the Raw converter is trying too hard. Normally the diagonal directions have a slightly higher resolution compared to the horizontal/vertical directions. That's normal in square grid.

I think the sharpening radius was a tad too large, causing some halos that interact with the lower frequencies outside the 92 pixel Nyquist boundary. There is also a beginning of mazing artifacts near Nyquist, similar to what I can get with Capture One as Raw converter. Which Raw converter did you use?

Since defocus will quickly kill resolution near Nyquist, I usually take several images, Live View with loupe, and pick the best. It will teach us how important technique, and things like Live View are for the best quality.

Of course this is not a contest, but Bill's micro lens is very good, and will be a challenge for other lenses to reach so close to Nyquist. Your lens looks pretty normal (as you'll see when others participate), just check your sharpening settings or try a different Raw converter or different settings (e.g. no clarity, noise reduction, and such).

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: bjanes on October 19, 2011, 03:13:37 pm
Hi,

Sony Alpha 55 SLT, 50/1.4 focused using LV at f/1.4 and shot at f/5.6 at 2.00 m from focal plane. Could it be it has only one layer of OLP filters?

I also include a corresponding image from the Sony Alpha 900.

Best regards
Erik

Erik,

Thanks for rising to the challenge! I downloaded your images and calculated the resolution by Bart's method and obtained 100 cy/mm or 0.48 cy/pixel for the Alpha 65 and 78 cy/mm or 0.46 cy/pixel for the Alpha 900. This is very close to the Nyquist limits for the sensors (105 and 88 respectively), indicating that your results are very close to the theoretical limit and that your photography and processing are optimal.

The Moire for the Alpha 65 does appear asymmetrical. The selection of the "blur centers" is somewhat arbitrary, but I tried to select the areas where the aliasing artifacts exhibited a hyperbolic divergence from the expected radial direction. My selections are shown. Hopefully, Bart will comment. In all my tests, the blur diameter is around 100 pixels. Is this chance?

Regards,

Bill
Title: Re: Resolution and alaising challenge
Post by: bjanes on October 19, 2011, 03:22:33 pm

Of course this is not a contest, but Bill's micro lens is very good, and will be a challenge for other lenses to reach so close to Nyquist. Your lens looks pretty normal (as you'll see when others participate), just check your sharpening settings or try a different Raw converter or different settings (e.g. no clarity, noise reduction, and such).

Bart,

According to the results I was posting prior to your most recent post, it appeared that Erik's results also closely approached Nyquist. Where did I go wrong?

Bill
Title: Re: Resolution and alaising challenge
Post by: ErikKaffehr on October 19, 2011, 03:29:15 pm
Hi,

Bart is right that I may use excessive sharpening. It's more optimized for the Alpha 900, and I find it a bit excessive on the Alpha 55.

Best regards
Erik

Bart,

According to the results I was posting prior to your most recent post, it appeared that Erik's results also closely approached Nyquist. Where did I go wrong?

Bill
Title: Re: Resolution and alaising challenge
Post by: Bart_van_der_Wolf on October 19, 2011, 03:42:09 pm
The Moire for the Alpha 65 does appear asymmetrical.

It does appear to be a bit asymmetrical, but it's too early to tell whether that's due to lens decentering or something else. The sharpening makes it a bit harder to see what's going on. When ths pattern does return in repeat shots, then we can eliminate camera shake in an unlikely diagonal direction.

Quote
The selection of the "blur centers" is somewhat arbitrary, but I tried to select the areas where the aliasing artifacts exhibited a hyperbolic divergence from the expected radial direction. My selections are shown. Hopefully, Bart will comment. In all my tests, the blur diameter is around 100 pixels. Is this chance?

Indeed, it is sometimes a bit hard to set the cut-off point, that's why adding a circle of 92 pixel diameter in the result helps to spot asymmetry. The hyperbolic divergence is a dead giveaway of aliasing, but I also look for where usually a horizontal or vertical dark and light 'line' pair seems to change phase, usually just after they both turned medium gray for a pixel or so.

The fact that you get consistent readings of around 100 diameter just tells us that your optical system resolves close to the Nyquist frequency. Try stopping down the lens to f/11 or f/16, or wide open, you'll get a different result.

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: Bart_van_der_Wolf on October 19, 2011, 03:50:36 pm
According to the results I was posting prior to your most recent post, it appeared that Erik's results also closely approached Nyquist. Where did I go wrong?

Nothing wrong, the resolution near Nyquist in the first shot is just not as well behaved as it could be, partly due to sharpening. It gives a good starting point to optimize technique a bit, postprocessing, and perhaps repeat he experiment to eliminate potential shortcomings during the test shot. It is e.g. possible that traffic in the street, or wind on a high building, or people walking in the room have an influence. By repeating the experiment one can see if it's systematic or not.

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: ErikKaffehr on October 19, 2011, 04:16:18 pm
Hi,

The image was taken with studio flash and LV based focusing so I don't really see the probability for random effects. I enclose an unsharpened image.

The file is here: http://echophoto.dnsalias.net/ekr/images/20111019-_DSC1394.dng

Best regards
Erik


Nothing wrong, the resolution near Nyquist in the first shot is just not as well behaved as it could be, partly due to sharpening. It gives a good starting point to optimize technique a bit, postprocessing, and perhaps repeat he experiment to eliminate potential shortcomings during the test shot. It is e.g. possible that traffic in the street, or wind on a high building, or people walking in the room have an influence. By repeating the experiment one can see if it's systematic or not.

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: bjanes on October 19, 2011, 05:52:59 pm
The image was taken with studio flash and LV based focusing so I don't really see the probability for random effects. I enclose an unsharpened image.

The file is here: http://echophoto.dnsalias.net/ekr/images/20111019-_DSC1394.dng

Erik,

I downloaded your DNG and rendered in ACR with default settings and repeated my measurements and obtained 96% of Nyquist. I don't think that you can do much better.

On looking at the metadata, I see you have GPS enabled. Very cool. Is this facility built into the camera or are you using an addon? Googleearth gave the following image. Is it accurate?

Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 19, 2011, 06:11:41 pm
The A55 has built in GPS.
Title: Re: Resolution and alaising challenge
Post by: ErikKaffehr on October 19, 2011, 06:30:59 pm
Hi,

Yes and no. It's probably the coordinates were I used the camera last time outdoor.

I seldom use my Alpha 55, most pictures are taken with the Alpha 900. But I use Alpha 55 for long telephoto work where I need LV for critical focus.

The Alpha 55 has GPS built in but the Alpha 900 has not.

Best regards
Erik


Erik,

I downloaded your DNG and rendered in ACR with default settings and repeated my measurements and obtained 96% of Nyquist. I don't think that you can do much better.

On looking at the metadata, I see you have GPS enabled. Very cool. Is this facility built into the camera or are you using an addon? Googleearth gave the following image. Is it accurate?


Title: Re: Resolution and alaising challenge
Post by: Wayne Fox on October 20, 2011, 04:07:44 am
It would be interesting to see the results of similar tests with cameras lacking a low-pass filter, but thus far no one has stepped up to the plate. Users of those cameras do not appear to be interested in technical analysis or perhaps they are afraid of what such an analysis would show.


mmmm ... insulting us is certainly a good way to encourage us to do it.  Seeing how this has only been up a couple of days I'm not sure what you expected.

Honestly while this kind of stuff interests me and I enjoy the techie types here on LuLa and read quite a bit of the stuff, it's over my head and I have no interest in spending the effort so it isn't over my head,  and not to sound condescending but I am pretty busy every day out shooting stuff I enjoy.  Maybe when the fall colors fade and winter boredom hits hard in my curiosity will kick in and I'll give it a go, but then I'm sure I'd screw it up anyway since I have no clue what I"m doing.
Title: Re: Resolution and alaising challenge
Post by: Bart_van_der_Wolf on October 20, 2011, 06:24:45 am
mmmm ... insulting us is certainly a good way to encourage us to do it.  Seeing how this has only been up a couple of days I'm not sure what you expected.

Honestly while this kind of stuff interests me and I enjoy the techie types here on LuLa and read quite a bit of the stuff, it's over my head and I have no interest in spending the effort so it isn't over my head,  and not to sound condescending but I am pretty busy every day out shooting stuff I enjoy.  Maybe when the fall colors fade and winter boredom hits hard in my curiosity will kick in and I'll give it a go, but then I'm sure I'd screw it up anyway since I have no clue what I"m doing.

Hi Wayne,

The worst that could happen is that you might learn something about your tools you didn't know already, or get a confirmation that there is nothing to worry about. It's so simple to execute, print the target (@600/720 PPI) and shoot an image of it, that shouldn't intimidate the average photographer, and especially not you.

I recently could help a fellow photographer who purchased a new lens, and he wanted to know if it was a good copy. One typically searches for clues of decentering because uneven performance over the focus plane can be very disturbing (and hard to correct in postprocessing). His first copy showed an issue, especially in the bottom right hand corner, and his second copy was much better (top left hand corner was only slightly less than the other corners, well within expectations). He is now very happy and confident with his lens, and he quantifiably knows what to expect compared to his other lenses (when switching from zoom to fixed focal length makes sense).

Bill was perhaps a bit enthousiastic, and surprised there was seemingly no response, but time constraints are a common issue. Take your time, it would be nice to get some feedback over time with regards to different camera models and lenses. The expectation is that many systems will be able to resolve close to maximum (Nyquist frequency), and that occasional lens issues will be revealed.

The fact that in practice so many Bayer CFA camera systems resolve luminance so well (>90% of maximum/Nyquist), while many quote figures of 70% of Nyquist, is already interesting to know. Chroma resolution will be worse than luminance resolution, but that's somewhat similar to our eyes. Also the effect of an AA-filter is perhaps not as detrimental as some are led to believe. A question that remains to be resolved/demonstrated is how much of a difference does a MFDB without AA-filter (due to cost) make?

By processing a single Raw file with a capture of the target with different Raw converters, one can also reveal useful differences. The current ACR/LR Raw converter e.g. has narrowed the gap with Capture One considerably for my 1Ds3 files. That could be an interesting thing to know when making a workflow choice or considering a switch. Ease of use is one thing, but quality may be another.

It would be nice if people share their findings. It's not a contest, but an attempt to build some more practically founded collective knowledge of how our tools of the trade perform. It also doesn't hurt to improve some of the equipment comparisons we've seen of late, with more objective measurements but without the need to dedicate a test wall or fixed setup to do it.

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: Cem on October 20, 2011, 09:40:23 am
Hi,

...I recently could help a fellow photographer who purchased a new lens, and he wanted to know if it was a good copy. One typically searches for clues of decentering because uneven performance over the focus plane can be very disturbing (and hard to correct in postprocessing). His first copy showed an issue, especially in the bottom right hand corner, and his second copy was much better (top left hand corner was only slightly less than the other corners, well within expectations). He is now very happy and confident with his lens, and he quantifiably knows what to expect compared to his other lenses (when switching from zoom to fixed focal length makes sense)...

First of all, a belated hello to all of you. I have been reading the forums regularly for some 6 years but I haven't had the chance to actively participate till now. I am the "fellow photographer" Bart was referring to above.

As he mentioned, I have recently bought an EF 70-200L f4 IS zoom lens for my Canon 5D MkII body. I had the possibility to exchange the lens within 8 days so naturally I have set out to test it as best as I could. Bart's resolution target has helped me in achieving this quickly. Looking at the results, the 1st copy seemed to have an issue in the bottom right hand corner. I have exchanged it for another copy and retested. This one was a better performer and I have kept it. Obviously, I have also taken real life pictures to test the lens in the field. But the aberration I have discovered in the 1st lens would probably have gone unnoticed that way.

The pictures were taken with the camera on a tripod, using mirror lock up and contrast focusing in live view. At first, I have used the 2sec timer but the resulting images have indicated that this was not long enough to get rid of the residual shaking. I have then switched to using the remote control and the 10sec timer.

I took pictures of the target at the center of the frame and also at the 4 corners. The target was taped to a window pane and the camera was set up at a distance of around 25x of the focal length used. The lens axis was set to be as perpendicular as possible to the target plane since I was also testing the corner performance. I wanted to be able to see whether the distortions in the corners would be symmetrical or not. For all pictures, I have left the camera fixed on the tripod and have moved the target around instead. This has been repeated using 4 main focal lengths (70mm, 100mm, 135mm and 200mm).

Besides using the resolution target for identifying the possible aberrations, I have also taken shots at various apertures from f4 to f22. This has helped me experimentally identify the aperture at which diffraction became an issue and how much of it I could normally tolerate.

Below is one of the center of the frame test pictures. Exposure details are: 5D Mk II, EF 70-200L f4 IS, 200mm, f6.3, 1/13s, ISO 100. Let me point out that the target has a serious color shift since the old Canon printed I have used to print it would not play ball. But talking to Bart on this, we have concluded that it would not be a problem for the test and I have left it at that. The conversion from raw is done in LR3, using all neutral settings. No sharpening, no noise reduction, no lens corrections, no clarity. The image was then taken into PS where I have added the 92 pixel Nyquist limit circle as a layer.

Full image at 100%:
(http://cem.usakligil.com/img/f/l/cu_200mm_f6.3_1_13s_iso100.png)


Cropped image when zoomed in at 300% (not a real/permanent resizing, this was just screen captured from PS):
(http://cem.usakligil.com/img/f/l/cu_200mm_f6.3_1_13s_iso100_300pct_screencapture.png)


Cropped image when zoomed in at 300%, including the 92 pixel Nyquist limit circle (not a real/permanent resizing, this was just screen captured from PS):
(http://cem.usakligil.com/img/f/l/cu_200mm_f6.3_1_13s_iso100_300pct_screencapture_nyquist_circle_92px.png)







Title: Re: Resolution and alaising challenge
Post by: bjanes on October 20, 2011, 11:52:17 am
First of all, a belated hello to all of you. I have been reading the forums regularly for some 6 years but I haven't had the chance to actively participate till now. I am the "fellow photographer" Bart was referring to above.

As he mentioned, I have recently bought an EF 70-200L f4 IS zoom lens for my Canon 5D MkII body. I had the possibility to exchange the lens within 8 days so naturally I have set out to test it as best as I could. Bart's resolution target has helped me in achieving this quickly. Looking at the results, the 1st copy seemed to have an issue in the bottom right hand corner. I have exchanged it for another copy and retested. This one was a better performer and I have kept it. Obviously, I have also taken real life pictures to test the lens in the field. But the aberration I have discovered in the 1st lens would probably have gone unnoticed that way.

Besides using the resolution target for identifying the possible aberrations, I have also taken shots at various apertures from f4 to f22. This has helped me experimentally identify the aperture at which diffraction became an issue and how much of it I could normally tolerate.

..where I have added the 92 pixel Nyquist limit circle as a layer.

Cem,

A good illustration of the utility of Bart's target. A nice feature of the method is that the object distance is not important. For reasons I don't understand, it seems as if the Nyquist limit is always at 92 pixels, regardless of the pixel pitch of the sensor. Perhaps Bart can explain.

The importance of this fact is that one does not have to go through the equations Bart posted if one does not need the actual resolution in cycles/mm. One can simply measure the blur diameter.

The effect of demosaicing is of interest. I used Iris to demosaic my original image, white balanced on the white area of the target, and multiplied the pixel values by 4 to convert from 14 bits to 16 bits/pixel and saved as a TIFF. No gamma correction was applied, so the gamma is 1.0. The result is shown. Much more color aliasing is evident. The blur circle is best identified by looking for the phase change as Bart commented above.

Regards,

Bill

Title: Re: Resolution and aliasing challenge
Post by: Bart_van_der_Wolf on October 20, 2011, 06:13:57 pm
A good illustration of the utility of Bart's target. A nice feature of the method is that the object distance is not important.

Yes, this is deliberate. One of the easiest mistakes to make is to shoot targets that are sensitive to shooting distance (=magnification) at the wrong distance. Besides, it is not always clear how to measure that distance when setting up for a test. Do we need to measure from the film/sensor plane, or from the front of the lens (and where, entrance pupil, nodal point, filter threads, etc.). We can only figure out the actual resulting magnification after shooting, by measuring the size of the target on the sensor (microscope on film, or pixels times sensel pitch for digicams or scanners) divided by the size of the original. When there are fixed markings on the target, then we need to re-adjust the focusing distance iteratively to arrive at the intended magnification. This is such boring work that most either skip this calibration step of don't do the test in the first place.

Quote
For reasons I don't understand, it seems as if the Nyquist limit is always at 92 pixels, regardless of the pixel pitch of the sensor. Perhaps Bart can explain.

I'll give it a try. At any diameter, the target always has 144 full cycles per circumference. The only thing that changes with distance is the magnification factor. Well, some lenses perform a bit better at some distance than at others, but in the suggested range of 25x to 50x focal length the differences are not likely to be significant.

We can know how high the spatial frequency is along the circumference at any given diameter, the circumference of a circle is 2 x Pi x radius (or Pi x diameter), and there are always 144 cycles at that circumference. So by dividing 144 cycles by the circumference we know the number of cycles per pixel. Since Nyquist is at 0.5 cycles per pixel (or 1 cycle per 2 pixels), the equation becomes 144 / (Pi x Diameter), and when the diameter is expressed in pixels we multiply by 2 to find the Nyquist frequency.

BTW, I prefer to write the formula as Cy/px = (144 / Pi) / Diameter, which is the same, but it allows to pre-calculate 144 / Pi once and change the diameter as we take different measurements. A very basic calculator suffices.

Now, as to why we also find similar values regardless of shooting distance. As shown, we can calculate the Cy/px for any diameter (and thus circumference) on the target, or a projection of it. The diameter is expressed in pixels (1 sensel or sample per output pixel), and the sampling frequency in pixels is constant for any sensor. The only thing we change with shooting distance is magnification, but the sampling density remains constant. Therefore we shoot a different radius on the target itself (e.g. larger radius at longer distance, but also with equally smaller magnification, thus with the same resulting diameter or circumference), and the frequency we can resolve per pixel remains the same. So the distance and magnification factor result in a constant projected blur diameter, although the origin is sampled at different diameters on the target. The Nyquist frequency of a sensor is always at 2 sensels per cycle, and thus remains constant between comparisons of different sensors when expressed in pixels.

Quote
The importance of this fact is that one does not have to go through the equations Bart posted if one does not need the actual resolution in cycles/mm. One can simply measure the blur diameter.

That's right, expressed in cycles/pixel, the diameter is all that's needed. Only when one wants to calculate things like magnification potential does it make sense to add the physical sensel pitch into the equation, by changing the diameter to pixels x sensel pitch in mm. When we e.g. know that our output medium can resolve 5 cycles/mm, and our optical system resolves 78 cycles/mm, then we know we can magnify our sensor size by 78/5= 15.6x to find the uncompromised maximum output dimensions, fit for reading distance inspection (5-8 cycles/mm at a normal reading distance is at the verge of human visual acuity). Larger output should be viewed at a proportionally larger distance for the same quality impression.

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 20, 2011, 11:05:56 pm
That is a good explanation. Great chart.
Title: Re: Resolution and alaising challenge
Post by: ejmartin on October 20, 2011, 11:40:27 pm
A nice feature of the method is that the object distance is not important. For reasons I don't understand, it seems as if the Nyquist limit is always at 92 pixels, regardless of the pixel pitch of the sensor. Perhaps Bart can explain.

Always useful to consider the symmetries of the situation.  In this case, the target is scale invariant -- take the central half of the image, magnify it 2x, and it looks just like the original.  Same for any other fraction 1/X and magnification factor X.  Same thing at work on the sensor -- scale the sensor uniformly down or up by any factor and the sensor's magnified/shrunk pixel array sees the same image.  So if the resolution craps out at 92 pixels on one sensor, it will do the same on any other, modulo the effects of the AA filter, lens softness, etc.
Title: Re: Resolution and aliasing challenge
Post by: bjanes on October 21, 2011, 07:49:24 am
I'll give it a try. At any diameter, the target always has 144 full cycles per circumference. The only thing that changes with distance is the magnification factor. Well, some lenses perform a bit better at some distance than at others, but in the suggested range of 25x to 50x focal length the differences are not likely to be significant.

We can know how high the spatial frequency is along the circumference at any given diameter, the circumference of a circle is 2 x Pi x radius (or Pi x diameter), and there are always 144 cycles at that circumference. So by dividing 144 cycles by the circumference we know the number of cycles per pixel. Since Nyquist is at 0.5 cycles per pixel (or 1 cycle per 2 pixels), the equation becomes 144 / (Pi x Diameter), and when the diameter is expressed in pixels we multiply by 2 to find the Nyquist frequency.

Bart,

An excellent explanation. Many thanks.

MTF at Nyquist is very low and may not be helpful for practical photography. Norman Koren (http://www.normankoren.com/Tutorials/MTF5.html) has demonstrated a way to determine MTF using the ImageJ Plot Profile function with a sinusoidal linear chart.  Unfortunately, Image J does not plot the profile for a circular path.  Do you have any way to calculate MTF from your test chart?

Regards,

Bill
Title: Re: Resolution and aliasing challenge
Post by: Bart_van_der_Wolf on October 21, 2011, 03:37:43 pm
MTF at Nyquist is very low and may not be helpful for practical photography.

Hi Bill,

That's true, but it's significantly higher with AA-filterless sensors. It's also where deconvolution sharpening can do a targeted restoration, as far as there is still some contrast available.

Quote
Norman Koren (http://www.normankoren.com/Tutorials/MTF5.html) has demonstrated a way to determine MTF using the ImageJ Plot Profile function with a sinusoidal linear chart.  Unfortunately, Image J does not plot the profile for a circular path.

There is an Oval Profile Plugin (http://rsbweb.nih.gov/ij/plugins/oval-profile.html) available for ImageJ. However, it's a lot more work to extract good data from my target than from Norman's version. One needs to get very good centering and sufficient oversampling (>576 points) and then use a copy of the list data from an "Along Oval" analysis to further process in e.g. MS Excel. A quick impression follows from a maximum and minimum from such a dataset, and they tend to converge as they get closer to the Nyquist frequency. And that is for a single spatial frequency. The same plug-in also allows to make an 'EquiCircumference' analysis, but I'm not very confident that it does what's needed. But don't forget that also Norman's target requires calibration for meaningful output values. In fact input images of both need linearization to linear gamma space before meaningful comparisons can be made.

But then the star part of my target was not directly intended to extract an MTF. My target does allow to visualize the effects of aliasing and contrast loss much more realistically and accurately, because it covers many angles instead of one, and it stresses a Raw converter quite well. Norman has been searching for a method to quantify sensitivity for aliasing for a long time, and I've done suggestions such as a ratio of the integral of the MTF curve from 0 to Nyquist versus Nyquist to 2 x Nyquist, but a visual impression is perhaps more meaningful than a single abstract number.

Quote
Do you have any way to calculate MTF from your test chart?

Yes, there is another feature in my target that is better suited for numerical analysis (and even some nice graphs), the slanted edges. Of course Imatest software can easily deal with those.

For a very fast quick-and-dirty Edge profile plot (very useful for detecting sharpening halos) one can make a horizontal and/or vertical single pixel wide linear profile plot almost along the almost horizontal or vertical slanted edge. The profile plot is then an oversampled representation or a high contrast edge transition. When plotted along the slant, the original target has a 10x oversampled edge transition. Depending on the actual rotation of that edge versus the sensel grid the oversampling may be a bit less or a bit more, one needs to estimate the average number of pixels per phase (line) transition.

The Edge Spread Function (ESF) that resulted is the basis for an MTF. One differentiates the ESF, which becomes the Line Spread Function (LSF). One then performs a Fourier transform on the LSF, and the Modulus (=Absolute value) of that Fourier transform is the MTF. Not an exercise one wants to do without an application for the math involved.

Frankly, and while I'm used to interpreting MTFs, an ESF is already quite telling about how sharp an optic is, and whether sharpening introduced halos. Imatest also plots that in a 10% to 90% edge plot and derives a number for comparison from those percentage of response points.

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: bjanes on October 22, 2011, 11:42:24 am
There is an Oval Profile Plugin (http://rsbweb.nih.gov/ij/plugins/oval-profile.html) available for ImageJ. However, it's a lot more work to extract good data from my target than from Norman's version. One needs to get very good centering and sufficient oversampling (>576 points) and then use a copy of the list data from an "Along Oval" analysis to further process in e.g. MS Excel. A quick impression follows from a maximum and minimum from such a dataset, and they tend to converge as they get closer to the Nyquist frequency. And that is for a single spatial frequency. The same plug-in also allows to make an 'EquiCircumference' analysis, but I'm not very confident that it does what's needed. But don't forget that also Norman's target requires calibration for meaningful output values. In fact input images of both need linearization to linear gamma space before meaningful comparisons can be made.

Bart, thanks for the detailed reply. The methods you describe are beyond my expertise, and I will not attempt to use them. I have used Normans linear charts, but have not bothered to calibrate them, so I was only viewing relative resolution. Sometimes, it is nice to have a visual impression of resolution rather than using quantitative data only.

But then the star part of my target was not directly intended to extract an MTF. My target does allow to visualize the effects of aliasing and contrast loss much more realistically and accurately, because it covers many angles instead of one, and it stresses a Raw converter quite well. Norman has been searching for a method to quantify sensitivity for aliasing for a long time, and I've done suggestions such as a ratio of the integral of the MTF curve from 0 to Nyquist versus Nyquist to 2 x Nyquist, but a visual impression is perhaps more meaningful than a single abstract number.

Yes, there is another feature in my target that is better suited for numerical analysis (and even some nice graphs), the slanted edges. Of course Imatest software can easily deal with those.

Yes, I did post an Imatest analysis previously in this thread. Your comment about Norman's searching for a method to quantify aliasing is relevant to the discussion. Aliasing and over-sharpening can easily spurious resolution beyond Nyquist with Imatest. The latter can be prevented by omitting sharpening, but some sharpening is needed when the sensor utilizes a blur filter. One should avoid excessive overshoot on the edge plot, but this is subjective. Aliasing is readily observed with repeating high contrast patterns, but its effect on the usual field photographic images continued to be debated.

Regards,

Bill
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 23, 2011, 07:33:18 pm
Here is my center at 300% -attached.


Sony A55 is 4912 pixels/23.5mm 4.78um
My circle diameter was 317pixels /3 [for the 300%] or 0.5055mm

Clearly the AA filter is very weak.
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 23, 2011, 10:32:46 pm
I spent the day backing up onto a new hard-drive so I re-did this just in case the 100 was hitting the printer limits. Had to kill time.

This is with the 50mm on 1.5 crop sensor. I put in a 96pixel circle for nyquist.
Title: Re: Resolution and alaising challenge
Post by: Bart_van_der_Wolf on October 24, 2011, 07:54:53 am
Clearly the AA filter is very weak.

Hi Fine_Art,

That's useful for owners of that camera. The AA-filter is indeed very mild. However, the interesting thing is that the resulting aliasing is not all that bad, although a potential issue. Which Raw converter did you use?

The aliasing will of course rear it's ugly head when we can least use it. But armed with the knowledge about that, one always has an option to use a small enough aperture to function as an AA-filter. That's another benefit of doing tests like these, one comes to the battle prepared.

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: bjanes on October 24, 2011, 09:15:33 am
The aliasing will of course rear it's ugly head when we can least use it. But armed with the knowledge about that, one always has an option to use a small enough aperture to function as an AA-filter. That's another benefit of doing tests like these, one comes to the battle prepared.

To demonstrate the effects of diffraction on aliasing and resoluton, I shot the target at f/4 and f/32 with the D3 and my 60 f/2.8 AFS. Resolution is maximal at f/4 to f/5.6 and falls off dramatically beyond f/11 due to diffraction. At f/32, aliasing is completely eliminated. At f/4 resolution is approximately 57 cy/mm or 96% of Nyquist and at f/32 the corresponding figures are 48 cy/mm and 81% respectively. A glance at the lower frequencies shows that the contrast is markedly decreased at f/32. A useful exercise would be to plot the response at intermediate f/stops.

One can use Imatest and the slanted edge to look at MTF, which is markedly better at f/4. The MTFs may appear low, but no sharpening was used to counter the effect of the low pass filter.

Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 24, 2011, 01:58:40 pm
Hi Fine_Art,

That's useful for owners of that camera. The AA-filter is indeed very mild. However, the interesting thing is that the resulting aliasing is not all that bad, although a potential issue. Which Raw converter did you use?

The aliasing will of course rear it's ugly head when we can least use it. But armed with the knowledge about that, one always has an option to use a small enough aperture to function as an AA-filter. That's another benefit of doing tests like these, one comes to the battle prepared.

Cheers,
Bart

The top one was IDC, the software that comes with the camera. The second one was RT, all detail enhancement was turned off.
Title: Re: Resolution and alaising challenge
Post by: Guillermo Luijk on October 24, 2011, 02:14:05 pm
At f/32, aliasing is completely eliminated.

Fantastic exercise Bill, this confirms the practical usefulness of difracction as an AA filter. This can be interesting for interiors and arquitecture shooters: it they find some area of the scene where aliasing might be a problem once at home, it's worth to do some diffracted extra shooting to use in that area. I would always prefer some diffraction against straight defocusing of the area, because diffraction affects equally the entire image (so it can be used on any aliased area) and is easier to achieve (just change aperture).

At a risk of being boring, could you please show one RAW channel (dcraw -v -d -r 1 1 1 1 -4 -T file.nef + 50% nearest neighbour) of the f/32 shot in order to find out it there still exists aliasing in a single RAW channel? that would be a nice evidence of the RGGB pattern + demosaicing to be much less prone to aliasing than the individual channels.

Regards
Title: Re: Resolution and alaising challenge
Post by: bjanes on October 24, 2011, 03:07:34 pm
Fantastic exercise Bill, this confirms the practical usefulness of difracction as an AA filter. This can be interesting for interiors and arquitecture shooters: it they find some area of the scene where aliasing might be a problem once at home, it's worth to do some diffracted extra shooting to use in that area. I would always prefer some diffraction against straight defocusing of the area, because diffraction affects equally the entire image (so it can be used on any aliased area) and is easier to achieve (just change aperture).

At a risk of being boring, could you please show one RAW channel (dcraw -v -d -r 1 1 1 1 -4 -T file.nef + 50% nearest neighbour) of the f/32 shot in order to find out it there still exists aliasing in a single RAW channel? that would be a nice evidence of the RGGB pattern + demosaicing to be much less prone to aliasing than the individual channels.

Guillermo,

As requested, the ACR rendering is on the left and the  (dcraw -v -d -r 1 1 1 1 -4 -T file.nef + 50% nearest neighbour) after a levels adjustment is on the right. I converted the ACR to monochrome for the composite.

Bill

Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 24, 2011, 03:39:06 pm
Clean your sensor Bob!

I'm curious why people pay $5k for a DSLR when a $750 camera is almost hitting nyquist on a 16MP sensor?
Title: Re: Resolution and alaising challenge
Post by: Guillermo Luijk on October 24, 2011, 03:54:18 pm
As requested, the ACR rendering is on the left and the  (dcraw -v -d -r 1 1 1 1 -4 -T file.nef + 50% nearest neighbour) after a levels adjustment is on the right. I converted the ACR to monochrome for the composite.

Nice, still clearly aliased individual channels produce a zero aliased output once demosaiced. Thanks Bill.

Title: Re: Resolution and alaising challenge
Post by: Bart_van_der_Wolf on October 24, 2011, 06:32:56 pm
Nice, still clearly aliased individual channels produce a zero aliased output once demosaiced. Thanks Bill.

Hi Guillermo,

That's because the channels are not aliased. We're looking at data, not images, and the data has gaps that are yet to be filled. The aliasing you are looking at is caused by the crude downsampling (by eliminating the gaps), which will cause aliasing (also when the original doesn't have aliasing), it's the same difference. When the normal output is downsampled properly to 50%, there will be hardly any aliasing.

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 24, 2011, 07:10:01 pm
Uploaded the whole shot to the net.
http://www.sendspace.com/file/sjqf5p (http://www.sendspace.com/file/sjqf5p)

All cameras should get close to the 92 pixel limit. My blur circle @ 96 pixel dia. should be fairly standard.
Title: Re: Resolution and alaising challenge
Post by: Guillermo Luijk on October 24, 2011, 07:16:47 pm
That's because the channels are not aliased. We're looking at data, not images, and the data has gaps that are yet to be filled. The aliasing you are looking at is caused by the crude downsampling (by eliminating the gaps), which will cause aliasing (also when the original doesn't have aliasing), it's the same difference. When the normal output is downsampled properly to 50%, there will be hardly any aliasing.

I know, it's just a way to see the 4 original subsets of data as independent signals sampled at half the sampling frequency. It's the existing correlation between them that allows to apply a quite simple interpolation algorithm to build an output RGB image with half the spatial interval and no visible aliasing.

I wonder which would be the result if demosaicing some RAW dataset by previously eliminating this correlation, e.g. by zeroing the G1, G2 and R channels to see how the B channel is interpolated. In this case I assume there should persist visible aliasing in the output bluish image of your card.

Regards
Title: Re: Resolution and alaising challenge
Post by: Bart_van_der_Wolf on October 25, 2011, 04:36:21 am
I know, it's just a way to see the 4 original subsets of data as independent signals sampled at half the sampling frequency. It's the existing correlation between them that allows to apply a quite simple interpolation algorithm to build an output RGB image with half the spatial interval and no visible aliasing.

Hi Guillermo,

IMHO, there is no real correlation, since the samples are taken at distictly different positions, even if we consider them to be a 4x4 bin of samples overlapping with the next bin. I haven't tried the DCraw half output size algorithm on my target, but I assume that it also cuts corners by not doing a full demosaicing and low-pass filtering before resampling. It will also be interasting to see what happens when using the "Medium Raw"resolutions that modern cameras can produce. They are pre-cooked to some extent, and downsampled. It is possible to see how well that downsampling is implemented in the ASICs of the various brands.

If one has the goal to produce such a 50% zoom output algorithm, there is possibly a shortcut that can be found that does deliver little aliasing. Downsampling to exactly 50% can be done efficiently, because the Low-pass filter can be precalculated (even for a Lanczos windowed Sinc filter which is close to optimal), and the filter kernel values optimized for fast execution (e.g. multiples of 2, so division can be avoided and replaced by a shift operator). Maybe DCraw already does that, I haven't studied the code.

Quote
I wonder which would be the result if demosaicing some RAW dataset by previously eliminating this correlation, e.g. by zeroing the G1, G2 and R channels to see how the B channel is interpolated. In this case I assume there should persist visible aliasing in the output bluish image of your card.

I think it would not help, but one could try a quick and dirty solution by replacing the empty positions by the average of surrounding actual samples (bi-linear interpolation), and use these averages instead of the real samples. But that would still result in suboptimal results due to the lack of pre-filtering.

Cheers,
Bart
Title: Re: Resolution and alaising challenge (Ouch! Moiré!)
Post by: ErikKaffehr on October 25, 2011, 08:39:15 pm
Hi!

I just discovered a healthy amount of Moiré in one of my testshots with the Sony Alpha 55SLT, one more indication of weak OLP.


Full images and DNG from Alpha 55 and Alpha 900 are here: http://echophoto.dnsalias.net/ekr/images/Demos/ApsVsFX/


Best regards
Erik (in some need of sleep)
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 25, 2011, 09:43:43 pm
Erik,

That is definitely lightroom letting you down in the de-bayer algorithm. In RT, if I switch to one of the older de-bayer methods without changing anything else I get the same colored checkerboard on the fine lines. It is clearly inventing fake resolution in creating a grid. If it cant resolve something it should leave it grey. It's also aggressively sharpened; there is no real sign of the sine function. It looks more like a box waveform. I've never used lightroom, I would have thought from its popularity it would do a better job on detail.

If you try your IDC or RT you will get more detail back.

Having the colorchecker in the shot is a great idea BTW.
Title: Re: Resolution and alaising challenge
Post by: ErikKaffehr on October 25, 2011, 10:12:15 pm
Hi,

Sony IDC at default settings also shows moiré.

Best regards
Erik
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 25, 2011, 11:47:46 pm
I was referring to the detail in the chart, I didn't look at the cloth.
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 26, 2011, 12:07:30 am
Here is your A900 shot. It looks quite clean.
http://www.sendspace.com/file/o0was7 (http://www.sendspace.com/file/o0was7)
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 26, 2011, 12:30:22 am
Here is your A55. Again, its clean. I turned on some detail enhancement so the lines will look a bit darker. On the A900 shot i left all that stuff off to just uplaod in a few seconds. It still looks good.

http://www.sendspace.com/file/rthhgb (http://www.sendspace.com/file/rthhgb)
Title: Re: Resolution and alaising challenge
Post by: ErikKaffehr on October 26, 2011, 12:50:31 am
Hi,

Regarding the Moiré I turned sharpening all the way down to zero in LR and it was still there, but I can see absolutely no Moiré in your image processed in RT.

Best regards
Erik


Here is your A55. Again, its clean. I turned on some detail enhancement so the lines will look a bit darker. On the A900 shot i left all that stuff off to just uplaod in a few seconds. It still looks good.

http://www.sendspace.com/file/rthhgb (http://www.sendspace.com/file/rthhgb)
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 26, 2011, 01:04:13 am
Hi,

Regarding the Moiré I turned sharpening all the way down to zero in LR and it was still there, but I can see absolutely no Moiré in your image processed in RT.

Best regards
Erik



Some color was there, i had to use one of the remove false color settings. Please look at the difference in the resolution chart! Note the sine wave is still there.
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 26, 2011, 02:41:50 pm
I just made a $25 donation to Raw Therapee for the great detail. It is worth it. I should thank Emil as well.
Title: Re: Resolution and alaising challenge
Post by: ErikKaffehr on October 26, 2011, 11:47:50 pm
Hi,

Just as a side note, the image in question was not really intended for this discussion. I have posted screenshots of Bart's images from my both cameras before. This image was intended for another comparison of scanned 67 film and digital sensors. There was a question on the forum asking for the difference between full frame and APS-C and I had the arrangement still standing, so I took another shot with the SLT55.

We have seen that the SLT had weak OLP filtering, but this image has clearly shown color Moiré, something I never have seen on my DSLRs before. So I felt that this was good information. The SLT can certainly show moiré.

Regarding the table top setup, focus is actually on the red flowers, but I tried to arrange everything to be approximately in focus.

Strong sharpening was applied to both images, essentially what I would regard as optimal for this image. The SLT image was upscaled to match the the Alpha 900 image, slight sharpening was applied after scaling. So it was sharpened in two steps.

I have looked at Raw Therapy and I guess that I also made a donation (not really sure, i made several donations to different projects). Unfortunately RT and similar tools don't really fit into my workflow, so I don't see it or some other alternatives I tried as my main application. I'm pretty much aligned to parametric editing.


Best regards
Erik

Some color was there, i had to use one of the remove false color settings. Please look at the difference in the resolution chart! Note the sine wave is still there.
Title: Re: Resolution and alaising challenge
Post by: EricWHiss on October 27, 2011, 01:17:02 am
Well, this is an interesting thread - thanks to Bart for creating the chart. 

I've just printed the chart and spent a few minutes shooting with it and my AFi-ii 12.   I'm getting just over 100 pixels blur diameter with the 5.2 micron spacing on the 80mp dalsa sensor but I haven't had a chance to really check my focus and this is with a longish 8 sec exposure in my dark office.  Shooting the 130mm chart at about 8 feet with a 90mm lens and it doesn't seem to matter what aperture same result f/4 through f/8.   
Title: Re: Resolution and alaising challenge
Post by: Bart_van_der_Wolf on October 27, 2011, 05:02:47 am
Well, this is an interesting thread - thanks to Bart for creating the chart.

Hi Eric,

You're welcome. I agree that apparently the target has helped a bit already to gain more insight in some effects that the total imaging chain can produce. It's due to the target that one can much easier drill down to the cause of things. I know that quite a few people have an allergic reaction to synthetic targets, and they prefer real life subjects to test on (and then there are those that say, get a life - start making pictures instead of shooting targets). But IMHO it is only a useful exercise if one can draw conclusions from the test that help us identify issues, that in turn hopefully can be resolved. It allows us to hone our technique.

The target gets as close to a real life object as possible (all sorts of spatial frequencies in all sorts of directions), but is also abstract enough (luminosity only, repetitive/predictable patterns allows to spot deviations, and it ilustrates loss of contrast with increasing resolution) to allow quantification for comparisons. Even the Raw Converter is challenged as is our sharpening strategy.

Quote
I've just printed the chart and spent a few minutes shooting with it and my AFi-ii 12.   I'm getting just over 100 pixels blur diameter with the 5.2 micron spacing on the 80mp dalsa sensor but I haven't had a chance to really check my focus and this is with a longish 8 sec exposure in my dark office.  Shooting the 130mm chart at about 8 feet with a 90mm lens and it doesn't seem to matter what aperture same result f/4 through f/8.

Something close to 100 pixels seems fine for an MF system, but focus will prove to be more critical than we tend to believe. Digital sensors keep a pretty good MTF/contast all the way to their limiting resolution, but defocus will quickly kill that contrast. Defocus is also a much more efficient Low-pass filter than diffraction. I'd expect little influence from diffraction at f/4 and f/5.6, because the diffraction pattern diameter is smaller than approx. 1.5 x sensel pitch, so the only difference is from residual lens aberrations that get eliminated, if present. From f/5.6 and narrower you'd see a gradual loss of micro detail contrast due to diffraction, but to a certain extent it's restorable with deconvolution sharpening (as long as noise is kept low, a lot can be recovered). It will be interesting to see how well the aliasing is handled between the optical system and the Raw converter.

I think that the target will also serve to improve the quality and predictability of our estimates of DOF, or rather a more realistic assumption of the COC, and enlargeability vs viewing distance of our images.

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: hjulenissen on October 27, 2011, 04:41:01 pm
I did this test for my 7D and a few lenses:
50mm f/1.8 II
85mm f/1.8
17-55mm f/2.8 @55mm
70-200mm f/4.0L IS @116mm
100mm f/2.8 USM Macro

All lenses had a minimum of two shots at: maximum aperture, f/5.6 and f/7.1.

Did the test at a distance of ca 4 meters (5-6 for the telezoom) centered slightly below sensor. Using Liveview, manual focusing at 10x zoom.

Developed using my standard settings in Lightroom, WB against paper white, exposure compensated so as to nearly clip white, no NR.

I am a bit unsure how to interpret the results and how to share them. Cropped 1:1 TIF exports are ~2.6MB and there are 15 or so files.

-h
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 27, 2011, 05:08:27 pm
Highest quality jpgs shouldn't lose anything. Did you add (to the tiff) a 1 pixel wide circle of where you think it blurs out? Then save the center as jpg crop.
Title: Re: Resolution and alaising challenge
Post by: Bart_van_der_Wolf on October 27, 2011, 07:11:53 pm
I am a bit unsure how to interpret the results and how to share them. Cropped 1:1 TIF exports are ~2.6MB and there are 15 or so files.

You typically want to compare the, let's say 200x200 pixel, center crops of the 'stars'. There you look for asymmetry of the blur in the center. As suggested, a high quality JPEG is suffcient for sharing. Interpretation becomes much easier when you add a concentric circle of 92 pixels over the center of the star (e.g. in Photoshop I make a separate transparent layer with only a circle, by adding a stroke to a circular selection, and copy that layer to other files).

When there is no asymmetry, then there is no issue and you can measure the number of pixels diameter of the central blur spot. The smaller the blur spot is, the higher the resolution. It takes only a little defocus to increase the blur spot diameter. When approaching the center from the outside, there comes a point (the resolution limit) that the light/dark contrast becomes medium gray (or multicolored, or gets a maze like structure) and sometimes you see that the lines switch places (change phase), and ultimately they deviate from their straight path as hyperboles (= aliasing). Inside the 92 pixel circle there can only be aliased information, even though it sometimes looks like the original data.

In a regular grid, it is common that the diagonal resolution is up to 30% higher than the horizontal/vertical resolution, except for some Fuji cameras that have a rotated sensor grid.

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: hjulenissen on October 30, 2011, 04:08:26 pm
Camera: Canon EOS 7D
ISO speed: 100
Shutter: 1/1.3 sec
Aperture: f/7.0
Focal length: 116.0 mm
Lense: Canon 70-200mm f/4.0L IS

Image read using dcraw with no demosaic, no gamma, 16 bits:
>>dcraw -D -4 -T IMG_4315-1.CR2

Applied black-point/white-point assuming flat spectrum. Estimated circle centrum manually and drew a circle around it at 92 pixel diameter. Included images are a central crop and a scaled-down version of the entire image. It is evident now that i had uneven lighting (light source at lower left).

Kind of curious if the PSF can be estimated directly when you have the analytic function that generated the reference output and the sensor reading. If a good estimate of the PSF under optimally focused conditions for a given camera and a set of lenses one might speculate how its AA-filter works and how ideal images should optimally be sharpened.

-h
Title: Re: Resolution and aliasing challenge
Post by: Bart_van_der_Wolf on October 30, 2011, 08:36:24 pm
Camera: Canon EOS 7D
ISO speed: 100
Shutter: 1/1.3 sec
Aperture: f/7.0
Focal length: 116.0 mm
Lense: Canon 70-200mm f/4.0L IS

Image read using dcraw with no demosaic, no gamma, 16 bits:
>>dcraw -D -4 -T IMG_4315-1.CR2

Hi -h,

This means that the lens was used at an aperture that allows to resolve details restricted by the diffraction of a nominal f/7.1 aperture lens.

The Raw conversion settings kept the image in linear 16-bit/channel gamma space, but without white balancing.

Quote
Applied black-point/white-point assuming flat spectrum. Estimated circle centrum manually and drew a circle around it at 92 pixel diameter. Included images are a central crop and a scaled-down version of the entire image. It is evident now that i had uneven lighting (light source at lower left).

I'll assume that this black/white-point setting took care of the white balancing.

What I don't get is where the the elliptical distortion comes from. Hence, I can't comment on the suggested better than Nyquist performance.

Quote
Kind of curious if the PSF can be estimated directly when you have the analytic function that generated the reference output and the sensor reading. If a good estimate of the PSF under optimally focused conditions for a given camera and a set of lenses one might speculate how its AA-filter works and how ideal images should optimally be sharpened.

Well, you 'know' the input signal (the print of the target) and the output signal. It's possible to make a model to derive the PSF needed to accomplish that. Whether that is of any use depends on the tools one has to reconstruct the original input signal based on the PSF. An application that uses the user input of a PSF is required to use such info.

What IMHO is probably the easiest approach to derive the PSF, is by using the slanted edge features of the target, in order to approximate the horizontal/vertical Edge Spread Functions (ESFs). The slanted edges of the printed target need to be calibrated (usng the gray scale) to the (presumed linear) gamma of your image. Then one needs to model a PSF to arrive at the observed slope of the oversampled ESFs, which could lead to a 2-dimensional model of the PSF that's reasonably close to reality, assuming there is no motion blur involved.

I'm sorry that I can't reveal more explicit details (although all disclosed details were pertinent to the solution), but it took me a while to figure things out, and it resulted in a proprietary method that I probably want to patent/commercialise.

Cheers,
Bart
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 30, 2011, 09:48:34 pm
Camera: Canon EOS 7D
ISO speed: 100
Shutter: 1/1.3 sec
Aperture: f/7.0
Focal length: 116.0 mm
Lense: Canon 70-200mm f/4.0L IS

Image read using dcraw with no demosaic, no gamma, 16 bits:
>>dcraw -D -4 -T IMG_4315-1.CR2

Applied black-point/white-point assuming flat spectrum. Estimated circle centrum manually and drew a circle around it at 92 pixel diameter. Included images are a central crop and a scaled-down version of the entire image. It is evident now that i had uneven lighting (light source at lower left).

Kind of curious if the PSF can be estimated directly when you have the analytic function that generated the reference output and the sensor reading. If a good estimate of the PSF under optimally focused conditions for a given camera and a set of lenses one might speculate how its AA-filter works and how ideal images should optimally be sharpened.

-h

What is this? There is no way the blue circle is 92 pixels diameter. If you are getting clean lines all around inside of 92 pixels it is the angular equivalent of saying you are getting more than 5000 lines of resolution on a sensor 5000 pixels wide. It is nonsense, something is wrong with the test.
Title: Re: Resolution and alaising challenge
Post by: hjulenissen on October 31, 2011, 02:16:18 am
92 pixels was the radius, not diameter.my bad
Title: Re: Resolution and alaising challenge
Post by: Cem on October 31, 2011, 04:36:23 am
Hi -h,

92 pixels was the radius, not diameter.my bad
Yes indeed. The idea behind the 92 pixel diameter is that it gives roughly 288 pixels around the circumference (PI*diameter). Since the target contains 144 cycles, the Nyquist limit of 0.5 cycles per pixel would be equal to 288 pixels.

BTW, at what distance did you shoot the target? The distance should have been 25-50 times of the focal length. I would recommend shooting at around 3 meters for this focal length of 116mm. However, looking at the pixel dimensions of the target in the whole image you have posted, I have the impression that your shooting distance was much closer, is that so? I might be overlooking something of course. :)
Title: Re: Resolution and alaising challenge
Post by: hjulenissen on October 31, 2011, 05:17:45 am
Hi -h,
Yes indeed. The idea behind the 92 pixel diameter is that it gives roughly 288 pixels around the circumference (PI*diameter). Since the target contains 144 cycles, the Nyquist limit of 0.5 cycles per pixel would be equal to 288 pixels.
So in the figures I posted, one should really think of a circle at half the radius I did (that is what I have done now).
Quote
BTW, at what distance did you shoot the target? The distance should have been 25-50 times of the focal length. I would recommend shooting at around 3 meters for this focal length of 116mm. However, looking at the pixel dimensions of the target in the whole image you have posted, I have the impression that your shooting distance was much closer, is that so? I might be overlooking something of course. :)
I estimate distance to be ~3-4 meters. I do have a 1.6x crop-sensor.

-h
Title: Re: Resolution and aliasing challenge
Post by: hjulenissen on October 31, 2011, 05:24:16 am
This means that the lens was used at an aperture that allows to resolve details restricted by the diffraction of a nominal f/7.1 aperture lens.
I shot all of my lenses at f/7.1, f/5.6 and the largest aperture available. I have so far only looked into this file which was chosen because it had the most recent time-stamp :-)
Quote
The Raw conversion settings kept the image in linear 16-bit/channel gamma space, but without white balancing.

I'll assume that this black/white-point setting took care of the white balancing.
I wanted dcraw for its file-format-decoding but nothing else. Then I found a suitable "black" spot in the image, and a suitable "white" spot. I did smoothed readings of red, green1, green2 and blue in the black vs the white region, and then applied a subtraction and a division of raw bayer sensel values to stretch the channel-dependent nominal integer range from 2048 to 6600 into a nearly channel independent range from 0 to 1. Of course, there are some remaining spots where one can see remainders of the Bayer pattern, but judging from my histograms, it seems fairly ok.
Quote
What I don't get is where the the elliptical distortion comes from. Hence, I can't comment on the suggested better than Nyquist performance.
See my other posts - I got a factor of two wrong.

-h
Title: Re: Resolution and alaising challenge
Post by: hjulenissen on October 31, 2011, 03:52:18 pm
To make things clear: When I said "blackpoint" and "whitepoint", what I meant was that I made a 4-elemtent vector based on the values of red, green1, green2 and blue in manually detected "black" and "white" patches, and from that I found what to subtract and multiply the color channels with to make them span the nominal range 0...1. Due to uneven illumination some parts are slightly more. Due to specular reflections in the scotch, some parts are a lot more - I am clipping those. For instance:
rg1g2b_sub = [2187       2235      2219      2132]
rg1g2b_div =  [4491       5580      5614        2097]
out_image = (in_image - rg1g2b_sub)/rg1g2b_div

The first attachement shows one image histogram after this adjustement.

The other 3 attachements shows a crop of the central part of the test-pattern with an updated circle of 92 pixels diameter at f/4.0, f/5.6 and f/7.1. I see now that the image centre is somewhat off in the f/4 and f/5.6 images.

I think that focusing was quite difficult. Perhaps the best thing to do would be using remote control software, zooming in and stepping the focus motor one step at a time?
Title: Re: Resolution and alaising challenge
Post by: hjulenissen on October 31, 2011, 03:59:39 pm
For the heck of it, here is the f/4.0 in-camera jpeg (compare with the first crop in my previous post).
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 31, 2011, 04:30:55 pm
There is no way that is an in camera jpg either, the pixels have different sizes!
You have a magical camera than can change the dimensions of the pixels? I think not. What is it really?
Title: Re: Resolution and alaising challenge
Post by: hjulenissen on October 31, 2011, 05:16:17 pm
There is no way that is an in camera jpg either, the pixels have different sizes!
You have a magical camera than can change the dimensions of the pixels? I think not. What is it really?
Not sure what you mean, but I can assure you that I have (to the best of my abilites) provided what I claim to have provided. User error is always a possibility...

The in-camera jpeg is 5184x3456 pixels, the raw file is 5202x3464 as provided from dcraw. I crop a rectangle at the same offset from the upper left corner (1,1) of both (1145:2762, 1611:3186) (explaining the visible offset between files), render it to display at some resolution (nn resampling) and save the result as a png.

-h
Title: Re: Resolution and alaising challenge
Post by: Fine_Art on October 31, 2011, 05:38:48 pm
If you zoom in on the image there are square pixels, rectangular flat pixels and rectangular vertical pixels. I have never seen an image program do that before; I have never used decraw so I am ignorant of its abilities.