I want to use matlab function robusfit for calculating transformation parameters. I have set of matched points from sift, X = [x1,y1 ....xn,yn] and y = [x1,y1....xn,yn]. How do i use the function for it?
Thanks in advance.
I should have realized what you meant at first. I don't know much about image registration, but perhaps this will have some analogy to what you want. Let me start with a set of points in two dimensions.
>> xy1 = rand(20,2);
Now I generate another set of points from these by linear transformation plus a little bit of noise in both the x and y coordinates.
>> xy2 = xy1 * [2 -1;3 -.5]; >> xy2(:,1) = xy2(:,1)+10; >> xy2(:,2) = xy2(:,2)-5; >> xy2 = xy2 + randn(size(xy2))/100;
I can use backslash to recover the additive and multiplicative constants.
>> B = [ones(20,1) xy1]\xy2 B = 10.0014 -4.9991 1.9839 -1.0092 3.0116 -0.4919
If my data had outliers I might prefer robust fitting. Here's how I can compute a robust estimate of the two columns of coefficients above.
>> robustfit(xy1,xy2(:,1)) ans = 10.0024 1.9831 3.0106 >> robustfit(xy1,xy2(:,2)) ans = -4.9992 -1.0083 -0.4932
Sorry if this bears no relation to what you want.
Play games and win prizes!Learn more