Log in

View Full Version : filter to enhance the resolution


mathmax
20th April 2011, 19:16
Hello,

I would like to know if there is an avisynth filter to increase the resolution of a video using the delaunay algorithm, like described in this book:

http://books.google.com/books?id=fjTUbMnvOkgC&lpg=PP1&ots=53xYyljHPy&dq=delaunay%20superresolution&hl=fr&pg=PR11#v=onepage&q=delaunay%20superresolution&f=false

Thank you in advance for any suggestions :)

Mounir
21st April 2011, 00:53
The best for video right now is this (http://www.infognition.com/VideoEnhancer/). Videos & photos are two differents things, so i've been told.

SubJunk
21st April 2011, 07:34
Try NNEDI3 with ABS (http://forum.doom9.org/showthread.php?t=147695) :)

mathmax
21st April 2011, 14:33
Thank you for your answers :)
I tried "Video Enhancer"... it works pretty well (of course I didn't expext the result of the demos) but it makes some noise.. I'll try to apply a smoother on the top of it.
Do you think "NNEDI3 with ABS" is better?

Rumbah
21st April 2011, 22:58
I think NNEDI with a little sharpening looks great and often better than the commercial plugins.

mathmax
23rd April 2011, 15:04
Thank you :)

I need to change the aspect ration of my video... So I need to use a resize function... but I wonder if I should resize before or after the superresolution script...

Also I wonder which resize function to use since my video is very low resolution (320*180) : BicubicResize, LanczosResize, Lanczos4Resize,...?

Mounir
23rd April 2011, 23:11
neither of these, but rather spline36 resize/ spline64resize

mathmax
24th April 2011, 00:14
neither of these, but rather spline36 resize/ spline64resize
mmm... why are they better in my case?
And should I use it after or before the superresolution process?

Mounir
24th April 2011, 05:26
They're the sharpest filters to date with little to no artifacts

If you use video enhancer there is no need to use spline resize or any other resize filter in avisynth
What you can do is pre process your video with for example a deblocking filter, fix the black/white levels and colors:
filters suggestions: Levels, ColorYUV, Tweak

Rumbah
24th April 2011, 19:41
I'd resize to aspect ratio after the NEEDI upscale. That way you can use all original pixels for the final result (and as NNEDI can only upscale to 2^n of the original resolution a downsize may be necessary anyways).

mathmax
24th April 2011, 22:12
I tried both NEEDI and video enhancer.. after some tests, here are my conclusions for my video:

- using video enhancer, I get a slightly sharper video but it doesn't make a big difference and I also have more noise when there is motion. Does the algorithm work on several frames using this principle (http://books.google.com/books?id=fjTUbMnvOkgC&pg=PA4&img=1&zoom=3&hl=fr&sig=ACfU3U3isAuCouOhM7Qjhu2gh0dvNEBQSw&w=685&w=800)? As I'm working on a very compressed and low framerate video, the successive frames may differ a lot... and I guess that is what causes the noise...

- NEEDI doesn't seems to improve the resolution: I used nnedi3_rpow2(rfactor=4) but the image doesn't look sharper.... Do I use the right settings?

- However the videoFred's script (http://forum.doom9.org/showthread.php?t=144271) give me a much better result. A sharp image with noise reduction..

I tried to use videoFred's script on the top of video enhancer... maybe the image looks a tiny bit sharper, but I get also more more noise... so I think it doesn't worth it.

manono
25th April 2011, 01:23
- NEEDI doesn't seems to improve the resolution: I used but the image doesn't look sharper.... Do I use the right settings
I think NNEDI with a little sharpening looks great and often better than the commercial plugins.

Like Rumbah, I sharpen it after upscaling it. Actually, with such a low-rez source I'd sharpen the hell out of it. It's still going to look like crap though. And like him, I also agree that the results look as good as, if not actually better than, something like VideoEnhancer.

SubJunk
26th April 2011, 21:35
Thank you :)

I need to change the aspect ration of my video... So I need to use a resize function... but I wonder if I should resize before or after the superresolution script...

Also I wonder which resize function to use since my video is very low resolution (320*180) : BicubicResize, LanczosResize, Lanczos4Resize,...?NNEDI3 includes resizing itself, so for example:
nnedi3_rpow2(rfactor=4, cshift="Spline36Resize", fwidth=1920, fheight=1080)
cshift is the name of the resizer, then fwidth and fheight are the resize values.

