This plugin function restores focus ( or sharpens) slightly defocussed ( one pixel radius)images. Option to spike centrl point of a PSF (point Spread Function) is incorporated. Conversely images can be slightly defocussed by this plugin if desired. Shape of PSF can be circular, square or X . This plugin operates in Frequency domain and requires libfftw3f-3.dll or FFTw3.dll or fftw.dll from Fizick's site to be in the path. (system32 folder). Inversion in freq domain may amplify undesirable low amplitude frequencies and lead to ringing. White noise wn is added to reduce this. The higher the wn , the image will be focussed less but ringing will reduce. Compromise is to be arrived at. Spiking of central point of PSF will approach a Gaussian function and proper value also may lessen ringing in a similar fashion. RGB32, RGB24 YV12 and YUY2 colorspaces only are supported.

Details of parameters
Description Name Type Limits Default
clip to be processed clip none
White noise to be added wn float between 0.00002 and 0.4 0.05
value of spike to be added to center of PSF spike float 0.0 to 0.5 0.1
focus or defocus image focus boolean true for focus, false for defocussing focus
shape of PSF shape string "circular", "square", "x" "circular"
Scaling output scale float 0.00001 to 100 0.85

#Usage examples:-
fn=FQFocusDefocus( focus = false,   shape = "x")
fn1 = FQFocusDefocus( focus = true, wn = 0.15, spike = 0.3,  shape = "square")
fn2= FQFocusDefocus( focus = true, wn = 0.15, spike = 0.05)

mildly defocussed images in top row. Corresponding focussed images bottom row. Left "circular", middle "square" and right "x" shape of PSF.

Back to my index page
back to Avisynth