Reputation: 33
I have two binary images with some small tracks on them (black and magenta lines), and I'm currently trying to make them match by computing the distance between the pairs in each image (cyan lines). I know that the transformation needed is rigid, i.e. a translation and a rotation from the center of the image.
The problem is that MATLAB's built-in functions that I've tried (fitgeotrans
and estimateGeometricTransform
) use algorithms that include translations, rotations and scaling (geometric transformation) to fit those images. At this point, I have two main questions:
Upvotes: 3
Views: 253
Reputation: 125854
Since you're working with images, the most straightforward option would be to use the imregister
function from the Image Processing Toolbox. Your code would look something like this:
[optimizer, metric] = imregconfig('monomodal');
image1Registered = imregister(image1, image2, 'rigid', optimizer, metric);
If the images are binary (i.e. type logical
), you may need to convert them to another type first, like uint8
.
Upvotes: 2