Image registrations between depthmap and it's corresponding image
Show older comments
Hello MATLAB community.
I need help in spatially register two images.
I have an image in colormap(MXNX3 unit8) and it's corresponding depthmap array(M*N double). The depthmap is spatially a bit off and I want to register them and save the output. I tried doing it in registerEstimator app. It thrown errors saying "Registration failed. Try improving the quality of the matched features."
The code I have also not registered properly. Need help please.
My code:
clc
close all
img1 = imread('.jpg');
load('.mat');
img2 = A;
figure(1),imagesc(img2); figure(2),imagesc(img1);
img1_gray = rgb2gray(img1);
fixed = img1_gray;
img2_double = im2double(img2);
moving = img2_double;
[optimizer, metric] = imregconfig('monomodal');
tform = imregtform(moving, fixed, 'translation', optimizer, metric);
registered = imwarp(moving, tform, 'OutputView', imref2d(size(moving)));
figure(3);
subplot(1,3,1); imshow(fixed); title('Fixed Image');
subplot(1,3,2); imshow(moving); title('Moving Image (Before)');
subplot(1,3,3); imshow(registered); title('Registered Image');
3 Comments
Walter Roberson
on 9 Jul 2025
It would help to have your jpg and your mat for testing purposes.
Eswar
on 9 Jul 2025
Walter Roberson
on 9 Jul 2025
No.
Accepted Answer
More Answers (0)
Categories
Find more on Image Registration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!