Through some help here, I have come up with a function that seems to apply the sobel derivative to an image in the X direction F(x,y) = F(x+1,y) - F(x,y)
I can't use any OpenCV functions and I need the 2D output array to be 1 column shorter than the 2D input array.
However, I can't figure out why this is still not returning an output array that is 1 column shorter. Can someone spot the issue and/or tell me if this is on the right track? Thanks much.
output = input[:-1,:]
r,c = input.shape
for i in range(0, r - 1):
output[i] = np.abs(input[i+1] - input[i])
return output