Effacer les filtres
Effacer les filtres

Issue with image registration.

7 vues (au cours des 30 derniers jours)
Ridhima Chopra
Ridhima Chopra le 21 Fév 2024
Commenté : Image Analyst le 2 Mar 2024
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?

Réponse acceptée

Garmit Pant
Garmit Pant le 29 Fév 2024
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 commentaires
Ridhima Chopra
Ridhima Chopra le 2 Mar 2024
@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
Image Analyst
Image Analyst le 2 Mar 2024
@Ridhima Chopra I posted an answer in that post.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by