Closed xiahaa closed 5 years ago
When you finished, tell me. Then we will combine feature detection, matching, RANSAC and DLT.
I already finished warp.
I already finished warp.
ok. Then you need to implement a RANSAC framework for homography estimation. You have all the information you need on the slides I gave you. So you can start right now. However, if you are not clear about what to do exactly. I will provide you some information perhaps this night.
After this, tell me again your progress.
Ok i will try to do it now.
Ok i will try to do it now.
for better results, you need to add the following issues:
see updated docs.
Do normalization and RANSAC.
When you finish, tell me.
You are approximating the finishing line. Bon courage.
see results:
Once you have done the normalization and ransac homography estimation. You should combine all things together.
Actually it's still unclear for me to combine RANSAC and Hest. function ||x2−Hx1||+||x1−H^(-1)x2|| is that a function to calculate for what distance? In my mind, When i choose 4 points from matching pairs, I should calculate distance as before i do. or i just use this function?
Actually it's still unclear for me to combine RANSAC and Hest. function ||x2−Hx1||+||x1−H^(-1)x2|| is that a function to calculate for what distance? In my mind, When i choose 4 points from matching pairs, I should calculate distance as before i do. or i just use this function?
so for ransac, what you need?
In my mind, i should use every ransac for each H matrix, like if i choose 500 times random correspondences and then get 500 numbers of H matrix, i will use RANSAC function for 500 times, But in this way my computer always calculate for a long time, so that's why i'm confusing. Maybe i should just choose only one H matrix and then go to ransac?
In my mind, i should use every ransac for each H matrix, like if i choose 500 times random correspondences and then get 500 numbers of H matrix, i will use RANSAC function for 500 times, But in this way my computer always calculate for a long time, so that's why i'm confusing. Maybe i should just choose only one H matrix and then go to ransac?
see my answer.
I upload the unfinished code. I think the problem is still in distance. Cause when i use H to all data, there are a loop in original loop , so maybe i have a misunderstanding in this metric.
I upload the unfinished code. I think the problem is still in distance. Cause when i use H to all data, there are a loop in original loop , so maybe i have a misunderstanding in this metric.
for i=1:iter ????? why i:iter????
a=H* X1(:,i);
b=inv(H)*X2(:,i);
distance(:,i)=norm(X2(:,i)-a)+norm(X1(:,i)-b);
end
shouldn't it be
for i = 1:number1
a = H*X1(:,i);
b = inv(H)*X2(:,i);
distance(:,i)=norm(X2(:,i)-a)+norm(X1(:,i)-b);
end
no need for loop since you are using homogeneous cooridnates
X1t = H*X1;
X2t = H\X2;
X1t = X1t./X1t(3,:);
X2t = X2t./X2t(3,:);% make 3rd coordinate being one. Why? Think about this.
distance = sqrt(diag((X1t - X1)'*(X1t - X1)))+ sqrt(diag((X2t - X2)'*(X2t - X2))); % why this? think about this.
I still have question in distance, i plan to ask you tomorrow afternoon cause i have a class in the morning,
I still have question in distance, i plan to ask you tomorrow afternoon cause i have a class in the morning,
ok.
@xiaohanlyu 这个老师Christensen, David Johan以前有门课程叫什么modular robotics什么的,好像还挺有意思的。不过他离职去创业了。
To improve your interest, I suggest take some images using your phone, e.g. DTU 101 if you like?, and then make your own panorama. The tips for taking images:
I create a new folder for my stitching codes. It seems inliers is ok but there has an error in Warp function. Maybe that's because my H matrix? I can't find bug now.
idx1 = randperm(number1,mini);
x1 = X1(:,idx1);
[T1,x1h] = normalization(x1);
Why add this idx2 = randperm(number2,mini);x2 = X2(:,idx2);
?
X1 X2已经成对了,你随机采样了x1,那么对应的x2就出来了。
你对二者都随机采样,不就打破了对照关系了么,那还能估计正确的H么?
第二个bug
distance = sqrt(diag((X1t - X1)'*(X1t - X1)))+ sqrt(diag((X2t - X2)'*(X2t - X2)));
X1t = HX1
那么X1t是和X2对应,你又把X1t和X1做差,这是什么意思?
It seems that you still have some problems with understanding RANSAC~
现在我对ransac的理解:随机取一对比较对的坐标x1,x2,把x1进行homograph变换, 将变换后的坐标x1'与x2做差,寻找可以使最多变换后的坐标x1'接近原比较对中的x2的H矩阵. 这样对吗?
我拍了图书馆的照片,但是运行速度太慢,就没继续下去
现在我对ransac的理解:随机取一对比较对的坐标x1,x2,把x1进行homograph变换, 将变换后的坐标x1'与x2做差,寻找可以使最多变换后的坐标x1'接近原比较对中的x2的H矩阵. 这样对吗?
比如你哪天遇到一个问题,是x3 + Hx1 - x2 = 0,那么x'是x1+x1对应的x2+x1对应的x3。
将变换后的坐标x1'与x2做差,寻找可以使最多变换后的坐标x1'接近原比较对中的x2的H矩阵. 这样对吗?
要掌握原理,不是死记这个式子。还是这个例子x3 + Hx1 - x2 = 0,那么假如你算了一个H,怎么再去计算一个metric判断:对于当前的H,某一个x'={x1 x2 x3}是不是inlier? 你要把metric设计成x3 + Hx1 - x2。
我拍了图书馆的照片,但是运行速度太慢,就没继续下去
imresize,downsize一下你的图像。 你手机拍的应该在2000万像素,太大了。
这个poisson blending可以做无缝的图像融合。 好像ps里面的智能剪刀后面就是这个算法。 跟课程没啥关系,你感兴趣就自己找几个图片试试。
@xiaohanlyu Homography and other two view geometry may be a little bit complex for you. So it is a good idea that you read the lecture note of UiO in advanced.