transformation parameter estimation using robusfit()

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.

댓글 수: 2

I don't understand. It looks like you are saying that X and y are the same. In general, if X is a matrix of predictors (inputs) and y is a vector of responses (outputs), you would use robustfit(X,y).
Hi Tom, Thanks for your reply. I am doing image registration, i am getting matched points in image1 & image2. the point set are, say P1 = [x1, y1;...;xn,yn] & P2 = [x1, y1;..;x1, y1]. Now i want to calculate transformation parameters from these points using re-weighted least square, is there any function in matlab for this, if yes how do i use it. if not please guide me on how can i go about doing this. Please help.
Thanks in advance.

댓글을 달려면 로그인하십시오.

 채택된 답변

Tom Lane
Tom Lane 2013년 5월 30일

1 개 추천

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.

댓글 수: 4

Prateek
Prateek 2013년 5월 30일
편집: Prateek 2013년 5월 30일
Hi Tom,
Thanks for such a quick reply, Can you please explain
"I can use backslash to recover the additive and multiplicative constants."
what do you mean by additive and multiplicative? How would you tell which element of 3x2 matrix is what if you had not given those parameters manually?
What is the relation between linear transformation matrix you used in lines :
>> xy2 = xy1 * [2 -1;3 -.5];
>> xy2(:,1) = xy2(:,1)+10;
>> xy2(:,2) = xy2(:,2)-5;
and the coefficients you got, after robustfit!!
If these are the correct transformation parameters of the transformation matrix you gave then, i think i can do the reverse as well, to get the transformation parameters using re-weighted least square. Am i right?
Thanks your reply was really helpful.
Tom,
Also take this problem as normal problem of finding transformation parameters from two set of points, image registration by itself doesn't play a major role in this scenario. :)
The robust function adds a constant term automatically, and you'll notice that I included a column of "ones" in the backslash expression. So in both cases (first row of B, first entries on robustfit) you should see that the estimates are close to the 10 and -5 I added. That's what I meant by the "additive constants."
You should see that the remaining part of B is close to the [2 -1;3 -.5] transformation matrix I used. That's what I meant by the "multiplicative constants."
You could reverse this and go backwards from xy2 to xy1 if you want.
I get it. It makes the problem clear now.
So i think i have got my answer, Let me try this out once and i'll let you know the results, which might be useful for others who are seeking a similar solution.
thanks again.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

제품

질문:

2013년 4월 27일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by