filter2D does something really weird. When I use a 1x1 kernel with a value of [1] on a floating point black and white image I don't get the same image back. Instead I get a different matrix with a lot of infinite values. What is this voodoo magic and how do I perform a convolution like it is defined in wikipedia?