Random rotation of a bunch of points in a known plane
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Ashish Uthama
on 6 May 2011
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 Comments
Ashish Uthama
on 6 May 2011
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.
See Also
Categories
Find more on Robotics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!