kunzmi / ImageStackAlignator

Implementation of Google's Handheld Multi-Frame Super-Resolution algorithm (from Pixel 3 and Pixel 4 camera)
GNU General Public License v3.0
399 stars 66 forks source link

tuning parameter k2 #17

Open lyn-max opened 3 years ago

lyn-max commented 3 years ago

Hi,

  1. I'm curious that in the paper k2h = kDetail / (kShrink A), but in your implementation k2h = kDetail / kShrink A, why did you modified it?
  2. From formula derivation is [c,s]T corresponding to k1, and [s,-c]T corresponding to k2? Also, in your implementation they were reversed.

regards max

kunzmi commented 3 years ago

Hi Max,

good question, it has been a while that I was fighting with these equations ;-) I was checking for my notes from that time but I didn't find them, at least the part of interest is missing... So I have to rely on my memories:

  1. I don't remember if I had a specific mathematical reason for that or just try and error. Given that the formula for A was already wrong the following isn't really reliable. I remember though that I tried to reproduce the kernels of figure 8 in the main paper and if I didn't mess up things, the code should reproduce these kernels (whereas the kernel in the figure seems normalized, so only the shape and ratios count).
  2. yes, I changed these, otherwise your kernel is transposed. At the end the only question is, if your kernel is a row first or a column first matrix, or if you flip x and y, etc. Maybe my indexation is wrong, mayber there's, I didn't check that, all I wanted is that the kernel shown in the GUI matches the edges and that the calculations are correct, which should be the case.

Cheers, Michael

lyn-max commented 3 years ago

@kunzmi thanks for your excellent work!