WolframRhodium / muvsfunc

Muonium's VapourSynth functions
75 stars 19 forks source link

DeHaloHmod (8-16 bit support) #29

Closed nobananasforyou closed 1 year ago

nobananasforyou commented 3 years ago

Hello!

Please add DeHaloHmod to musvsfunc. It's been ported to vs but I'm not sure because I wasn't able to test it on my end. The main mask is great but after testing it misses lines/spots and malfunctions in some places when called with default settings except the radius parameter, however, increasing the radius doesn't improve the mask's accuracy. After some testing, the 2016 revision is more effective compared to the latest revision. So I'm not sure if the latest revision is worth it. Also, the aforementioned masking issue is present in both. I'm hoping maybe it could be fixed/improved upon.

AVS script: src() DeHaloHmod(radius=3, maska=True)

Image Comparison: https://slow.pics/c/15GEO6GO

VS port: https://pastebin.com/2uziEgxr AVS: https://pastebin.com/raw/tA7aHtYP (2016) AVS revision: https://raw.githubusercontent.com/realfinder/AVS-Stuff/master/avs%202.5%20and%20up/DeHaloH.avsi (2021)

Kind Regards, B.

WolframRhodium commented 3 years ago

Hello.

I have skimmed through those scripts. Just like what you have said, TBilateral, Deen and other functionalities are missing in the VS version. Although similar functions present in VS, it takes time to reproduce and verify them, while I am sorry that I am busying on other projects.

IMHO, if you have tweaked your core dehaloing function carefully, a conservative mask (or even no mask at all) is enough. Or you may try other masking scheme, e.g. haf.HQDeringmod.

Best, W.

nobananasforyou commented 3 years ago

Thanks for getting back to me. Tbilateral and deen have been ported to vs. I know you're busy with other projects and that's okay so I'll just wait but if you don't agree you can close this issue. I did test haf.HQDeringmod before and I don't get the same results.

Kind Regards, B.

WolframRhodium commented 3 years ago

Thanks. Then I will port it someday.

nobananasforyou commented 3 years ago

Thank you so much. Have a good day/night!

nobananasforyou commented 3 years ago

Upon further investigation, I think I've found the problem and it's in two parts. Firstly, the generated mask is fine (most of the time except where it fails), the lines/edges highlighted by the mask in bright white are processed and the areas highlighted in dull white and grey are left unprocessed even after correctly identifying the lines/edges. I've made an image comparison for illustration: https://slow.pics/c/X6Hbz0FR Image 1 (source), Image 2 (filtered), Image 3 (mask)

Secondly, the following comparison is an example of where the mask fails to recognize edges and only filters about 5-10% of the frame leaving 90-95% of the frame untouched. https://slow.pics/c/JkIzOOZw Image 1 (source), Image 2 (filtered), Image 3 (mask)

Hope this helps.

Kind Regards, B.

realfinder commented 3 years ago

the 2016 revision is more effective compared to the latest revision. So I'm not sure if the latest revision is worth it.

AVS script: src() DeHaloHmod(radius=3, maska=True)

Image Comparison: https://slow.pics/c/15GEO6GO

VS port: https://pastebin.com/2uziEgxr AVS: https://pastebin.com/raw/tA7aHtYP (2016) AVS revision: https://raw.githubusercontent.com/realfinder/AVS-Stuff/master/avs%202.5%20and%20up/DeHaloH.avsi (2021)

you need to add 1 to radius so DeHaloHmod(radius=4, maska=True) in latest is same as DeHaloHmod(radius=3, maska=True) in 2016

edit: also make sure you use Zs_RF_Shared V1.150