DefDAP icon indicating copy to clipboard operation
DefDAP copied to clipboard

KAM: nearest neighbour, second nearest? etc...

Open AllanHarte opened this issue 6 years ago • 9 comments

Hi All

Am I correct in thinking that the current calcKam() function in ebsd.py takes the average of neighbouring pixels in the row, in the column, and then takes the average of those row and column values? Is this strictly a kernel? i.e. are the corner pixels of a 3x3 square kernel taken into account?

If we were to think about a 5x5 kernel or a 7x7, etc., would we have to do the calculation in a different way? There are scipy functions to convolve a 2D dataset with a kernel, such as scipy.signal.convolve2d().

@mikesmic maybe you think that we can adapt the current calcKam() function, or do you think that I should create a new function using something like convolve2d that is flexible for an nxn kernel?

Thanks, Allan

AllanHarte avatar Jan 11 '18 14:01 AllanHarte