필터 지우기
필터 지우기

Issue with image registration.

조회 수: 4 (최근 30일)
Ridhima Chopra
Ridhima Chopra 2024년 2월 21일
댓글: Image Analyst 2024년 3월 2일
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
Image Analyst
Image Analyst 2024년 3월 2일
@Ridhima Chopra I posted an answer in that post.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by