Random rotation of a bunch of points in a known plane
이전 댓글 표시
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
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
2011년 5월 6일
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.
카테고리
도움말 센터 및 File Exchange에서 MATLAB Support Package for USB Webcams에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!