フィルターのクリア

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 Center および File ExchangeGeometric 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