| 442 | } // namespace |
| 443 | |
| 444 | void BindDatabase(py::module& m) { |
| 445 | py::classh<Database, PyDatabaseImpl> PyDatabase(m, "Database"); |
| 446 | PyDatabase.def_static("open", &Database::Open, "path"_a) |
| 447 | .def("close", &Database::Close) |
| 448 | .def("__enter__", [](Database& self) { return &self; }) |
| 449 | .def("__exit__", [](Database& self, const py::args&) { self.Close(); }) |
| 450 | .def("exists_rig", &Database::ExistsRig, "rig_id"_a) |
| 451 | .def("exists_camera", &Database::ExistsCamera, "camera_id"_a) |
| 452 | .def("exists_frame", &Database::ExistsFrame, "frame_id"_a) |
| 453 | .def("exists_image", &Database::ExistsImage, "image_id"_a) |
| 454 | .def("exists_image", &Database::ExistsImageWithName, "name"_a) |
| 455 | .def("exists_pose_prior", |
| 456 | &Database::ExistsPosePrior, |
| 457 | "pose_prior_id"_a, |
| 458 | "is_deprecated_image_prior"_a = true) |
| 459 | .def("exists_keypoints", &Database::ExistsKeypoints, "image_id"_a) |
| 460 | .def("exists_descriptors", &Database::ExistsDescriptors, "image_id"_a) |
| 461 | .def("exists_matches", |
| 462 | &Database::ExistsMatches, |
| 463 | "image_id1"_a, |
| 464 | "image_id2"_a) |
| 465 | .def("exists_two_view_geometry", |
| 466 | &Database::ExistsTwoViewGeometry, |
| 467 | "image_id1"_a, |
| 468 | "image_id2"_a) |
| 469 | .def("num_rigs", &Database::NumRigs) |
| 470 | .def("num_cameras", &Database::NumCameras) |
| 471 | .def("num_frames", &Database::NumFrames) |
| 472 | .def("num_images", &Database::NumImages) |
| 473 | .def("num_pose_priors", &Database::NumPosePriors) |
| 474 | .def("num_keypoints", &Database::NumKeypoints) |
| 475 | .def("num_keypoints_for_image", |
| 476 | &Database::NumKeypointsForImage, |
| 477 | "image_id"_a) |
| 478 | .def("num_descriptors", &Database::NumDescriptors) |
| 479 | .def("num_descriptors_for_image", |
| 480 | &Database::NumDescriptorsForImage, |
| 481 | "image_id"_a) |
| 482 | .def("num_matches", &Database::NumMatches) |
| 483 | .def("num_inlier_matches", &Database::NumInlierMatches) |
| 484 | .def("num_matched_image_pairs", &Database::NumMatchedImagePairs) |
| 485 | .def("num_verified_image_pairs", &Database::NumVerifiedImagePairs) |
| 486 | .def("read_rig", &Database::ReadRig, "rig_id"_a) |
| 487 | .def("read_rig_with_sensor", &Database::ReadRigWithSensor, "sensor_id"_a) |
| 488 | .def("read_all_rigs", &Database::ReadAllRigs) |
| 489 | .def("read_camera", &Database::ReadCamera, "camera_id"_a) |
| 490 | .def("read_all_cameras", &Database::ReadAllCameras) |
| 491 | .def("read_frame", &Database::ReadFrame, "frame_id"_a) |
| 492 | .def("read_all_frames", &Database::ReadAllFrames) |
| 493 | .def("read_image", &Database::ReadImage, "image_id"_a) |
| 494 | .def("read_image_with_name", &Database::ReadImageWithName, "name"_a) |
| 495 | .def("read_all_images", &Database::ReadAllImages) |
| 496 | .def("read_pose_prior", |
| 497 | &Database::ReadPosePrior, |
| 498 | "pose_prior_id"_a, |
| 499 | "is_deprecated_image_prior"_a = true) |
| 500 | .def("read_all_pose_priors", &Database::ReadAllPosePriors) |
| 501 | .def("read_keypoints", &Database::ReadKeypointsBlob, "image_id"_a) |
no test coverage detected