Issue with image registration.

10 次查看(过去 30 天)
I have attached my image registration matlab file.
The input/moving image I have taken is:
The moving and fixed images are same.
After the hamming distance is calculated between the fixed image and the registered/ the moving image, why is the hamming distance not coming zero?
for these lines:
difference =abs(original - transformed_img);
distance = (sum(difference(:)))
Output comes out like:
distance =
214.3689.
However both the images look exactly the same, before and after transformation. Is there any way to prevent the change in pixel values after image registration?

采纳的回答

Garmit Pant
Garmit Pant 2024-2-29
Hello Ridhima
From what I gather, you are applying image registration on the same image using feature matching method and are facing an issue with the transformed image not exactly matching the original image.
Since the method of image registration being employed here is feature matching'and then warping the image using the “imwarp” function, it is expected output to have some pixel-level discrepancy between the original and transformed image. This discrepancy can arise due to interpolation artifacts and algorithmic nuances inherent in the feature matching image registration process and the implementation of the function.
Since the images are the same, you can apply the intensity-based image registration method. Following is a code snippet to use intensity-based image registration:
grayFrame1 = imread("peppers.png"); %fixed image
grayFrame1=rgb2gray(grayFrame1);
original = grayFrame1;
grayFrame2= imread("peppers.png"); %moving image
grayFrame2=rgb2gray(grayFrame2);
subplot(1,2,1)
imshow(grayFrame1)
title('Fixed Image')
subplot(1,2,2)
imshow(grayFrame2)
title('Moving Image')
[optimizer, metric] = imregconfig('monomodal');
movingRegistered = imregister(grayFrame2,grayFrame1,'rigid',optimizer, metric);
figure
imshowpair(grayFrame1, movingRegistered,'Scaling','joint')
difference =abs(original - movingRegistered);
distance = (sum(difference(:)))
distance = 0
For further understanding the methods mentioned above, you can refer to the following MATLAB Documentation:
  1. imregister” function: https://www.mathworks.com/help/releases/R2021a/images/ref/imregister.html
  2. imregconfig” function: https://www.mathworks.com/help/releases/R2021a/images/ref/imregconfig.html
I hope you find the above explanation and suggestions useful!
  3 个评论
Ridhima Chopra
Ridhima Chopra 2024-3-2
@Garmit Pant do you know any way to remove the black part of the moving image that is registered?
as in this one?
The full issue is addressed at: Eliminate Black Part of Moving Image

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by