comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: faster convol on local subsets?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: faster convol on local subsets? [message #78613] Tue, 06 December 2011 06:23 Go to previous message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
On Dec 6, 12:17 am, Andre <note....@gmail.com> wrote:

> I did not yet find time to check the implementation that Yngvar
> suggested but tried http://idlastro.gsfc.nasa.gov/ftp/pro/image/convolve.pro
> which also implements convolution in the Fourier domain. Still its
> slower than the native IDL convolution.

This is not my experience. I typically got a speedup by a factor of
10-100 for some applications where the kernels are quite large.

> According to a comment in
> their code IDL 8.1 has a CONVOL_FFT() which seems worth a further try
> after I got the update.

I didn't know that. Thanks for the tip!

> Last I also tried to convolve at each position only with desired
> kernel. The code looks more or less like this
>
> m=half_kernel_size
> nc= number of columns of the input
> nr = number of rows of the input
>
> for i=m, nc - m-1 do begin
>   for j=m, nr - m-1 do begin
>          patch=img[i-m:i+m, j-m:j+m]
>          kernel=kernel_store[*,*, (max_loc[i,j])]
>          temp = convol(patch, kernel])
>          response[i,j] = temp[m, m]
>   endfor
> endfor

You are calculating the 2D convolution of PATCH and KERNEL, and then
picking out only one element. You could try to calculate this element
by hand, which should be a linear operation.

What is the typical dimension of KERNEL_STORE?

--
Yngvar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Another Map Projection Problem with Map_Proj_Init
Next Topic: WIDGET_CONTROL: Invalid widget identifier: 2

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:34:43 PDT 2025

Total time taken to generate the page: 0.01147 seconds