1

I'm trying to use the PETS 2009 S2 L1 Dataset for some multicamera pedestrian detection framework.

I'm using the common ground plane assumption for all the cameras so I need to project all the views to the same z = 0 ground plane.

PETS 2009 gives camera calibration parameters in terms of Tsai parameters like the following:

    <?xml version="1.0" encoding="UTF-8"?>
<Camera name="View_001">
    <Geometry width="768" height="576" ncx="7.9500000000e+02" nfx="7.5200000000e+02" dx="4.8500000000e-03" dy="4.6500000000e-03" dpx"5.1273271277e-03" dpy"4.6500000000e-03"/>
    <Intrinsic focal="5.5549183034e+00" kappa1="5.1113043639e-03" cx="3.2422149053e+02" cy="2.8256650051e+02" sx="1.0937855397e+00"/>
    <Extrinsic tx="8.2873214225e+02" ty="-3.1754796051e+03" tz="3.5469298547e+04" rx="2.0405458695e+00" ry="-8.9337703748e-01" rz="-4.3056124791e-01"/>
 </Camera>

I'm having a few problems converting the Intrinsic and Extrinsic parameters to a single 3x3 ground homography matrix.

Almost all links that I found with C++ sample code (as the one in the official PETS website) were dead and I had no luck finding any useful information.

Any help would be appreciate.

Alex
  • 61
  • 8

1 Answers1

0

Here is teoretical explanation of Tsai calibration parameters. I would convert that to openCV matrices and then compute homography.

http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/DIAS1/

Instruction how to change calibration to homography is posted in similar topic:

https://stackoverflow.com/a/10750648/8682088

And better formatiing

https://dsp.stackexchange.com/a/2592

Kamil Szelag
  • 708
  • 3
  • 12
  • As far as I know openCV only allows you to compute homographies with a set of source and destiny points. So, there is no way to use rotation and translation matrices to compute the homography. [OpenCV Homography Link](http://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html?highlight=findhomography#findhomography) – Alex Sep 29 '17 at 10:32
  • Here is link to homography definition and discussion. It is hard to decompose homography matrix, but relatively easy to compute one https://dsp.stackexchange.com/a/1854 – Kamil Szelag Sep 29 '17 at 10:50
  • I tried that formula as well as H = lambda * K[r1, r2, T] with K Camera Matrix, r1 and r2 rotation vectors and T translation vector but it is not working. – Alex Sep 29 '17 at 11:41
  • That post really help me, however I do not know which kind of homography it is computed with that. I need the homography that projects an image to the ground plane and I think that it is not the one I am getting but thanks a lot anyway – Alex Oct 02 '17 at 14:21