Combined AMaZE and VNG4 demosaic

No need to hurry. I’m working on a speedup for vng4 meanwhile. It’s quite slow…

1 Like

You do not have the same for XTrans sensors ? :wink: This would be magical, as it’s currently the poor man of demosaicers algorithms.
(Yes I’m interested in it, I only have XTrans caremas now, X100S, X-E3, X20)

1 Like

Not atm, but it would be possible to do use 3-pass xtrans for detailed and fast xtrans for flat regions.
I may try that later

@guilc @sguyader

Here are some screenshots from my first tests to combine 3-pass xtrans demsaic and fast xtrans demosaic.
All have the same sharpening settings applied.

First shows 3-pass at left and fast at right. 3-pass has good details and background full of ugly artifacts, while fast has horrible details but a much nicer background.
grafik

Again left 3-pass, right is the combination of 3-pass and fast
grafik

For reference left the combination of 3-pass and fast with sharpening, right without sharpening
grafik

2 Likes

Wow that’s nice ! you are too fast :wink:

It nicely reduces hatch patterns in the flat areas !
I will give a try with some high iso files too, as soon as you publish it in a branch !

Screenshots from an X-Pro1 ISO 6400 file

I applied Noise Redcuction and Impulse Noise Reduction with default settings, but no sharpening

Left 3-pass, right fast

Left 3-pass, right combination of 3-pass and fast

2 Likes

@guilc I added the new method (I called it 4-pass) with the corresponding contrast threshold adjuster to amaze_vng4 branch.

Wow, that really improves the X-Trans rendering.

1 Like

@heckflosse Ingow it looks very promising. I’ll give it a try ASAP.

1 Like

@heckflosse Ingo, I tried your new branch on several of my X-T2 files. I find the 4-pass algorithm for X-Trans very useful for high-ISO images. It doesn’t seem to make much difference on clean images, but on noisy images, it renders the noise of smooth areas much more “film-like”, by getting rid of most of the crosshatch pattern that the 3-pass algorithm introduces.

Screenshot of a 100% crop, with USM sharpening (left 3-pass, right 4-pass):

Screenshot of 300% crop, with USM sharpening (lest 3-pass, right 4-pass):

Very nice addition, many X-Trans camera users will find that useful!

3 Likes

@sguyader Sébastien, thanks for testing. For clean low-ISO images the difference is visible when sharpening heavily. Also for high-ISO images: Did you try to raise the contrast threshold slider to e.g 50 ? In my tests for high-ISO xtrans files, 20 was not enough.

Ingo, I don’t like to sharpen too much, maybe because my eye sight is not perfect and blurs my world, I don’t like to see my images too sharp!

Ragarding the contrast threshold, indeed I tried to raise it, but depending on the scene, sometimes before 50 I start to see the bad behavior of the fast-pass on sharp edges.

Look at the antenna stems below (300% crop):

On side note: I tried to see what False color suppression does, but it doesn’t play well at all with the 4-pass algorithm. Maybe it should be disabled when 4-pass is selected.

@sguyader I agree about fast being not perfect. I will take a look whether I can steal the xtrans vng code from darktable. That may be better than simple ‘fast’ code in RT :wink:

@heckflosse I tried pushing USM sharpening on a clean 200 ISO file, and indeed the 4-pass algorithm allows for pushing it further (I tried 0.50 radius, 1000 amount). However, the advantage is there only when you don’t downsize the images too much (or if you crop significantly inside the image). If I resize to HD resolution, I don’t see much difference between 3-pass and 4-pass.

I just merged Amaze+VNG4 and xtrans 4-pass into dev

6 Likes

@heckflosse I’m getting this error trying to build on mac/clang-mp 3.9.

/Users/tune/repo-rt/rtengine/pixelshift.cc:326:129: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::LMMSE' is not a member of class
      'RAWParams::BayerSensor'
                if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(bayerParams.PSDemosaicMethod::LMMSE)) {
                                                                                                              ~~~~~~~~~~~~~~~~~~^
/Users/tune/repo-rt/rtengine/pixelshift.cc:328:136: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4' is not a member of class
      'RAWParams::BayerSensor'
                } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(bayerParams.PSDemosaicMethod::AMAZEVNG4)) {
                                                                                                                     ~~~~~~~~~~~~~~~~~~^
/Users/tune/repo-rt/rtengine/pixelshift.cc:338:133: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::LMMSE' is not a member of class
      'RAWParams::BayerSensor'
                    if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(bayerParams.PSDemosaicMethod::LMMSE)) {
                                                                                                                  ~~~~~~~~~~~~~~~~~~^
/Users/tune/repo-rt/rtengine/pixelshift.cc:340:140: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4' is not a member of class
      'RAWParams::BayerSensor'
                    } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(bayerParams.PSDemosaicMethod::AMAZEVNG4)) {
                                                                                                                         ~~~~~~~~~~~~~~~~~~^
/Users/tune/repo-rt/rtengine/pixelshift.cc:365:129: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::LMMSE' is not a member of class
      'RAWParams::BayerSensor'
                if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(bayerParams.PSDemosaicMethod::LMMSE)) {
                                                                                                              ~~~~~~~~~~~~~~~~~~^
/Users/tune/repo-rt/rtengine/pixelshift.cc:367:136: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZEVNG4' is not a member of class
      'RAWParams::BayerSensor'
                } else if (bayerParams.pixelShiftDemosaicMethod == bayerParams.getPSDemosaicMethodString(bayerParams.PSDemosaicMethod::AMAZEVNG4)) {
                                                                                                                     ~~~~~~~~~~~~~~~~~~^

@HIRAM Fix pushed. Thanks for reporting.

@heckflosse Thanks for fixing! Just a bit further into the build comes a similar error:

/Users/tune/repo-rt/rtengine/procparams.cc:4714:144: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::LMMSE' is not a member of class
      'rtengine::procparams::RAWParams::BayerSensor'
                        raw.bayersensor.pixelShiftDemosaicMethod = raw.bayersensor.getPSDemosaicMethodString(raw.bayersensor.PSDemosaicMethod::LMMSE);
                                                                                                                             ~~~~~~~~~~~~~~~~~~^
/Users/tune/repo-rt/rtengine/procparams.cc:4716:144: error: 'rtengine::procparams::RAWParams::BayerSensor::PSDemosaicMethod::AMAZE' is not a member of class
      'rtengine::procparams::RAWParams::BayerSensor'
                        raw.bayersensor.pixelShiftDemosaicMethod = raw.bayersensor.getPSDemosaicMethodString(raw.bayersensor.PSDemosaicMethod::AMAZE);
                                                                                                                             ~~~~~~~~~~~~~~~~~~^

Fixed.

Compiles fine on Manjaro Linux.

1 Like