Personally for upscaling I basically resize with NNEDI3, then run QTGMC in progressive-input mode which processes it a lot (I just wish QTGMC included resize parameters, maybe in the future), followed by LSFMod to sharpen, then GrainFactory3 to make it more realistic.
It's a slow script.
Here's an edited snippet of one of my files. I'm not saying this is the best thing ever but it's the best I have seen so far and I hope it helps you:

nnedi3_rpow2(rfactor=2, cshift="Spline36Resize", fwidth=1280, fheight=720)
QTGMC(Border=true, InputType=1)
LSFMod(defaults="slow")
GrainFactory3(g1str=4, g2str=6, g3str=8)

mathmax
29th April 2011, 14:33
NNEDI3 includes resizing itself, so for example:
nnedi3_rpow2(rfactor=4, cshift="Spline36Resize", fwidth=1920, fheight=1080)
cshift is the name of the resizer, then fwidth and fheight are the resize values.

Personally for upscaling I basically resize with NNEDI3, then run QTGMC in progressive-input mode which processes it a lot (I just wish QTGMC included resize parameters, maybe in the future), followed by LSFMod to sharpen, then GrainFactory3 to make it more realistic.
It's a slow script.
Here's an edited snippet of one of my files. I'm not saying this is the best thing ever but it's the best I have seen so far and I hope it helps you:

