Skip to content
Snippets Groups Projects
Commit d8f75161 authored by Sebastian Hahta's avatar Sebastian Hahta
Browse files

size() method

parent 64b0a921
No related branches found
No related tags found
No related merge requests found
Pipeline #33865 passed
......@@ -25,6 +25,8 @@ struct Intrinsics
/** Projection matrix */
PY_API Eigen::Matrix3d matrix();
/** Size (width, height) */
PY_API Eigen::Vector2i size();
};
/** Stereo camera intrinsic parameters.
......
......@@ -8,3 +8,7 @@ Eigen::Matrix3d voltu::Intrinsics::matrix() {
0.0, 0.0, 1.0;
return K;
}
Eigen::Vector2i voltu::Intrinsics::size() {
return { width, height };
}
......@@ -13,10 +13,12 @@ class Intrinsics(unittest.TestCase):
fy = 3.0
cx = 4.0
cy = 5.0
w = 6
h = 7
intr = voltu.Intrinsics(
width = 6,
height = 7,
width = w,
height = h,
focal_x = fx,
focal_y = fy,
principle_x = -cx,
......@@ -30,3 +32,8 @@ class Intrinsics(unittest.TestCase):
])
self.assertTrue(np.array_equal(intr.matrix(), K))
w_, h_ = intr.size()
self.assertEqual(w_, w)
self.assertEqual(h_, h)
self.assertTrue(np.array_equal((w, h), intr.size()))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment