FQVisual


Author V. C. Mohan
Last modified Date Feb 28, 2008

FQVisual function operates in frequency domain and requires libFFTw3f-3.dll or FFTw3.dll or fftw3f.dll available at Fizick's site, to be in the path.

Charecteristics of blur can be visualised in frequency domain by averaging sufficiently large number of spectra where the image varies but the blur remains constant. This princeple is used in this visual aid. The image is divided into smaller pieces, size of which is determined by estimate provided.

Given an approximate estimate of blur in a specified sufficiently large window (which can translate linearly upto end frame) present in consecutive 'af' number of frames, FQVisual function provides visual aid to find type and estimate blur value .

In case of small blur values an increased frequency resolution image is also displayed. Some times may be useful.

Motion blur can be clearly estimated as the display shows the blur line. Excepting if main objects in image are also oriented along the blur axis, it will be easy to get the end coordinates of this line which will be twice those of blur present.

In case if out of focus blur is present, the display shows a fuzzy circle, the radius of which will be twice the out of focus blur radius.

While all 3 color planes of RGB formats are used, in case of YUY2 and YV12 only Luma (Y) is used.

The displays are similar to Power Spectra. Also with x or y as ordinate, spectral values along x axis (east), along y axis (south), diagonal line in se direction and along sw direction are displayed. For the lines along se or sw need to multiply by 1.414 to get radial distance. These line displays may aid in finding peaks or minima in case of blur due to out of focus or if motion blur is exactly along width or height of the frame or it is oriented exactly at an angle of 45 degrees.

The 'est' parameter of blur is used only for the purpose of getting redundancy. In case a sufficiently large area of image has a smaller blur to be determined a higher estimate can be given. It may be noted that normally images have high values near the origin which makes it difficult to determine exact values of such blur.



Details of parameters
Description Name Type Limits Default
Input clip clip must have the fields separated none
number of frames to be averaged for analysis af integer 1 to clip length 6
estimated blur half length or radius est integer 2 to 50 or 1/8th of smaller window dimension 4
left x coordinate of blur window lx integer 0 to frame width - 8* est 0
top y coordinate of blur window ty integer 0 to frame height - 8* est 0
right x coordinate of blur window rx integer 8 * est to frame width - 1 width - 1
bottom y coordinate of blur window by integer 8* est to frame height -y height - 1
left x coordinate of blur window at end frame elx integer 0 to frame width - 8* est andensure window remains in frame lx
top y coordinate of blur window at end frame ety integer 0 to frame height - 8* est and ensure window remains in frame ty
display exponent g1 float 0.000001 to 100 0.15
scaling of second enlarged spectral display g2 float 0.000001 to 100 0.15

#Usage examples:-
loadplugin (".......\fqsharp.dll")
Directshowsource("H:\EURO004.AVI").converttoYV12()
assumeframebased()
separatefields()
fqVisual(  est = 8, g1 = 0.2,lx = 20, rx = 240, ty = 60, elx = 80 )		


Script used for below display
ffmpegsource("E:\mayjune07\mayj002.avi", atrack = -1).converttoYUY2()
assumeframebased()
separatefields(). selectodd()
tr = trim(0,100)
crop(tr, 250,0,400,-40)

hb2 = FQBlur( line = false, x=2,y = 2,oval = false).crop(16,16,-16,-16)
hb4 = FQBlur( line = false, x=4,y = 3,oval = false).crop(16,16,-16,-16)
hb8 = FQBlur( line = false, x=8,y = 4,oval = false).crop(16,16,-16,-16)
hb16 = FQBlur( line = false, x=16,y = 5,oval = false).crop(16,16,-16,-16)


fqb2 = FQBlur( line = true, x=2,y = 2,oval = false).crop(16,16,-16,-16)
fqb4 = FQBlur( line = true, x=4,y = 0,oval = false).crop(16,16,-16,-16)
fqb8 = FQBlur( line = true, x=8,y = 3,oval = false).crop(16,16,-16,-16)
fqb16 = FQBlur( line = true, x=0,y = 16,oval = false).crop(16,16,-16,-16)

FV2 = FQvisual(hb2,est = 4 )
FV4 = FQvisual(hb4,est = 8)
FV8 = FQvisual(hb8,est = 10)
FV16 = FQvisual(hb16,est = 16)

FqV2 = FQvisual(fqb2,est = 4)
FqV4 = FQvisual(fqb4,est = 8)
FqV8 = FQvisual(fqb8,est = 10)
FqV16 = FQvisual(fqb16,est = 16)

st1 = stackvertical(fv2,fv4,fv8, fv16)
st2 = stackvertical(fqv2, fqv4,fqv8, fqv16)
st3 = stackvertical(sb2, sb4,sb8, sb16)

stackhorizontal(st1,st2)

below is illustration of results. On left out of focus blur and right is motion blur. top to bottom blur radius/ half length are 2, 4, 8, 16 pixels. Motion blur second from top is along x, and bottom is along height.



To my index page down load plugin To Avisynth