Image Registration step by step
Show older comments
Hi
I want to add my own transformation type for an image registration(differing from affine or rigid). Does anyone have step by code for registration in which this is possible? Also i had like to implement my own similarity measure. Tips or code anyone? It is for contourtracking in greyscale images.
grtz
Rob
Accepted Answer
More Answers (4)
yes but i'd like to see a basic code on how to do this.
The most basic way you could implement your own SSD registration is as follows.
ssd=@(z)norm(z(:))^2;
fun=@(parameters) ssd(imtransform(Image1,...more arguments...) -Image2);
transformParameters = fminsearch(fun,options);
If you have many parameters (more than 6), you won't get very robust convergence with fminsearch. You could instead use a solver in the Optimization Toolbox if you have it. In the latter case, though, you should be careful to apply imtransform with spline interpolation, since the cost function needs to be differentiable.
The Optimization Toolbox solvers could be somewhat slow if you let them use finite difference derivative calculations (the default). You can supply your own cost function gradient computation, with some work using custom interpolants in MAKERESAMPLER.
Image Analyst
on 31 Oct 2013
0 votes
You're free to write your own customized function that registers images according to any wild and crazy function that you want. How can I have step by step code for doing some kind of registration for some unknown method? You must have something in mind because you clearly don't like any of the built in methods, so just go for it.
5 Comments
Image Analyst
on 31 Oct 2013
rob's "Answer" moved here since it's really a comment, not an answer:
*Hi
Good point. I like the current functions But for example where there is in a translation a translation matrix which transforms the image i'd like to be able to put in different matrices whom transform the images differently. using functions on the x and y coordinates instead of linear transformation.*
Image Analyst
on 31 Oct 2013
rob, there is a function imtransform that can translate or rotate an image, but again it's standard functions that you don't want. So you're free to use bizarre, non-standard, non-linear, non-polynomial transforms if you want, you'll just have to write them yourself.
rob
on 31 Oct 2013
Image Analyst
on 31 Oct 2013
Well why do you think you need something different than the standard methods in the first place? What's wrong with them?
rob
on 31 Oct 2013
Alex Taylor
on 31 Oct 2013
Edited: Alex Taylor
on 31 Oct 2013
0 votes
I would just add a few things:
1) Can you elaborate on what kind of transform model you want to use instead of rigid? Are you trying to do some sort of deformable model registration?
2) What kind of similarity model do you want to use?
3) Is the transformation model that you want to use provided by imregister/imregtform? imregister and imregtform implement sum of square differences and Mutual Information as similarity metrics and offer translation, rigid, similarity, and affine transformation models?
4) Note that in Matt's answer, if the type of transformation you want to use isn't supported by any of the built-in transformations in maketform, you are going to need to use the 'custom' option in maketform to define your own custom geometric transformation.
Ibraheem Al-Dhamari
on 9 Jul 2015
0 votes
Check this! it is a code from a PhD thesis in registration. https://sites.google.com/site/myronenko/research/mirt
Categories
Find more on Geometric Transformation and Image Registration in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!