Random rotation of a bunch of points in a known plane

조회 수: 2 (최근 30일)
Daniel Delgado
Daniel Delgado 2011년 5월 5일
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