Implementation of the NEDI (New Edge-Directed Interpolation) from Xin Li & Michael Orchard Paper
Special thanks for Parashar Krishnamachari for his Post which helped me a lot to understand the algorithm.
I tried to optimize the computation as much as possible to experiment with the possibility of implementing NEDI in realtime.
The project contrains multiple examples of the implementation, you can use your own images just make sure, after importing them, to disable the compression Unity applies by default.
You can further optimize this by applying the effect only for the edges of the image (which you can detect using multiple cheap ways) while flat surfaces can use a simple bilinear interpolation.
My main goal was to see the performance cost in realtime, it all depends on your window size.
A 480x270 frame upscaled 2 times (to became 1920x1080) with a windows size of 8 takes around 1.5ms in my RTX3060
with a windows size of 4 it takes less than 0.3ms but it introduces more noise because of the ill-conditioning of matrices.
The "Regulate" value we use to remove noise just adds a small epsilon to the diagonal of the R matrix to prevent a 0 determinant but that introduces some blur and the values gets worse with each iteration
There is an improved version of the algo iNEDI made by Nicola Asuni which produces much better results and fixes a lot of problems in the original NEDI.
- NEDI Paper
- Parashar Krishnamachari Post
- Python Implementation by Kirstihly