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

回答(1 个)

Ashish Uthama
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 个评论
Daniel Delgado
Daniel Delgado 2011-5-6
Thanks my friend the problem is that I can use the rotation matrix because that's the unknown variable for me. If I use that matrix you gave me my script result is gonna be the same one or very similar due to my calculations. The main objective of my script is to identify the matrix that describe the position error of those points I know and the points I really see in the camera.
Ashish Uthama
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 CenterFile Exchange 中查找有关 Robotics 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by