Opened 3 years ago
Smartblur filter: inccorct naming variance vs. standard deviation
|Reported by:||simgro||Owned by:|
|Version:||unspecified||Keywords:||smartblur, gaussian, variance|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
The Documentation for smartblur filter states (https://ffmpeg.org/ffmpeg-filters.html#smartblur-1):
luma_radius, lr: ... specifies the variance of the gaussian filter used to blur the image.
This is not correct. From how the parameter is used, it is not the variance but the standard deviation of the gaussian filter (variance=std-deviation2).
As far as i can see, the naming error is actually inside the used function sws_getGaussianVec (https://svn.ffmpeg.org/doxygen/0.8/libswscale_2utils_8c-source.html#l01272 ) which has an input called 'variance' which is used as if it was the 'standard deviation' in line 01284:
vec->coeff[i]= exp(-dist*dist/(2*variance*variance)) / sqrt(2*variance*M_PI);
For reference, see e.g., https://en.wikipedia.org/wiki/Gaussian_function
It might be best to change the documentation such that it correctly ready 'standard deviation'. To avoid confusion, also replace the name of the variable in the sws_getGaussianVec function. The documentation potentially has this error whenever the sws_getGaussianVec function is valled by some filter.