Assume that I have greyscale image I that have 300 x 300
and I have matrix matrix M 3 x 3
after the convolution
Ans = conv2(I,M);
ans will be matrix 304 x 304 => convolute will extend the matrix
If I want the answer to be a matrix like I Can I force it like
Ans = Ans(1+2:304-2;1+2:304-2);
answould actually be a matrix of size 302 x 302 - nmante