-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libhb: Initial implementation of Deskeeter filter. #1872
base: master
Are you sure you want to change the base?
Conversation
Removes mosquito noise from video.
@jstebbins I suspect there is either a bug in my code or in the new alignment/stride code, as there are some artifacts present depending on the settings. Try |
Some screenshots: At the moment the algorithm still seems too much like a generalized low pass, so it's mostly useful on animation and low resolution analog sources without much true high frequency information. It could probably be improved to only filter areas near edges, and possibly add more logic to better preserve or reconstruct strong edges themselves. And of course, a better denoising algorithm would likely improve the overall quality. |
copying pixels on borders results in "edge" between copied pixels and computed "high frequency" values. This edge caused the artefacts. Make "copied" pixels roughtly the same value range a computed "high frequency" values.
Allow using values in the left margin up to half the stride border.
strength_scaled was 0 whenever src pix was less than 64
I "fixed" the artefacts and a few other issues. The artefacts are gone, but I'm uncertain of the math that's going on. I just made the numbers work 😉 |
Thanks. I realized I forgot to free tmp but never pushed a fix. |
What really needs to happen is edge detection and only filter near edges. |
Off / Strong+None / Strong+Skip The dark outlines are aliased now, either because the filtering is occurring on the edges or fixing the integer value clipping made things worse, despite being mathematically correct. Still a lot of mosquito noise with tune none; I'm not sure the radius around the edges is wide enough. Looks better with tune skip. |
So exactly what pixels would you like the filter to be applied to. You said the black outline is aliased so I assume you would like to avoid touching black outlines. The white highlight on the pillar is also being aliased (as would white outlines if there were any). I'm thinking maybe what you are looking for is to avoid touching thin line features. How do you want to treat edges that have no outline, i.e. just a gradient from one intensity to another? |
Pixels around but not including strong borders. Image example roughly highlighting some, but not all, of the affected areas: See also: https://www.pcmag.com/encyclopedia/term/55914/mosquito-noise |
Since deskeeter needs to filter pixels around edges, construct an mask from the edge mask that excludes edge pixels and includes non-edge pixels within a configurable radius of edge pixels. Also fixes a threading problem. My mask buffers where getting shared across multiple threads. Not good.
Chroma artifacts appear where using custom settings, even simply |
Removes mosquito noise from video.
The concept is simply denoising applied to high frequency picture information. Median filter is implemented as a proof of concept and works reasonably well. Other denoise methods such as NLMeans could be implemented for higher quality, if someone is interested in wiring things up.
Test using
--deskeeter=ultralight/light/medium/strong/stronger/verystrong
.