How to perform image registration on non-rectangular image
10 views (last 30 days)
Show older comments
I'm interesting in peforming image registration using imregtform on a non-rectangular region of interest that would be the "moving" image. Is there any way to do this? I initially tried to turn all the pixels within the "moving" image matrix that I don't want to affect registration to NaNs, but the imregtform function won't accept that input.
2 Comments
Biral Pradhan
on 3 Jun 2022
I understand, you have a non-rectangular region of interest in a rectangular image, and you want to use "imregtform" it. Could you try converting all the other pixels to "black" colour instead of NaN?
Answers (2)
Matt J
on 6 Jun 2022
Edited: Matt J
on 6 Jun 2022
If you have the Optimization Toolbox, you could use lsqcurvefit (don't be misled by the name) to minimize your own reigstration cost function, one which accepts an ROI mask.
5 Comments
Matt J
on 1 Aug 2022
Edited: Matt J
on 1 Aug 2022
What is usually done to improve robustness is that you first smooth and downsample the images and perform an initial registration. Then you reduce the smoothing and repeat the registration with the previous registration result as your initial guess. This is repeated until the registration is done at full resolution.
Image Analyst
on 1 Aug 2022
Is it rotating and scaling while it translates? If not, you could use normalized cross correlation. See attached demo.
Or try one of the panoramic stitching algorithms. They find matching regions, which is necessary to construct the overall image.
5 Comments
Matt J
on 11 Aug 2022
Does this seem like a reasonable solution or am I missing something that could be problematic?
I can't argue with success, but I vaguely wonder why setting the background pixels to some constant wouldn't do the same thing. An atomic distribution is independent of every distribution as well.
See Also
Categories
Find more on Geometric Transformation and 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!