An elegant way to get the output of `normxcorr2` in a manner similar to 'conv2' - (removing the unwanted edges)
问题 Is there an elegant way in Matlab to get the output of normxcorr2 cropped to the size of the image or cropped only to the part of the matrix that does not use zero padded edges in computation? To understand what I mean, consider the conv2 command. There is an optional parameter called shape that can be set to same or valid . C = conv2(A,B,'same'); C = conv2(A,B,'valid'); For example: size( conv2( rand(50,50) , rand(6,6), 'valid') ) ans = 45 45 size( conv2( rand(50,50) , rand(6,6), 'same') )