1
$\begingroup$

I am filtering an image using a Laplacian of Gaussian (LoG) kernel. The kernel dimensions are the same as the image. The filter operation takes very long to complete. How can I speed this up while maintaining fidelity?

The LoG kernel is not separable like the Gaussian kernel. So I cannot speed it up by filtering the image with 2 vectors successively. The only other option is to resize the kernel to get rid of insignificant multipliers on the outside. Is there a rule of thumb when choosing the size of an LoG kernel (considering image size and standard deviation of LoG)?

I am using this picture (633x900):enter image description here

Filtering this in matlab using Gaussian vs. LoG gives vastly different times with the same kernel size:

>> I = imread('PICTURE.jpg');

>> tic;imfilter(double(I), fspecial('gaussian', [633,900], 50)); toc
Elapsed time is 1.129423 seconds.

>> tic;imfilter(double(I), fspecial('log', [633,900], 50)); toc
Elapsed time is 253.447840 seconds.

I just started with image processing so please excuse me if I missed out on something glaringly obvious. Thanks!

$\endgroup$
  • 1
    $\begingroup$ Pay attention that the filter size doesn't have to be the size of the image. $\endgroup$ – Royi May 11 '18 at 20:44
1
$\begingroup$

you can approximate LoG with Difference of Gaussians. Apply 2 Gaussians (separable) with different sigmas. (for what I know with sigma ratio 1.1) and take the difference.

$\endgroup$
0
$\begingroup$

For many image applications, an exact Laplacian-of-Gaussian is not required. So you could as well resort to faster approximate version, such as the one on Fast Convolution with Laplacian-of-Gaussian Masks, using separability and factoring.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.