normalized 2D cross correlation
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am trying to utilize the c=normxcorr2(template,A) function for two surface plots and I am running into the following errors;
??? Error using ==> iptcheckinput Function NORMXCORR2 expected its second input, A, to be finite.
Error in ==> normxcorr2>ParseInputs at 232 iptcheckinput(A,{'logical','numeric'},{'real','nonsparse','2d','finite'},mfilename,'A',2)
Error in ==> normxcorr2 at 55 [T, A] = ParseInputs(varargin{:});
Both matrices are the Z coordinates for the plots and and I can find the template in A and yes A is bigger than template. Matrix A is 427x249 and template is 299x149. The elements in both matrices range from -50 to +75 and also have NaN as fill elements.
I was wondering if someone knows whether it is appropriate to use this function for such manipulation if not can you help me to perform the 2D cross correlation for two surface plots?
Thanks, Shayan
0 comentarios
Respuesta aceptada
Sean de Wolski
el 6 de Sept. de 2011
No. normxcorr2 requires that the elements be finite, i.e. not nan and not inf. The normalized cross correlation algorithm is not a difficult one ( wikipedia:normalized X-correlation )
I would recommend coding it yourself using functions that ignore nans ( nansum, nanmean, nanstd ). If you don't have the stats toolbox that contains these there is a nan-suite on the FEX.
2 comentarios
Sean de Wolski
el 7 de Sept. de 2011
2d x-correlation is what you wanted above. So you're expecting there to be a rotation about the z-axis and to recover the x/y translations correct?
Más respuestas (0)
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!