Log in

View Full Version : How to sharpen this "glassy" video?


fvisagie
30th October 2012, 10:31
Hi All,

What could one try to improve the appearance of this "glassy" video? It was shot with a wide-angle lens attachment which caused a glassy blur across almost the entire image except the centre. Here's a short sample:

http://www.mediafire.com/file/0lym5r657vplaa7/Wide-angle_lens_blurring_sample.wmv

At videohelp.com poisondeathray suggested I use http://forum.doom9.org/showthread.php?p=1595531#post1595531 with a circular overlay mask for retaining the unblurred centre. However, when I increase blur for stronger sharpening on this video's edges, things get ugly quickly.

I'm a bit stranded at the moment. Is some kind of temporal repair worth pursuing, or should I take a different approach altogether?

Many thanks in advance,
Francois

Didée
30th October 2012, 16:03
Seems like some sort of "vignetting", no? It's not only "blur", but also a white-greyish haze ... so, don't concentrate solely on "sharpening", but consider also some basic contrast/levels fiddling.

I dunno. Took some poor filters, made an awkward mask, threw in a pot, stirred hastily, ...

o = last
oo = o.levels(16+52,1.0,235-16,16,235,false)
x = oo.bicubicresize(72*4,56*4).medianblur(1,0,0).bicubicresize(width(),height(),1,0)
d = mt_lutxy(o,x,"128 x y - abs 2 / 1 1.4 / ^ 2 * x y - x y - abs 0.001 + / * +",U=2,V=2)
s = oo.mt_makediff(d.gradfun2db(5.5),U=2,V=2).sharpen(.6)
mm = blankclip(o,width=16,height=16,color=$FFFFFF).addborders(8,8,8,8).levels(18,1.0,232,0,255,false)
\ .blur(1).medianblur(3,0,0).blur(1).bicubicresize(64,64,1,0).blur(1).blur(1).bicubicresize(width(),height(),1,0)

s.mt_merge(oo,mm,U=2,V=2).mt_merge(o,mm,U=2,V=2)
Embarrassing, isn't it? ^^


http://thumbnails102.imagebam.com/21772/029619217716172.jpg (http://www.imagebam.com/image/029619217716172)

Nothing to be proud of, but at least it is something.

Guest
30th October 2012, 18:36
Windowed histogram equalization is interesting here (done with my VirtualDub filter). I applied it with high strength, some tweaking may produce better results.

fvisagie
31st October 2012, 07:47
Thanks, I'll definitely try these out.

@Didée, is "o = last" only saying: "by now your source should have been opened and assigned to last"? I.e. you're NOT implying that this be appended to something more complex?

fvisagie
1st November 2012, 14:23
I applied it with high strength, some tweaking may produce better results.

Very interesting and effective approach! How would one proceed with an over-sharpened (?) clip like this?

Guest
1st November 2012, 15:29
Apply winhisto with:

strength = 121
max intensity = 142
window size 72x72

Then after that filter add brightness/contrast and push the brightness up a little. The result looks pretty good to me.

fvisagie
1st November 2012, 15:55
Thanks.

(I considered the trade-off between yet another message vs. courtesy but courtesy won.)

fvisagie
11th December 2012, 15:54
For the sake of posterity, below is what I ended up with:


# Stage 1 - deblur
#
a = last
dblurd = ALBR(a) # Create deblurred copy
originl = ALBR(a, mode="Denoise") # Denoise original by same amount
# Splice in sharpened footage only where needed
splclst= "3227:3271,6300:6345,7002:7034,7639:7680,8930:8971,11651,11696:11754,14849:14874,17085:17258,17487:17534,18025:18158"
splclst= splclst+",18735:18810,19528,21872:21918,24691:24786,25014:25054,25516:25539,27338:27444"
SpliceFiltered(originl, dblurd, splclst, absoverlap=true)



# Stage 2 - deshake
#
# > VirtualDub.Deshaker() (could have put inline but Deshaker requires 2 passes through slow filter chain above)
#
# Deshaker Max. correction limits lowered to prevent stabilising frames with motion blur - very unsighly glitches otherwise
# Deshaker() settings:
# VirtualDub.video.filters.Clear();
# VirtualDub.video.filters.Add("Deshaker v3.0");
# VirtualDub.video.filters.instance[0].Config("18|1|30|4|1.067|-1|1|0|640|480|1|2|1000|1000|1000|1000|4|0|6|2|8|30|300|4|C:\\Users\\fvisagie\\Videos\\Home Videos\\20081213 Namibia Insect Footage\\20081223 Namibia Ants Raiding Other Nest's Babies\\_2.Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|1|1|5|15|1|1|30|30|0|0|0|0|1|1|1|10|1000|1|88|1|1|20|5000|100|20|1");
#
# < VirtualDub.Deshaker()



# Stage 3 - final nice soft contra-sharpening
#
FFT3DFilter(bw=48, bh=48, bt=-1, ow=24, oh=24, sharpen=0.3)


Adaptive Lens Blur Repair (http://forum.doom9.org/showthread.php?t=166588) (ALBR) and SpliceFiltered (http://forum.doom9.org/showthread.php?t=166627) are two functions I wrote for this project.

Many options remain half- or unexplored and a lot of this could have been done better/differently, but this is what I had time for and I am more than happy with the results.

Many thanks to poisondeathray whom I blame/thank ;) for giving this project direction, and also to the many others who helped along the way :).