How to choose a demosaicing algorithm

Yeah, you found one of the possible problems.

Otherwise i personally have a few simple rules (btw i ported two of the demosaicers to dt, rcd with a lot of help by @heckflosse and LMMSE using rt code as a base but faster due to internal tiling)

  1. For Moire patterns, AMaZE and LMMSE are often better (unfortunately both are CPU only yet)
  2. VNG4 and PPG are inferior to the rest, VNG4 often flattens details and sometimes introduces a color cast and PPG tends to overshoot at edges or high-contrasty regions)
  3. Use RCD in most cases (as it’s much faster than AMaZE at equal quality), for very high ISO images (depending on the noise floor of your camera) use LMMSE
4 Likes

Have you an example please? (quizzical face)

God forbid you read the docs where it is explained… darktable 3.8 user manual - demosaic

1 Like

On the topic of demosaicing, is there any change there’ll be new ones investigated for the x-trans filter? I personally don’t see the point, but someone might’ve read or seen some rumours around. Not complaining or being under appreciative as I am very grateful that there’s markesteijn and a few others that work very well, and after all, it’s the users choice to get into a system with such a proprietary mosaic.

The research is often done by people in academia, who then publish a paper. That paper is picked up by some FOSS Dev and implemented. Maybe searching Arvix or another academic database will yield something.

I think the available demoasicer for xtrans is quite good. What do you notice are its shortcomings?

I wrote about it somewhere. Let me see: Perspective correction - #2 by afre. However, there isn’t that much information there. I am sure this happened to me another time and I wrote about that too. No one followed up with my GitHub issue.

Anyway, little differences can affect how algorithms respond.

2 Likes

Thanks, I didn’t know about Arvix, will give it a look. I didn’t explain myself properly but my idea was that as it’s not used in any other cameras, be it for photography or scientific instruments, there’s not many motivation to research on it, like Bayer has with all kinds of different algorithms for different scenarios.

I think the available demoasicer for xtrans is quite good. What do you notice are its shortcomings?

Agree with you on there, it’s quite good and I really can’t fault it. The only thing I sometimes notice is a pattern in the noise, but that’s just pixel peeping(bad habit…) and it’ll never show up the final image.

I’ve been using denoise a half strength for my base ISO (160) RAF files

Thanks, I will give it a try. I assume it’s the wavelets auto preset with the strength at half?

Its the default.

1 Like

Perspective correction tries to detect vertical and horizontal lines, and my guess is that the choice of demosaicing algorithm may make that easier or harder, even if the demosaiced results are virtually identical to our eyes. Ctrl and/or Shift may be used to enhance edge and contrast, respectively, before detection is attempted.

The behaviour boiled down to the demosaicing method choice no matter what I tried. As a workaround, to get the best of two worlds, once the perspective is ideal from a temporary demosaicing method, one can change the method back to the preferred one.

Actually, no. rotate and perspective gives a different result for each invocation, even if the algorithm is the same:
Amaze (module reset, then re-detected structure and applied full correction):


Difference between Amaze versions (also the detected params are different):
image

PPG (same reset + redo):


Difference between PPG versions:
image

darktable 3.9.0+1319~gc969328d1

1 Like

That is strange because it was more predictable (and repeatable given the same steps taken) for me many moons ago. This then is worse than my experience, where only changing demosaicing algorithms had a significant impact.

It is great to think that in this day in age we could just analyse the image and just have something decide what is the best option and maybe we will arrive at that. Granted I have not put much effort into to this but given what little effort I have put in to looking at changes in the result of the different aligo’s just from a stand point of visual inspection…often it just looks like a different pattern of grain or noise wrt to another one …not better and not worse often. Obviously it can have wider impact on rotation and perspective calculations but I can say from some experience searching for automated ways to analyse histological sections with much simpler qualifiers, ie stained cells organelles capillaries nerves…its not that easy even with colors and distinct structures. These are large elements in the image and it is still not easy to accurately and consistently isolate, segment and quantify…

Where would one begin to define qualifiers for an automated analysis of “better” and what would that be?? I have seen some analysis of these types that use some sort of RMS statistics but what would be measured and compared…I am not being in anyway sarcastic just curious…

1 Like

This garnered more interest than I anticipated. The point is that the choice of algorithms and other things earlier in the pipe influences what happens afterwards. This is well known and should be taken into account when making decisions about the workflow.

I use fuji & x-trans iii.

The problem with DT is that it selects markestejin 1 pass instead of the markestejin 3 pass. I see a difference, so each time I have to go and change it.

I realize that they chose the 1 pass to make DT run faster but when dealing with colours (calibration & and balance rgb…) it makes a difference.

Thanks

1 Like

Curious…any change these settings interact with the demosaicing to contribute to any of this??

Just curious

image

You can create an auto-applied preset.

2 Likes

Y’know, took me a couple of days to connect the dots, but RawTherapee’s dual demosaic options do precisely what you posit…

https://rawpedia.rawtherapee.com/Demosaicing#Dual_Demosaic

3 Likes