|
的确如此, 昨晚我仅随意试到10而已!
>> clear; N=3; A=1:N; A=repmat(A,N,1); NN=2*N-1;
tic; P=fft2(A,NN,NN); P=P.*conj(P); R=real(ifft2(P));
R=fftshift(R); P=fftshift(P); toc
Elapsed time is 0.039205 seconds.
>> tic; R1=xcorr2(A); P1=fft2(R1); P1=P1.*conj(P1);
P1=sqrt(P1); P1=fftshift(P1); toc
Elapsed time is 0.010360 seconds.
clear; N=10; A=1:N; A=repmat(A,N,1); NN=2*N-1;
>> tic; P=fft2(A,NN,NN); P=P.*conj(P); R=real(ifft2(P));
R=fftshift(R); P=fftshift(P); toc
Elapsed time is 0.013720 seconds.
>> tic; R1=xcorr2(A); P1=fft2(R1); P1=P1.*conj(P1);
P1=sqrt(P1); P1=fftshift(P1); toc
Elapsed time is 0.001280 seconds.
clear; N=100; A=1:N; A=repmat(A,N,1); NN=2*N-1;
tic; P=fft2(A,NN,NN); P=P.*conj(P); R=real(ifft2(P));
R=fftshift(R); P=fftshift(P); toc
Elapsed time is 0.053816 seconds.
>> tic; R1=xcorr2(A); P1=fft2(R1); P1=P1.*conj(P1);
P1=sqrt(P1); P1=fftshift(P1); toc
Elapsed time is 0.127533 seconds.
[ 本帖最后由 ChaChing 于 2009-4-15 22:03 编辑 ] |
|