Random rotation of a bunch of points in a known plane
2 次查看(过去 30 天)
显示 更早的评论
I have a bunch of points that represent the projection of 3D points (position of a robot claw simulated with Robotic Toolbox) in a camera located in the (0,0,0) of the robot (used The Epipolar Geometry Toolbox to do it), so in the end I just have a 2D plane with randomly located points (a merge of all the pictures). I need to make a random rotation and translation to that plane to test an script a made to calculate the that transformation and then the calibrate the camera position against real position of my robot. Any advice you can give me? Thanks in advance
0 个评论
回答(1 个)
Ashish Uthama
2011-5-6
Maybe this gives you some ideas on how to start:
% Generate N random points on a plane
N = 100;
x = rand(1,N);
y = rand(1,N);
z = ones(1,N);
plot3(x,y,z,'k*');
hold on;
% Rotate by rotation of approximately -74° around the axis (?1?3,2?3,2?3)
% in three-dimensional space - http://en.wikipedia.org/wiki/Rotation_matrix
rotationMatrix = ...
[ 0.36 0.48 -0.8
-0.8 0.60 0
0.48 0.64 0.60];
transformedPoints = rotationMatrix*[x; y; z];
tx = transformedPoints(1,:);
ty = transformedPoints(2,:);
tz = transformedPoints(3,:);
plot3(tx,ty,tz,'b*');
% Rotate the figure to visualize better
rotate3d('on');
hold off;
2 个评论
Ashish Uthama
2011-5-6
I guess you meant 'cant use the rotation matrix'?. Are you trying to find the rotation matrix given the original set of points and the rotated/translated set of points (like a mean square fit)? You might want to edit your question to add more information/sample code.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Robotics 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!