Pages: [1]   Go Down

Author Topic: Low noise B&W conversion  (Read 3342 times)

Guillermo Luijk

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2005
    • http://www.guillermoluijk.com
Low noise B&W conversion
« on: April 10, 2017, 06:31:17 am »

After calculating the optimal RGB weights in terms of maximizing SNR when doing B&W conversion as a function of the input SNR's, I have compared the result of an optimal algorithm vs Photoshop's B&W Layer (with standard parameters):



The algorithm is quite less noisy than Photoshop's B&W layer. We must take into account however that this algorithm will not do any effort in respecting the correctness of perceptual luminance, it just focuses on SNR.


These are the optimal weights according to exposure (i.e. according to single channel RAW SNR, assuming most noise is read noise in very noisy captures):




Anyone interested can read the whole article here. Hope the English translation (top right drop-down menu) suffices:

http://www.elmomentodecisivo.com/2017/04/combinacion-optima-de-senales-para.html

http://www.elmomentodecisivo.com/2017/04/combinacion-optima-de-senales-para_9.html

Regards

« Last Edit: April 10, 2017, 07:36:24 am by Guillermo Luijk »
Logged

fdisilvestro

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1852
    • Frank Disilvestro
Re: Low noise B&W conversion
« Reply #1 on: April 10, 2017, 07:15:29 am »

Muy interesante Guillermo,

What was unexpected for me (if I understood correctly) is that the noise of the optimal combination is actually lower than any of the original signals.

One question, how big are the "regions" of the image that you use to determine the ideal factors for every channel? Is there an optimal value here (thinking that at some point you don't gain much by using smaller areas)?

Regards

Guillermo Luijk

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2005
    • http://www.guillermoluijk.com
Re: Low noise B&W conversion
« Reply #2 on: April 10, 2017, 07:30:17 am »

What was unexpected for me (if I understood correctly) is that the noise of the optimal combination is actually lower than any of the original signals.

One question, how big are the "regions" of the image that you use to determine the ideal factors for every channel? Is there an optimal value here (thinking that at some point you don't gain much by using smaller areas)?

Sometimes I speak about noise when I mean SNR. The optimal combination of two signals always provides a new signal with improved SNR over all the input signals. For instance the optimal mix of the two upper images produces the lower image. The contribution of the noisier input signal is not huge but exists (i.e. Signal 1, the noisiest one, "helps" Signal 2 to become less noisy):




I think I set a 5px gaussian blurr in determining the average signal for every channel. This was just a simple test to check how much improvement we could expect. The algorithm can be refined by fine tuning that blurring radius and specially by introducing optimium weighting in photon noise dominant áreas (the optimal weight formulas remain the same but calculating k and k' will differ). But I don't think the improvement will be gigantic over what I already achieved.

Another possible improvement I want to check is the possibility of using the highest SNR signal, but adjusting its luminance to be more perceptually correct. For instance the cockpit glass is much cleaner in the optimized mix, but it should produce a darker gray tone. By locally correcting exposure we can have the best of the two worlds (SNR and correct luminance).

Regards


« Last Edit: April 10, 2017, 07:46:23 am by Guillermo Luijk »
Logged

GrahamBy

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1813
    • Some of my photos
Re: Low noise B&W conversion
« Reply #3 on: April 10, 2017, 09:42:50 am »

Yes, this is inverse-variance weighting, which has been known at least since RA Fisher... so let's say nearly 100 years. However the component SNR's depend on the subject, the illumination and the details of the camera's filter array (which determines the correlation of the three signals: the given formula assumes they are uncorrelated).

The relevant question however is: why? I struggle to imagine when subject rendition is subsidiary to SNR...
Logged

Guillermo Luijk

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2005
    • http://www.guillermoluijk.com
Re: Low noise B&W conversion
« Reply #4 on: April 10, 2017, 11:37:50 am »

I can think of several cases:
- When noise is so much that there is no rendition unless one minimises noise
- When there is no such "correct" rendition (IR, UV applications)
- When the photographer prefers low noise rather than B&W perceptual luminance correctness (in fact in the sample image I'd go for the lower noise image)

In answer to your question why, I did it to practice processing images with R, a language I am learning. Its matrix notation makes it great to deal with images in very simple sentences.

Regards

Jack Hogan

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 798
    • Hikes -more than strolls- with my dog
Re: Low noise B&W conversion
« Reply #5 on: April 11, 2017, 03:38:33 am »

Interesting work Guillermo.  How different would this be from mapping gradients in each channel and replacing the intensity of all pixels in a neighbourhood with the intensity of the strongest channel weighted by the gradient?  And have you tried this on a raw file?

Jack
Logged

Guillermo Luijk

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2005
    • http://www.guillermoluijk.com
Re: Low noise B&W conversion
« Reply #6 on: April 12, 2017, 09:57:33 am »

Interesting work Guillermo.  How different would this be from mapping gradients in each channel and replacing the intensity of all pixels in a neighbourhood with the intensity of the strongest channel weighted by the gradient?  And have you tried this on a raw file?

If understand what you mean, prioritizing gradients would maximize microcontrast, i.e. detail. It's another choice to try.

I already did a pseudo RAW blend for B&W. Demosaicing was applied, and I don't know to which extent there is a cross channel influence in DCRAW's AHD algorithm. But I used the -r 1 1 1 1 -o 0 option (-r 1 1 1 1 means no WB scaling and -o 0 means no colour profile conversion) to keep each RGB channel as independent from the others (i.e. as RAW) as possible. It's impossible to optimally combine a white balanced and colour profiled image because of cross channel influences.

Regards
Pages: [1]   Go Up