normalized 2D cross correlation
9 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Sean de Wolski
2011 年 9 月 6 日
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 件のコメント
Sean de Wolski
2011 年 9 月 7 日
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?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!