nnedi3_rpow2(rfactor=2, cshift="Spline36Resize", fwidth=1280, fheight=720)
QTGMC(Border=true, InputType=1)
LSFMod(defaults="slow")
GrainFactory3(g1str=4, g2str=6, g3str=8)
Thank you.. I tried your script but I have a problem with the QTGMC() function (downloaded here (http://avisynth.org/mediawiki/QTGMC)).. My clip is YUV.. but it seems not to be accepted.. Should I convert it to another color mode? But since the conversions are lossy, I wonder if that's a good idea...

Also since my clip in not interlaced, is it really useful to use QTGMC()?

Concerning the nnedi3() function, my clip is 320*180 and I would like to upscale to 720*480. Should I use the same parameters as you (rfactor=2)?

poisondeathray
29th April 2011, 15:57
Thank you.. I tried your script but I have a problem with the QTGMC() function (downloaded here (http://avisynth.org/mediawiki/QTGMC)).. My clip is YUV.. but it seems not to be accepted.. Should I convert it to another color mode? But since the conversions are lossy, I wonder if that's a good idea...


What does info() report the source is ?

What is the exact error message avisynth gives you ?




Also since my clip in not interlaced, is it really useful to use QTGMC()?


Maybe not. Depends what you are using it for. If you're using it for improving poorly deinterlaced or shimmering progressive footage it can be helpful


Concerning the nnedi3() function, my clip is 320*180 and I would like to upscale to 720*480. Should I use the same parameters as you (rfactor=2)?

nnedi3_rpow2(rfactor=4, cshift="Spline36Resize", fwidth=720, fheight=480)

But you have to flag the AR after you encode (720x480 isn't 16:9, assuming your 320x180 was square pixel to begin with)

mathmax
29th April 2011, 16:40
What does info() report the source is ?



Frame: 0 of 41546
Time: 00:00:00:120 of 00:23:06:252
ColorSpace: YUY2
Width: 320 pixels, Height: 182 pixels
Frames per second: 29.9700 (10000000/333667)
Fieldbased (Separated) Video: NO
Parity: Bottom Field First
Video Pitch: 640 bytes.
Has Audio: YES
Audio Channels: 6
Sample Type: integer 16 bit
Samples Per Second: 44100
Audio length: 61133519 samples. 00:23:06:247
CPU detected: x87 MMX ISSE SSE SSE2 SSE3



What is the exact error message avisynth gives you ?

In fact my clip was converted to RGB24 after vdub export whereas the original was YUY2. So I changed the output format to "Same as decompression format" which is "autoselect". Now my output clip is YUY2 and I would like to apply the script on it, but I get this error:

RemoveGrain: invalid mode 20
(QTGMC-3.31.avsi, line 755)
(QTGMC-3.31.avsi, line 780)
(QTGMC-3.31.avsi, line 387)

poisondeathray
29th April 2011, 16:46
QTGMC supports YUY2 now, it's just a matter of getting the plugins sorted out. See the QTMC thread for details

And if your export format is YV12, then just use ConvertToYV12()

More importantly, why are you using vdub at all?

Original was in YV12 from a progressive stream recording, correct ? You could avoid those conversions if you avoided vdub

mathmax
29th April 2011, 17:38
QTGMC supports YUY2 now, it's just a matter of getting the plugins sorted out. See the QTMC thread for details

Thank you, I sorted out the plugins and it works now :)


More importantly, why are you using vdub at all?

I use a vdub plugin to remove a logo, and I want to remove it before to apply the script. I couldn't find a proper tool to remove the logo in avisynth. Since my logo is located at the middle of the video, I can't use rm_logo (please see this post: http://forum.doom9.org/showthread.php?p=1496690#post1496690)



Original was in YV12 from a progressive stream recording, correct ? You could avoid those conversions if you avoided vdub
The original video is YUY2 from a progressive stream. So I don't need to convert after vdub, but it would nice to only use avisynth.

SubJunk
29th April 2011, 22:16
Also since my clip in not interlaced, is it really useful to use QTGMC()? Yes, QTGMC enhances progressive inputs after resizing very nicely, that is what the "InputType=1" is for; InputType=1 means progressive :)

mathmax
29th April 2011, 22:33
but I have a problem with the script.. sometimes the colors become very dark and crushed from a frame to another...

SubJunk
29th April 2011, 22:48
What is the full script you're using?

mathmax
30th April 2011, 00:27
What is the full script you're using?

AviSource("myvideo.avi")

nnedi3_rpow2(rfactor=4, cshift="Spline36Resize", fwidth=720, fheight=480)
QTGMC(Border=true, InputType=1)
LSFMod(defaults="slow")
GrainFactory3(g1str=4, g2str=6, g3str=8)

SubJunk
30th April 2011, 00:47
Is that crushed colours thing just happening in a converted clip, or in the raw input too?
Also, can you post a screenshot of what you mean?

manono
30th April 2011, 01:48
Since my logo is located at the middle of the video, I can't use rm_logo

Use the InPaintFunc. You can define the area to be delogoed by a crop:

http://avisynth.org/mediawiki/InpaintFunc

Leave an amount outside of the logo equal to the radius you choose.

Or teach yourself to use XLogo:

http://forum.videohelp.com/threads/273109-Remove-an-opaque-logo-using-Xlogo-in-Avisynth

XLogo is much faster, but doesn't do quite as good a job and can be real tricky to set up. And if it's a see-through logo, use LogoTools instead:

http://avisynth.org/mediawiki/LogoTools

mathmax
30th April 2011, 05:55
Use the InPaintFunc. You can define the area to be delogoed by a crop:

http://avisynth.org/mediawiki/InpaintFunc

Leave an amount outside of the logo equal to the radius you choose.

Or teach yourself to use XLogo:

http://forum.videohelp.com/threads/273109-Remove-an-opaque-logo-using-Xlogo-in-Avisynth

XLogo is much faster, but doesn't do quite as good a job and can be real tricky to set up. And if it's a see-through logo, use LogoTools instead:

http://avisynth.org/mediawiki/LogoTools
InpaintFunc is used by rm_logo (http://forum.doom9.org/showthread.php?t=134919).. so rm_logo should be better, what do you think?

It is a solid logo (not transparent)... which tool is the best for that kind of logo? I don't mind if it's not an avisynth script or if it's slow.. I just want to remove the logo the cleanest possible, cause it's quite big and at the middle of the video (where there is a lot of motion).

Regarding the colors problem with the script.. I don't succeed to reproduce it.. it seems that it has gone without reasons.. hope that's is for good :)

manono
30th April 2011, 07:05
InpaintFunc is used by rm_logo (http://forum.doom9.org/showthread.php?t=134919).. so rm_logo should be better, what do you think?
I already told you what I think. But if it's a solid/opaque logo and if it's in the middle of the video, whatever you use is just going to leave a big blur.

Pulp Catalyst
27th May 2011, 12:43
staxrip uses VdubMod, r u saying that anything that goes through VDubmod will always have degraded quality?

DVD PAL interlaced > Xvid (just introduced YadifMod+nnedi3 into stax.....but couldn't help noticed that i need a little sharpening on the image, the colour saturation seems a little dull compared to the original aswell)

did some searching on google which lead me to this page (nnedi3 sharpener)

this is an example of script that stax uses

LoadPlugin("D:\Program Files\StaxRip\Applications\DGMPGDec\DGDecode.dll")
MPEG2Source("F:\VIDEOTEMP\Staxrip\2\VTS_02_1 temp files\VTS_02_1.d2v")
Crop(0,0, -Width % 8,-Height % 8)
ConvertToYV12()
YadifMod(edeint=nnedi3())
Crop(20,0,-12,-0)


i don't resize (i assume that would avoid an unnecessary and possibly damaging step)


any suggestions i would really appreciate it,