ajayk0719 / jai-tools

Automatically exported from code.google.com/p/jai-tools
0 stars 0 forks source link

MaskedConvolve code assumes that the kernel's key element is at width/2, height/2 #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The code in each of the data type-specific loops determines the source
pixel position corresponding to each kernel element, but this code assumes
that the kernel's key element is at x=kernelWidth/2, y=kernelHeight/2 so it
will break for asymmetrical kernels.

Original issue reported on code.google.com by michael.bedward@gmail.com on 25 Mar 2009 at 12:41

GoogleCodeExporter commented 9 years ago
Actually it's worse. The code assumes that the source pixel corresponding to the
kernel's key element is being processed first but that's not correct: pixels are
processed starting with the kernel's top-left element

Original comment by michael.bedward@gmail.com on 25 Mar 2009 at 1:09

GoogleCodeExporter commented 9 years ago
Cancel that last comment - the x, y coords are being set relative to the 
destination
raster so they will be ok

Original comment by michael.bedward@gmail.com on 25 Mar 2009 at 2:38

GoogleCodeExporter commented 9 years ago
Fixed.

Added basic unit tests for symmetric and asymmetric kernels

Original comment by michael.bedward@gmail.com on 25 Mar 2009 at 4:22