0

I have rvec, tvec from solve-PnP and RMat (from Rodriques) in OpenCV framework for a given camera. The tvec (z) is accurate as far as depth, that I can tell. Remaining values are from extensive camera calibration (K) routines and the general setup is using non-aruco markers.

I have (1) question: how do I cast a ray from the camera's point of origin perpendicular to the image plane through the principle point along the optical axis?

  • in camera coordinate system, a ray through origin and principal point is just (0,0,d). I think you can just transform hat vector by your extrinsics... – Micka Jul 29 '20 at 17:52
  • normally I transform my world-point with my pose/extrinsics derived from rvec, tvec -- that gives me my point in camera coordinates = [R|t] x world-point. If I want it in pixel coordinates [u,v,1]^T = K [R|T] x world-coordinates. I just don't know how to start. – splitinfiinity Jul 30 '20 at 00:30
  • BTW is d equal to z which equals focal length? (0,0,+z) – splitinfiinity Jul 30 '20 at 00:50
  • d is the free parameter of the ray, so if you continuously increase d you will walk along that ray. (0,0,d) is already worls coordinates, but in camera coordinate base (camera center in (0,0,0) looking along z axis). – Micka Jul 30 '20 at 05:09
  • so would we parameterize that? <0,0,0> + <0,0,d>t. Then t can be used for example for plane equation intercept? Loosely speaking. – splitinfiinity Jul 30 '20 at 15:27
  • yes, exactly. But in camera base coordinate system. So you'll have to either transform that ray to your world coordinate system, or transform your plane to the camera coordinate system (both are just inverse matrix operations) – Micka Jul 30 '20 at 15:31
  • Thats pretty clear re: inverse matrix ops. If I go from world coordinates to camera coordinates I don't invert. But if I go back from Ray to World, I take the inverse. That would assume Ray is already in camera coordinates. Do I have this right? – splitinfiinity Jul 30 '20 at 20:41

0 Answers0