필터 지우기
필터 지우기

How to get the non-integer offset between two images

조회 수: 6 (최근 30일)
Gustav Shen
Gustav Shen 2017년 5월 12일
편집: Matt J 2017년 5월 12일
I use 'normxcorr2' to define the offset between the template and images, but if the offset less than 0.5 pixels, I got the result is '0', and I want the exact value, such as '0.35 pixels'.
That's the offset, there are 10 images, row1 is x-direction, row2 is y-direction, the first image is the template. Those '0' in the table might be '0.1' or '0.34'....how can I use interpolation to get the exact value? or any other methods. Thanks in advance.
my code is that:
for k=1: Scan_Range
template = imcrop(Array_Sample(:,:,1),[400 400 99 99]);
subimage(:,:,k) = imcrop(Array_Sample(:,:,k),[400 400 99 99]);
C = normxcorr2(template,subimage(:,:,k));
[max_cc,imax] = max(abs(C(:)));
[ypeak, xpeak] = ind2sub(size(C),imax(1));
offset(:,k) = [(ypeak-size(subimage,2)),(xpeak-size(subimage,1))];
end

채택된 답변

Matt J
Matt J 2017년 5월 12일
편집: Matt J 2017년 5월 12일
You would probably have to use imregtform with transformType='translation'.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by