[SciPy-user] scipy.signal.convolve2d() clips off part of my image

Travis Oliphant oliphant at ee.byu.edu
Fri Jan 28 16:56:23 EST 2005


Mike Kreiner wrote:

>I posted this message earlier to comp.lang.python, but figured this
>would be a better place to go.
>
>I'm using the convolve2d(image, mask) function from scipy to blur an
>image. The image I'm using is 512 by 384. When I display the image that
>convolve2d returns, the the left-most square of pixels (388 by 388)
>turn out fine, blurred and everything, however the right side of the
>image is all black.
>  
>

Mike,

I will look into what is going on, as it looks like the "full" linear 
convolution may have a bug.
Try using the "same" flag (this gives an output that is the same size as 
the input).  This seems to work.

convolve2d(image, mask, mode="same")

-Travis





More information about the SciPy-User mailing list