Moire with high noise

Just bear with me a little; my final question comes at the end but I thought it was worth explaining my thought process for this problem first as it may clarify where I’m coming from. I was working on a RAW when I noticed heavy moire coming through in the image. Did some digging and found that it may be caused by a combination of noise and lens correction, which sort of makes sense but I am not so sure how exactly it works. I did confirm that not applying lens correction completely removes the moire.

My default demosaic algorithm is LMMSE, which I’ve read works well with fine details, but this also means that the algorithm works better with higher frequency details across an image, and I suspect that this may be the reason that it is unnecessarily amplifying noise and causing the moire. Testing with AmaZe + VNG4 and playing with the dual threshold setting seems to confirm this. This is somewhat counterintuitive to the advice on the DT documentation which states that LMMSE works best with higher ISO.

The reason I am posting this topic is because I am unsure of what method exactly I should use to deal with such forms of moire. Are there any particular settings in denoising or the lens correction itself that I may use to better correct such artifacts before changing my demosaic algorithm? And does it even make sense for me to change the demosaic algorithm? Also, a disclaimer that I left the sharpen module on as I am trying to find ways to make some leeway for me to still use it in high noise situations. Do let me know if this is also a bad idea or unnecessary.

ILCE-5100_DSC07577.ARW (23.8 MB)

Also have 2 additional questions:

  1. Is the lensfun library generally better than using embedded metadata in the lens correction module?
  2. Is astrophoto denoise a better option for lowlight photography, compared to a profiled denoise?

I cannot answer your questions regarding lens correction. I’ve also been baffled by LMMSE being recommended for noisy photos, for me it never worked for that purpose. As I usually just export 2048px x 2048px, the demosaicing algos hardly make a difference.

As you did not licence the raw file, I’m not posting a processed result, but I’m attaching an XMP, which contains my attempt at denoising. You can try the different lens correction modes.
ILCE-5100_DSC07577.ARW.xmp (16.0 KB)

I also checked the image in ART, which used RCD as the demosaicer, Capture Sharpening was off, Noise Reduction was automatically set to Aggressive.

Hi there @kofa, really great to hear from you again :slight_smile: Thanks for helping me out the last time with highlight reconstruction too!

Great to hear it’s not just me who’s confused about the demosaicing algos. Also had a look at your XMP and noticed you used the diffuse or sharpen module instead of the simpler sharpen, and went pretty heavy on the denoise module, so I take it that the sharpen module really isn’t worth it in such cases. Perhaps I’ll have a look at diffuse and sharpen when I have more time. Thanks for now!

You could also try sharpen. The only ‘trick’ I did was creating two instances of denoise, one with very heavy-handed settings, masked for the dark areas and for low detail levels, so brighter areas with details would be spared; then I used the inverse of that mask in the sharpening step to avoid increasing the noise.

2 Likes

Curiously, I can’t seem to get the pattern to be as obvious as in your examples. It’s still there, though. Can you share the xmp?

It’s caused by how the pixels are moved around by the lens correction, and changing the method just changes the direction of the pattern a bit, so not much you can do there. As for demosaic method, RCD clearly works better than LMMSE.

I don’t believe one is better than the other. It really depends.

For third-party lenses, you may have an advantage with the embedded metadata provided by the lens: lens identification by lensfun/exiv2/exiftool can easily go wrong, in which case lensfun will use wrong parameters.

If you have the correct lens identified in lensfun, I wouldn’t expect any significant differences.


As for the moiré pattern, I’d be surprised if it were caused by any of the processing modules:
moiré appears when you have two grids with slightly different spacings. The processing shouldn’t cause a grid to appear. But cameras can have patterned noise, and combining that with a subsampling as was done by OP (the two posted images are of different sizes, both smaller than full size) gives you the two grids to cause moiré.

I can produce a vague pattern occasionally, but there’s also some pattern visible in the noise in the sky at 100%, independant of denoising, lens correction, or demosaic method. So I think what happens is that there’s some patterning in the sky in the original data, and some particular combination of processing and export size can make it particularly visible.
But it’s likely that that same combination of processing and export size will not show a pattern for a different camera type

Here is my screen shot and xmp file. My approach to sharpening and denoising is explained within this post What does diffuse or sharpen really do? - #100 by mbs

ILCE-5100_DSC07577.ARW.xmp (16.2 KB)

Hey there, thanks for the reply though haven’t been on here in a while. Perhaps a physical fault of the lens or sensor itself then?

Much appreciated @Terry !

Just wondering; what’s some key differences between various demosaic methods (i.e. RCD and LMMSE) ? Also just to confirm my understanding, these all serve to interpolate pixel values across the RGB channels due to the presence of various coloured pixels at different positions in the sensor yes? Apologies for the super late reply, been busy with school :sweat_smile:

@Donatzsky is correct. The pattern is due to lens correction shifting pixels around. Here is an example, of applying a lens correction to noise, with the pattern enhanced.

What is happening is in some places the lens correction needs to shift pixels by fractions of a whole pixel and in other places pixels are not shifted or shifted by whole pixels. When pixels are shifted by a fraction of a pixel, the result is a slight smoothing, which reduces noise. When pixels are not shifted, or shifted by whole pixels there is no smoothing.

The result is noise is smoothed out in a pattern, such as the one you can see.

The solution to an obvious pattern is to reduce the noise. Some demosiacers have less obvious noise than others, so that is an option, but selective application of noise reduction and sharpening (or not sharpening) is your best bet.

3 Likes

The following articles explain it better than I could:

https://www.cambridgeincolour.com/tutorials/camera-sensors.htm

1 Like