3 ms·
Yeah, I know about sinc and the ideal theory, but nobody uses sinc for production work. Your filter has to be too wide, and the ringing artifacts are too undesi
by dahart 9y ago
Yeah, I know about sinc and the ideal theory, but nobody uses sinc for production work. Your filter has to be too wide, and the ringing artifacts are too undesirable.
The max sharpness in a digital image, the Nyquist limit, is 1 cycle across 2 pixels. It’s not possible to get any sharper than that. But actually rendering images with frequencies exactly at that limit generally cause aliasing artifacts of some kind. That’s what I mean about getting close to Nyquist.
> Very high resolutions are now practical, too, which changes things a lot. Probably in favor of using filters which never introduce ringing artifacts, like the Gaussian.
Yeah, this is mostly true, and it is one way I justify using a Gaussian.
But it’s important to know and remember that without the right filter, you can get visible ringing artifacts no matter how high your resolution is, and no matter how much you super-sample your pixels. This doesn’t come up all that much in CG film or photography, but I have a digital art project where it matters a lot and comes up all the time. (And I order expensive prints too, where artifacts not very visible on my monitor can become plain & obvious on paper).
> And things like the Lanzos or Mitchell filters exist as compromises between since and Gaussian.
Yes, and I suspect those are the most common ones used in VFX and CG film & print production. But those are balancing sharpness and aliasing. For situations where I really need no aliasing, they aren’t good enough.
I can’t usually see the difference between Gaussian, Lanczos and Mitchell without zooming and studying high frequency regions, but I’ve watched VFX supervisors comment on the softness they feel after watching like 2 seconds of film. Some people have an incredible sensitivity to sharpness.
- brudgers 9y ago+ My understanding of the way the Nyquist limit plays out in digital photography is that it guarantees no moire. If moire isn't an issue in a scene then it is possible, but not guaranteed to get higher resolution (that of the individual pixel). Of course resolution and sharpness are not exactly the same thing...that's why a 16 mega pixels is a resolution not a sharpness and why a lot of studio photography uses cameras without anti-aliasing filters (e.g. medium format digital). In the studio, conditions can be set up to avoid moire in ways that aren't practical for sports or wedding photography. Similarly, moire isn't going to be a problem with astro-photography and some subjects in landscape photography. + For what it's worth, ringing artifacts are often caused by diffraction or lens aberrations rather than aliasing from sampling frequency (though they can be). + The shape of the modulation transfer function (MTF) is different between film and digital. The line pair comparison in the article illustrates it without being explicit. The Nyquist limit means that sharpness falls off a cliff in digital images and the example line pairs go from resolved to gray abruptly. The example line pairs for film fade to gray, what is and isn't sharp is determined by observation rather than an equation. Digital images often appear sharper because they are only ever so sharp and film appears softer because it is kinda sorta sharp beyond the point where it is clearly sharp. It's why film has a different look...or is a different artistic medium than digital when it comes to some forms of expression.
- burfog 9y agoGetting close to the Nyquist limit is unsafe. The limit is theoretical; it applies only to an infinitely repeating signal. You'd have to create and then observe an infinite signal for the Nyquist limit to be correct, but of course you can't do this. That would be 2 samples for each feature detail you want. Things work OK in the real world at about 4 or 5 samples, but it takes 10 or 12 samples to work pretty well.
- jimduk 9y agoI'm doing some amateur work on sub pixel matching at the block-level for stereo, currently using cheap APS-C prime lens commercial cameras ( Ricoh GR) and my background is maths not cameras, but what I've observed (all in RAW) is a) Real world scenes often go below the Nyquist limit ( e.g pattern from a brick wall at sufficient distance) b)In a camera without a low-pass filter (e.g. the Ricoh GR) in practice you don't see Moire but you can definitely generate it artificially off real world objects c) The Point Spread function seems quite important (e.g a 1-pixel scene feature for the GR will have half the effect on the sensor as a 2-pixel function because of the point spread) d) I'm a bit confused as why Fourier/ DCT all work as well as they do, as the Nyquist assumption for a modern digital camera seems incorrect, but on the whole sub-pixel matching in a Fourier space (while Nyquist assumption is not true) seems roughly on par with matching in the spatial domain - I would love to see something that explains why this is so Happy to discuss this more as I am still learning
- brudgers 9y agoManual of Photography might be worth reading.
- jimduk 9y agoThanks for the pointer - I've just skimmed the last 2 chapters and looks like a good book but don't think it solves my specific problem (just to give more context, when I said amateur I'm doing this for fun not money, but have previously built an image processing pipeline from raw sensor output and I get the basics of wavelets, Fourier etc ) My specific question is "If I am matching a RAW stereo block (say 8x8 or 16x16 block), for sub-pixel resolution matching from two similar cameras, why (if at all) is it better to use DCT/Fourier matching e.g. matlab normxcorr2 or the elphel guys https://blog.elphel.com/2018/01/complex-lapped-transform-bayer/ https://blog.elphel.com/2018/01/complex-lapped-transform-bay... , rather than try to match in the spatial domain (linear algebra). On writing this I suppose I better look at the H.264 and HEVC algos and see if they work in the frequency or spatial domain when they are looking at sub-pixel matches.
- theoh 9y agoI don't understand how the Gaussian can introduce ringing artifacts. It doesn't have any negative lobes. If the scene you are sampling contains arbitrarily high frequencies, there's no way to avoid aliasing, yes. But surely ringing per se is always a product of the reconstruction filter. (Fourier transforms etc. are a different matter.)
- dahart 9y ago> I don’t understand how the Gaussian can introduce ringing artifacts. It doesn’t have any negative lobes. I don’t think Gaussian can. (I hope it didnt seem like suggested that) But a box filter can alias, and it doesn’t have any negative lobes. So can Lanczos & Mitchell, but to a much lesser degree than a box filter. It’s a fun exercise to plot sin(1/x) and try to get rid of all visible aliasing. It can be surprising to see aliasing when you take 100,000 samples per pixel. > if the scene you are sampling contains arbitrary high frequencies, there’s no way to avoid aliasing. Right, yes exactly. Though Gaussian is pretty dang good, the best I’ve found personally. A lot of samples & a Gaussian that is just a tiny bit soft, and I can usually remove any signs of aliasing.
- jacobolus 9y agoGaussian always looks fuzzy, even if you are careful about it. Your personal preference might be for fuzzy-edged images, but sharper ones will look better to almost all observers, including both professional photographers and laypeople. It depends a lot on the precise details of how you handle the sharpening / resampling filtering; many available tools do a crappy job. In general the laypeople prefer images to be sharper than you would expect and don’t care much about artifacts (at least, in my experience asking people off the street to pick between two choices of images with different amounts of sharpening), whereas image experts tend to be a bit more conservative if there are noticeable artifacts, especially aliasing, etc. If you are printing photos on paper, I recommend sharpening beyond your initial inclination, and then sharpening some more, because the printing process tends to bring some fuzzies back. Note that the human visual system inherently introduces ringing artifacts even if they aren’t there in the original. There’s no inherent problem with amplifying these slightly; the visual effect if you do it subtly will be to imply more contrast than is actually available, rather than obviously appearing like an artifact. Most types of images will look better if you stretch your available contrast to the extent you can. If you allow some ringing artifacts, you can get away with less real contrast for details, giving you more room to add large-scale contrast between shapes or regions of your picture.