Skip to content

Kernel normalization treatment #4

Open

Description

@jamienoss

Untangle kernel re-normalization & NaN interpolation

  • The following seems untrue, unnecessary, and inefficient (src)
 # Because the Cython routines have to normalize the kernel on the fly, we
 # explicitly normalize the kernel here, and then scale the image at the
 # end if normalization was not requested.

Hmmm, maybe not. The interpolation scheme seems to prevent this hoist and is the reason that the kernel summation exists in the Cython code. If the image element is NaN then the kernel element is not incorporated in the sum.

A silver lining is that the above is only true for nan_treatment = 'interpolate'. It can, therefore, be optimized out for all other options. NaN interpolation is, however, the default.

This can also be checked before convolving to determine whether NaN values even exist.

Activity

  1. Repository owner locked and limited conversation to collaborators on Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions