Digital2Slave / KopfJBU

2007_Kopf's Joint Bilateral Upsampling.
15 stars 15 forks source link

Rescale Window #2

Open blakezim opened 7 years ago

blakezim commented 7 years ago

When defining the window size (WinSize) in main.cpp, it is defined as Imagescale*Imagescale + 1, so essentially defined from the high resolution image. When that window is used in JBU.cpp on the low resolution image, the window is not scaled down. This makes the portion of the image that is covered by the window different in the high resolution image and the low resolution image.

I was running this on some test images (lowres = 50x50 and highres 500x500) and the window then compared all of the low resolution image to a small portion of the high resolution image, which caused artifacts as the range gaussian is entirely from the high resolution image.

It was very simple to fix this issue, I just scaled the 'j' and 'i' counters (line 51 and line 62, respectively, in JBU.cpp) by 'scale' and then that brought the window down to the appropriate size in the source image while keeping the same relative window size in the high resolution image.

Can you confirm that this considered an issue? If so, please let me know if you would like me to open a pull request or if the description above is sufficient enough to implement the change.

Thanks!

Digital2Slave commented 7 years ago

Dear BlakeZim, Thanks for your issue. I'm very appreciate it. Please feel free to open a pull request.