Skip to content

Commit

Permalink
Add bindings for computePlanarObjectPoseFromRGBD
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFlt committed Nov 25, 2024
1 parent e8c6ee6 commit f7c0ce8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
12 changes: 12 additions & 0 deletions modules/python/bindings/include/vision.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ void bindings_vpPose(py::class_<vpPose, std::shared_ptr<vpPose>> &pyPose)
[](vpPose &self, vpPose::vpPoseMethodType method, vpHomogeneousMatrix &cMo) -> bool {
return self.computePose(method, cMo);
});

pyPose.def_static("computePlanarObjectPoseFromRGBD",
[](const vpImage<float> &depthMap, const std::vector<vpImagePoint> &corners,
const vpCameraParameters &colorIntrinsics,
const std::vector<vpPoint> &point3d) -> std::tuple<bool, vpHomogeneousMatrix, double> {
double confidence = 0.0;
vpHomogeneousMatrix cMo;
bool valid = vpPose::computePlanarObjectPoseFromRGBD(depthMap, corners, colorIntrinsics, point3d, cMo, &confidence);
return std::make_tuple(valid, cMo, confidence);
});


}


Expand Down
10 changes: 9 additions & 1 deletion modules/python/config/vision.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@
]
},
"vpPose": {
"additional_bindings": "bindings_vpPose"
"additional_bindings": "bindings_vpPose",
"methods": [
{
"static": true,
"signature": "bool computePlanarObjectPoseFromRGBD(const vpImage<float>&, const std::vector<vpImagePoint>&, const vpCameraParameters&, const std::vector<vpPoint>&, vpHomogeneousMatrix&, double*)",
"ignore": true,
"custom_implem": true
}
]
}
}
}

0 comments on commit f7c0ce8

Please sign in to comment.