bob::math::gradient fails with type uint16
Created by: siebenkopf
When computing gradients using bob::math::gradient on 2D images of type uint16_t, the computation returns very high numbers. I guess that the problem lies in lines 134 - 137 of bob/math/gradient.h::
gy(0,rall) = input(1,rall) - input(0,rall); gy(M-1,rall) = input(M-1,rall) - input(M-2,rall); gx(rall,0) = input(rall,1) - input(rall,0); gx(rall,N-1) = input(rall,N-1) - input(rall,N-2);
where differences of the inputs (of type uint16) are computed using Blitz++ magic.
Interestingly, this issue does neither show up in the 1D case, not with uint8.
For the time being I added a test case that will (eventually) fail until this bug is solved.