delphi - Convolve function: Apply different radius in Gaussian filter -


there convolve function in swissdelphicenter.ch, set kernel , resulting image blurred, there no parameter apply more blur unless call function multiple times (not desired coz of performance issue).

how apply more blur image radius parameter in photoshop gaussian filter?

i using kernel apply gaussian filter:

1    2    1
2    4    2
1    2    1

you can make larger gaussian kernel - 5x5, 7x7 etc. performance decrease proportional size^2. kernel size faster use approach fft-based convolution.

edit
fft-based convolution: have data array a, array kernel values k (same length, zero-padded).

conv(a, k) = backfft (fft(a) * fft(k)) 

to make convolution, 1 can

find fourier transform of data find fourier transform of kernel multiply them element-by-element (note numbers complex) make inverse fourier transform of product real part of 

look @ fast convolution algorithms section in wiki , part 13.1 of numerical recipes (almost practical manual)

if interesting in fast treatment of many images, i'd recommend use dedicated library. example, opencv fast (delphi wrapper exists 2.4.11 version), graphics32, imageen etc.


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -