Pinhole camera model with rotation

11 visualizaciones (últimos 30 días)
caesar
caesar el 30 de En. de 2020
Editada: caesar el 30 de En. de 2020
I am facin aproblem regarding the use of pinhole camera model in Matlab. The problem is : what are the changes that must be applied to the general pinhole model equations in the case where the camera is rotated around any axis. For instance I have a camera with 40 mm focal lenght, 36*24 mm phtsical dimentions and the output image is 600* 400 pixels. From image1, i can easily find the pixels related to the point E, that is the centre of the image about 1500 mm from the cam. I can do that using the following code :
camx=112570 ;
camy=-613080;
camz=900;
x=111070 ;
y=-613080;
z=900;
if camy>y
F=-40;
else
F=40;
end
% in millimetere
Pixelox=300;
Pixeloy=200;
Pixelx=0.06 ;
Pixely=0.06;
K=[F/Pixelx 0 0;0 F/Pixely 0;Pixelox Pixeloy 1];
R= [-1 0 0;0 0 -1;0 1 0];
t=[camx camy camz ];
P=[eye(3);-t]*R*K;
tem= [x y z 1]*P;
w=tem(1)/tem(3);
in case when i want for example wanted to rotate the cam 20 degrees around z-axis just as in image 2, how should that 20 degrees incorporated in the rotation matrix?
Although I dont know what is [x y z] of point E after rotation whcih i have asked many forums so far about, the case still valid as finding the pixels position required changes on the camera extrinsics matrix.
the original quetion i had before was here and recent problems of coordinations is posted in here and here.
Image1
Image 2

Respuestas (0)

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by