Author Topic: using Image.convolve with out of range [0, 1] values  (Read 4273 times)

Offline kwiechen

  • PixInsight Addict
  • ***
  • Posts: 186
using Image.convolve with out of range [0, 1] values
« on: 2014 August 11 12:59:46 »
I am trying to use Image.convolve() with LoG kernels to find local maxima. With Image.convolve(kernel matrix) out of range values are truncated, so the output is rather different from a matlab walktrough. Is there any documentation about the other parameters of Image.convolve() to use the filter response for positive and negative values?

Best regards,

Kai

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: using Image.convolve with out of range [0, 1] values
« Reply #1 on: 2014 August 11 13:51:15 »
+1. Had same problem when doing peak detection. Input, kernel, and output may all be outside 0 to 1. I would like a convolve option for this case that does no normalization, just a simple sum of the products.

Mike
« Last Edit: 2014 August 11 14:02:12 by mschuster »

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: using Image.convolve with out of range [0, 1] values
« Reply #2 on: 2014 August 11 16:46:11 »
Since Core version 1.8.1, use an optional parameter to call the Image.convolve() and Image.convolveSeparable() methods:

void Image.convolve( Array kernel[, int highPassMode=0] )
void Image.convolve( Matrix kernel[, int highPassMode=0] )


void Image.convolveSeparable( Array rowVector, Array colVector[, int highPassMode=0] )
void Image.convolveSeparable( Vector rowVector, Vector colVector[, int highPassMode=0] )


The highPassMode argument changes the way high-pass filtered images are manipulated after convolution. The following values are recognized:

0 : Truncate the convolved image to [0,1]. This is the default value.
1 : Rescale the convolved image to [0,1].
2 : Raw high-pass filter mode: Leave the convolved image unchanged.

This parameter is ignored for low-pass filters. Let me know if this is what you want.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline kwiechen

  • PixInsight Addict
  • ***
  • Posts: 186
Re: using Image.convolve with out of range [0, 1] values
« Reply #3 on: 2014 August 12 13:35:38 »
I think Image.convolve wih "2 : Raw high-pass filter mode" should work together with LoG filtering to get something like a maximum map of an image. 

Thank you very much!

Kai