So, after a couple of test days:
- decorrelation works best when both Red and IR channels are in Logarithmic domain. Converting liniar Reds and IRs to log domain provided best results for me.
- Olma, it seems, that IR channel in your files is already logarithmic
- Barriers: some sources even in Log domain has non-liniar correlation.
- In case of liniar correlation, Red values can be “aligned” to IR channel, based on simple liniar regression
- Difference between two regression techniques - #5 by olma
- Barriers: when source is too dirty, mean level can be affected by IR exessive signal (threshold to IR, eliminating “defect” signal can help)
- prepared Red channel is substructed from IR
- then values are returned to liniar (by exp(x)) in case of liniar color space workflow (my case)
- liniar [R], [G], [B] channels are divided by decorrelated liniar IR
- it restores luminance in some dirty but still transparent areas
- Barrier: although luminance is restored, regions are still slightly visible due to less noise (film grain ?) versus neigbouring areas
- IR channel (and RGB channels if used) then copied for credibility map generation and made less detailed to average out the noise
- I used blur 2-4
- Credibility map is built
- I’m still not sure about optimal combinations of contrast / bilateral / deviation functions and IR/Visible sources)
- information regarding Credibility maps can be found in HP article in previous posts
- Credibility weighted algorythm is applied to IR low-detail channel to generate the mask
- Thresshold is applied to generate the final mask
- inpaint_pde is applied to hires image with generated mask
Quality still loses to original Nikon ICE, however now the result is much closer.
Main challenges for me now:
- non-liniar IR-visible channels crosstalk (top priority)
- Mean transfer curve doesn’t work. Probaly some transformational 4x4 RGBI matrix/function should be calculated / applied.
- grain / noise in restored areas (step 5 above), which were not covered by inpaint mask