Can’t dewarp image using fitgeotform2d and imwarp
I’m trying to reverse a transformation in an image. I have point coordinates in the intrinsic coordinate (moving points) and their equivalent in the real world coordinates (fixed points). When I use the fitgeotform2d and imwarp functions to obtained a dewarped image, I only get an matrix of zeros and size of the original image as output. Here’s the data and the code:
load("calImg.mat")
J = double(calImg);
fixedPoints = W;
movingPoints = I;
figure(1)
imagesc(J)
tform = fitgeotform2d(movingPoints,fixedPoints,"projective");
Jregistered = imwarp(flipud(J),tform,OutputView=imref2d(size(J)));
figure(2)
imshowpair(I,Jregistered)I’m trying to reverse a transformation in an image. I have point coordinates in the intrinsic coordinate (moving points) and their equivalent in the real world coordinates (fixed points). When I use the fitgeotform2d and imwarp functions to obtained a dewarped image, I only get an matrix of zeros and size of the original image as output. Here’s the data and the code:
load("calImg.mat")
J = double(calImg);
fixedPoints = W;
movingPoints = I;
figure(1)
imagesc(J)
tform = fitgeotform2d(movingPoints,fixedPoints,"projective");
Jregistered = imwarp(flipud(J),tform,OutputView=imref2d(size(J)));
figure(2)
imshowpair(I,Jregistered) I’m trying to reverse a transformation in an image. I have point coordinates in the intrinsic coordinate (moving points) and their equivalent in the real world coordinates (fixed points). When I use the fitgeotform2d and imwarp functions to obtained a dewarped image, I only get an matrix of zeros and size of the original image as output. Here’s the data and the code:
load("calImg.mat")
J = double(calImg);
fixedPoints = W;
movingPoints = I;
figure(1)
imagesc(J)
tform = fitgeotform2d(movingPoints,fixedPoints,"projective");
Jregistered = imwarp(flipud(J),tform,OutputView=imref2d(size(J)));
figure(2)
imshowpair(I,Jregistered) fitgeotform2d, imwarp, image processing, image analysis MATLAB Answers — New Questions