FQBlur


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

FQBlur 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.

FQBlur function blurs an image or part of it with either out of focus type blur or motion blur type. Part of image ( either rectangular or oval) can be processed leaving the rest intact. The selected window can linearly move over length of clip. The dimensions of window however would remain same.

In case of oval window the coordinates to be specified or those of the superscribing rectangle.

In case of motion blur the line is assumed to be symmetric about origin, the end coordinates of blur line will be -x, -y and x,y. In case of out of focus blur the xcoordinate is the radius of blur.

While all 3 color planes of RGB formats are processed, in case of YUY2 and YV12 only Luma (Y) is blurred.RGB formats will run slower as processing has to be performed on the three color planes separately.



Details of parameters
Description Name Type Limits Default
Input clip clip must have the fields separated none
Whether blur is linear as in motion blur or out of focus type line boolean true for motion blur, false for focus true
blur line right end x coordinate or radius of focus blur. Line assumed symmetric about origin x integer 2 to 1/8 frame width 6
blur line right end y coordinate. Line assumed symmetric about origin y integer - 1/8th to 1/8th frame height 2
left x coordinate of blur window lx integer 0 to frame width - 8* x 0
top y coordinate of blur window ty integer 0 to frame height - 8* absolute value of y 0
right x coordinate of blur window rx integer 8 * x to frame width - 1 width - 1
bottom y coordinate of blur window by integer 8* abs y to frame height -y height - 1
left x coordinate of blur window at end frame elx integer 0 to frame width - 8* x andensure window remains in frame lx
top y coordinate of blur window at end frame ety integer 0 to frame height - 8* absolute value of y and ensure window remains in frame ty
Whether window is oval or rectangular oval boolean true for oval, false for rectangular false

#Usage examples:-
assumeframebased()
separatefields(). selectodd()
trim(0,100)
crop(250,0,400,-40)

fqb1 = FQBlur( line = false, x=4,oval = true, lx = 270, rx = 360, ty = 140, by = 199)
fqb2 = FQBlur( line = false, x=8,y = 0,oval = false)
fqb3 = FQBlur( line = true, x=8,y = 2,oval = false, lx = 20, rx = 300, ty = 40, by = 80)
fqb4 = FQBlur( line = true, x=12,y = -4,oval = false)
fqb5 = FQBlur( line = true, x=0,y = 10,oval = true)
sta = stackvertical(last,fqb1,fqb2)
stb = stackvertical(fqb3,fqb4,fqb5)
sth = stackhorizontal(sta, stb) #.Grid()
return (sth)

below are illustration of results. Top left is input. Below is focal blur of radius 4 in a small oval part( girl in foreground) of image. Left bottom is Focal blur of radius 8 in full frame. Right top is a motion blurred image with x = 8, y = 2 in a narrow rectangle. Below it is full image motion blurred with x = 12, y = -4 . Right bottom is image with large oval area motion blurred with x = 0, y = 10 .

To my index page down load plugin To Avisynth