image processing style (2D kernel) convolutions?
jepler at unpythonic.net
Wed Mar 3 03:02:06 CET 2004
Well, it seems that you could convolve each row of the input image with
each row of the kernel, with the rows offset from each other. Then sum
the 3 convolved rows to get the output row
I know this isn't the right notation, and doesn't deal with r-1 or r+1
being out of range..
for r in range(input_height):
output[r] = (convolve(input[r-1], filter)
+ convolve(input[r], filter)
+ convolve(input[r+1], filter)
More information about the Python-list