martin-marek / hdr-plus-swift

📸Night mode on any camera. Based on HDR+.
https://burst.photo
GNU General Public License v3.0
198 stars 9 forks source link

[Feature request] Merging of images in the frequency domain #9

Closed chris-rank closed 1 year ago

chris-rank commented 1 year ago

I would suggest to perform the merging of tiles in the frequency domain as suggested in the original paper. I already have a working function for this task implemented in your app. However, it requires some additional functionality that I have not yet implemented. First initial results already show a better image quality than the current implementation. One disadvantage of my current implementation is that it would only work with Bayer patterns. As the Fourier transformation is a little bit tricky, extension to generic patterns is a lot of work. Furthermore, the 2x2 pattern can be computed using SIMD instructions in Metal, which increases performance quite a bit. I would be more than happy to contribute here.

chris-rank commented 1 year ago

In addition, there is a novel paper from Google with an improved version of the HDR+ algorithm, which uses a slightly adapted merging in the frequency domain: http://graphics.stanford.edu/papers/night-sight-sigasia19/night-sight-sigasia19.pdf

The differences to the original implementation are small, but the authors claim a significant improvement of noise reduction and motion robustness. I have already checked the formulas and it will be easy to extend the functions I already have implemented.

martin-marek commented 1 year ago

Hi Chris, That sounds great! I would be happy to help. If you have any questions, please just post them here or email me – I'll try to respond quickly.