Using image registration parameters to transform another image

조회 수: 12 (최근 30일)
Joseph Pyle
Joseph Pyle 2022년 7월 27일
답변: Joseph Pyle 2022년 7월 28일
I have multispectral data and I want to run image registration on 1 color and then use the trasformation parameters to register the other colors. I started with some test data I offset manually to write/test the code, but am having trouble. I thought that using imregtform would output the transormation parameters that are used by imregister. Then I could use those parameters with imwarp for the other colors, but when testing it to see if the result between imregister and the combo of imregtform + imwarp I don't get the same result. I have the code and example images below.
[optimizer, metric] = imregconfig('multimodal')
im2R = imregister(im2, im, 'rigid', optimizer, metric);
tform = imregtform(im2, im, 'rigid', optimizer, metric);
im2warp = imwarp(im2, tform);

채택된 답변

Joseph Pyle
Joseph Pyle 2022년 7월 28일
I found out I need to fix the output view of the registered image to the reference image. I think otherwise it would be translated down, but plotted on new axis so it just ends up looking the same. Just needed to update the last line of code.
[optimizer, metric] = imregconfig('multimodal')
im2R = imregister(im2, im, 'rigid', optimizer, metric);
tform = imregtform(im2, im, 'rigid', optimizer, metric);
im2warp = imwarp(im2, tform, 'OutputView', imref2d(size(im)));

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by