I'm new to Matlab. I have these simple lines. The problem is that the sum variable does not take negative values. All variables are double.
Inp_pixel = Inp_padded(x, y);
Filter_pixel = Filter(f_row, f_col);
sum = sum + (Inp_pixel * Filter_pixel);
for example: if Filter_pixel = -1 and Inp_pixel = 150 and sum = 0. the expected result should be -150 but I get sum = 0
Inp_padded,x,y,Filter,f_row,f_col, andsumand I'm notorious for picking the wrong values.