Padding backend

Christoph Gohlke cjgohlke at gmail.com
Thu Apr 18 20:52:06 EDT 2013


On 4/18/2013 5:41 PM, Josh Warner wrote:
> It appears there are several scikit-image functions which have need of
> padding input. As far as I can see, these generally do so internally,
> with functions or routines that aren't exposed. From a quick search, the
> following functions in scikit-image all pad using their own internal
> methods:
>
> |feature.match_template| : mean value
> |filter.lpi_filter| : asymmetric zeros
> |morphology.greyreconstruct| : symmetric zeros or constant value
> |morphology.watershed| : |pad| child function for symmetric zeros
> |transform.radon| : symmetric zeros
>
> More broadly, there doesn't appear to be a publicly exposed API for
> padding NumPy image arrays in any packages I've come across.
> |scipy.ndimage| clearly has this functionality, via the common |mode|
> parameters, but it isn't exposed for general use.
>
> I've put some effort into making a pure Python 2d / 3d capable padding
> function for personal use, and most of the |scipy.ndimage| modes are
> available. Preliminary gist here wouldn't be hard to wrap into a PR
> (likely not optimal, but functional):
> https://gist.github.com/JDWarner/a26f77dae983fa1faba9
>
> Would such functionality be desirable?
>


Numpy has a pad function since version 1.7.
<http://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.pad.html>

Christoph



More information about the scikit-image mailing list