ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

PinholeCameraModel::project3dToPixel is correct?

asked 2016-12-26 08:00:38 -0500

baozhang gravatar image

updated 2018-04-15 14:36:06 -0500

jayess gravatar image

I'm a beginner about camera geometry.

I would like to understand PinholeCameraModel::project3dToPixel function.

PinholeCameraModel::project3dToPixel

I derived uv_rect like below but the formula are a little different from API.

API tells,

uv_rect.x = (fx()*xyz.x + Tx()) / xyz.z + cx();
uv_rect.y = (fy()*xyz.y + Ty()) / xyz.z + cy();

I derived,

uv_rect.x = (fx()*(xyz.x + Tx())) / xyz.z + cx();
uv_rect.y = (fy()*(xyz.y + Ty())) / xyz.z + cy();

Is The unit of xyz.x and Tx() meter? If so, my answer is not wrong.

Could you tell me the deriving process of these formula?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
1

answered 2017-03-22 04:13:43 -0500

Vincent Rabaud gravatar image

updated 2018-04-15 14:36:53 -0500

jayess gravatar image

How do you get to that?

[U V W]^T = P * [X Y Z 1]^T   (X=xyz.x, Y=xyz.y ...)

with P something like:

[[ fx 0 0 Tx]
 [ 0 fy 0 Ty]
 [ 0 0  1 0]]

That gives: u = U/W + cx which is what we have in the code no?

edit flag offensive delete link more
1

answered 2018-04-15 08:32:47 -0500

Hakaishin gravatar image

The function inverts all points at the midpoint so x and y are inverted. This was at least for me very surprising and I sounds wrong to me. So for anybody having a problem with this function try to invert both axis and see if that helps.

edit flag offensive delete link more
1

answered 2017-03-21 20:07:50 -0500

tfoote gravatar image

It's possible there's a bug /transcription error. Can you create a unit test and show it's invalid and see if your solution works correctly? If so I'm sure the maintainer would be interested.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-12-26 08:00:38 -0500

Seen: 1,024 times

Last updated: Apr 15 '18