You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by StardustLu February 16, 2022
Dear all,
I try to calculate corresponding points coordinates in world coordinate system with RGBD image, but the result is not good. If I understand it right, the pos in airsim should have no error. So what's wrong with my calculation ?
I set intrinsic parameters with #issue269;
I set extrinsic parameters with airsim_rec.txt
here's my calculation codes:
importnumpyasnpfromscipy.spatial.transformimportRotationdefcalPworld(u, v, d, q, t):
fx=959.661112fy=959.693478cx=959.385435cy=539.533360# X Y Z Wr_mat=Rotation.from_quat(q)
R=np.array(r_mat.as_matrix())
T=np.array([t]).transpose()
Z=dX= (u-cx) *Z/fxY=- (v-cy) *Z/fycp=np.array([[X], [Y], [Z]])
returnnp.dot(R.transpose(), cp-T)
where :
q denotes (Q_X, Q_Y, Q_Z, Q_W) in airsim_rec.txt
t denotes (POS_X, POS_Y, POS_Z) in airsim_rec.txt
d denotes depth in depth image
u,v denotes pixel coordinate in RGB image
here is my settings.json to record the RGBD image (the depth image seems to be fixed in 256 x 144):
I can't find depth metric which seems to be a little different with issue#1054. I test it and find the scale factor seems to be 100. So the depth of these corresponding points are 55.029296875 and 46.2890625.
But the results seem to be far away from each other: P1(-79.48, 74.04, 98.77), P2(-51.52, 88.38, 90.03)
What's wrong with my calculation?
The text was updated successfully, but these errors were encountered:
Thanks for your reply :)
I did nothing with the RGBD image
I just edit settings.json and record them, then I calculate the correspondence by RGBD image and extrinsic parameters in airsim_rec.txt
Discussed in #4355
Originally posted by StardustLu February 16, 2022
Dear all,
I try to calculate corresponding points coordinates in world coordinate system with RGBD image, but the result is not good. If I understand it right, the pos in airsim should have no error. So what's wrong with my calculation ?
I set intrinsic parameters with #issue269;
I set extrinsic parameters with airsim_rec.txt
here's my calculation codes:
where :
q
denotes (Q_X, Q_Y, Q_Z, Q_W) in airsim_rec.txtt
denotes (POS_X, POS_Y, POS_Z) in airsim_rec.txtd
denotes depth in depth imageu,v
denotes pixel coordinate in RGB imagehere is my
settings.json
to record the RGBD image (the depth image seems to be fixed in 256 x 144):eg. set a pair of corresponding points:
p1(214, 280), p2(654, 280)
, and the pos recorded in airsim_rec.txt :I can't find depth metric which seems to be a little different with issue#1054. I test it and find the scale factor seems to be 100. So the depth of these corresponding points are
55.029296875
and46.2890625
.But the results seem to be far away from each other:
P1(-79.48, 74.04, 98.77), P2(-51.52, 88.38, 90.03)
What's wrong with my calculation?
The text was updated successfully, but these errors were encountered: