存档

文章标签 ‘Least Square’

计算机视觉基础练习(二)Compute the Fundamental Matrix from two simulated cameras

2010年4月10日 2 条评论

基于计算机视觉基础练习(一)的进一步练习(练习仍然来自于Erasmus Mundus Vision and Robotics () program)

参考资料可以仍然用Computer vision: algorithm and applications,draft March 24 2010, chapter 2.1.5

stereo vision system

 

epipolar geometry

由于练习描述比较长,就不直接贴在帖子里了。请下载练习:

cvexercise2questions

参考report:

cvexercise2 report

参考matlab code (因为仍然是贴在pdf中的,所以同样注意换行错误):

cvexercise2code

enjoy!!!!

计算机视觉基础练习(一)camera calibration

2010年4月7日 10 条评论

决定发几个原来上课时候做的一些小练习,感觉对计算机视觉入门挺有帮助的,希望感兴趣的童鞋可以自己试一试。(练习来源于Erasmus Mundus vision and robotics () program)

参考书籍可以用前些天发的一个帖子推荐的那本书,Computer vision: algorithm and applications,draft March 24 2010, chapter 2.1.5。自己稍微翻看了一下这本书,相当相当不错,非常非常与时俱进。。。同推荐一下。。。

Calibrate a simulated camera

Description: Calibrate a simulated camera. Construct the transformation matrix from a set of
parameters. Get and points. Calibrate by using the method of . Check the accuracy
against the increase of noise in the image points.
Programming platform:
Part 1
Step 1. Define the intrinsic parameters and extrinsic parameters with the following values:
au=557.0943; av=712.9824; u0=326.3819; v0=298.6679;
f=80 mm.;
Tx=100 mm.; Ty=0 mm.; Tz=1500 mm.;
Phix=0.8*pi/2; Phiy=-1.8*pi/2; Phix1=pi/5; Euler XYX1
Image size:640×480
Step 2. Get the intrinsic and extrinsic transformation matrices
Step 3. Define a set of 3D points in the rang [-480:480;-480:480;-480:480]. Note the points
should be non-linear and non-coplanar. At least you need to define a set of 6 points. It’s not
necessary to demonstrate mathematically the non-linearity/non-coplanarity, just define 6 points
randomly in the 3D space.
Step 4. Compute the projection on the image plane by using the camera transformation matrix.
Do not remove the subpixel precision of the obtained points.
Step 5. Open a window in matlab which will be used as the image plane and draw the 2D
points. Are the points well spread in the image plane? Will the distribution of points in the image
affect the accuracy in the computation?
Step 6. By using the points of Step 3 and their projection obtained in Step 5, compute the 3×4
transformation matrix by using the method of Hall.
Step 7. Compare the matrix obtained in Step 6 to the one defined in step 2.
Step 8. Add some to the 2D points producing discrepancies between the range
[-1,+1] pixels for the 95% of points. Again repeat step 6 with the noisy 2D points and the ones
defined in step 3. Compare the obtained matrix to the one you got in step 6 with the non-noisy
points.
Step 9. Increase the number of 3D points up to 10 points and then up to 50 points and repeat
step 8. More the points we use more accurate is the matrix obtained.
Part 2.
Step 10. Define the vector X of the method of Faugeras. Compute X by using both leastsquares
(LS) and Singular Value Decomposition () by using the points of step 3 and 4,
without noise. Extract the camera parameters from both computations. Compare the obtained
parameters with the ones defined in Step 1.o
Step 11. Add Gaussian noise to the 2D points (produce noise so that the 95% is in the rang
[-1,1], then in the rang [-2,2] and finally in the rang [-3,3] ) and compute vector X (repeat step
10) for each rang. Which are the parameters more influenced by noise? Which method of
computation is more accurate (LS or SVD)? Which method is more accurate (Faugeras or Hall)
with such noise?
Part 3.
Step 12. Open another window in matlab and draw the world coordinate system, the camera
coordinate system, the focal point, the image plane, and both 3D points and their corresponding
projections on the image plane by using the parameters of step 2 and points without noise.
Check if camera position corresponds to (tx, ty, tz) defined in step 2. Check if all the
cross at the focal point? Check if 2D points lie on the optical rays defined by the 3D points?

由于练习来自于原来上课的练习,所以有些符号,例如au,av之类是跟据当时课件定义的。如果有些童鞋对这些符号不清楚,可以参考附件中的report。

camera calibration report:实在找不到当时写的完整的report了,只找到了这个draft。将就用一下吧,的确是有问题的,比如step11就完全没有写,而且连图都没有,囧!不过后面我会上传全部的matlab code,不清楚话可以看code。希望之后的一些练习能找到完整的report。

MATLAB CODE:

matlab code for camera calibration

尝试上传.m格式和.rar格式的文件不成功,只好把code粘到了pdf里,大家用的时候小心换行造成的错误。。。有谁知道该怎么解决这种上传的问题啊?