-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Planar object pose estimation from RGBD #671
Conversation
@ksyy tried your changes. At the moment, we have an issue when the angle between the tag normal and the camera normal is close to 90 degrees. In this case, the extracted depth information does not belong to the tag. This is a registration issue. We will redo the experiments with calibration of the depth extrinsic parameters when we have some time. Our tests at the moment have not been thorough enough to say whether this method works better than the RGB one. Except for the extreme case above, we couldn't find any obvious pitfalls. I will keep you updated when we go further. |
Thanks for the feedback. |
We are using an Orbbec Astra Pro installed in a TALOS robot. |
The color and depth images are not synchronized. This may be the reason of the depth issue above. We are waiting for a new camera (new January) which shouldn't suffer this issue. Sadly, with my current simulation setup, I use RViz to generate the images and it does not provide a depth image. I opened lucasw/rviz_camera_stream#27 some time ago but did have time to implement it. |
@s-trinh I introduced an example to be able to test |
This is the code I used. It is better to display in two different images. code
It is not easy to reproduce it until you manage do it. One way is to display this image, zoomed on a monitor. With the sensor in a region at the right of the tag (looking at the center of the tag), at some point you can find a pose where the z-axis will flip continuously. Another option should be to print a tag but make it so that it is not flat anymore. |
- rename vpPose::computePoseRGBD() into vpPose::computePlanarObjectPoseFromRGBD() - introduce doc - update tutorial to display estimate pose with and without using depth - consider the case where z_aligned parameter is modified by the user
… 3D points used to compute the equation of the tag 3D plane
@s-trinh Ready to merge on my side |
@fspindle I will have a look. Did you manage to reproduce the issue? |
Yes I was able to reproduce the issue displaying this image on my screen. No feedback from other people |
\param[in] colorIntrinsics : Camera parameters used to convert \e corners from pixel to meters. | ||
\param[in] point3d : Vector of 3D points corresponding to the model of the planar object. | ||
\param[out] cMo : Computed pose. | ||
\param[out] confidence : Pose estimation confidence index in range [0, 1]. When values are close to zero |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the word confidence
. It looks too simplistic to use the depth filling ratio as a confidence measure.
I don't have recent experience with the method. If you have introduced it because you encountered sometimes bad estimated pose with this method, I would propose to reword the parameter. I don't have a good proposition though (depth filling ratio?, depth data percentage?).
There are also the M-estimator weights that should give some information.
And maybe also the plane fitting error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on my experience, the "depth filling ratio" or better named the normalized number of depth data covering the tag is useful to detect when the depth sensor is occluded or partially occluded or when there are wholes in the depth map.
I agree that this is too simple to be a good confidence indicator.
A good compromise that I found is to compute the confidence index as the product between between the normalized number of depth data covering the tag and the normalized M-estimator weights returned by the robust estimation of the tag 3D plane. Results that I obtained sound good.
\return true if pose estimation succeed, false otherwise. | ||
*/ | ||
bool vpPose::computePlanarObjectPoseFromRGBD(const vpImage<float> &depthMap, const std::vector<vpImagePoint> &corners, | ||
const vpCameraParameters &colorIntrinsics, const std::vector<vpPoint> &point3d, vpHomogeneousMatrix &cMo, double &confidence) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the estimated poses with this method reliable from your tests?
Generally, I don't like having to pass too much parameters. If confidence
is necessary to evaluate if the estimated pose is valid, keep it otherwise I would suggest using something like double *good_parameter_name=NULL
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is very difficult to make appear the z-axis flipping phenomena using a real tag with the Realsense D435. I succeed by crumping the tag and observing a very small tag in the image.
As mentioned in a previous discussion, this phenomena occurs also displaying this image on my screen and detecting the upper right tag with the Realsense.
In both cases, results obtained with this method were reliable.
Ok passing a pointer.
I think that:
Anyway, for
Size of ouput of With something like:
|
@@ -251,6 +251,7 @@ class VISP_EXPORT vpDetectorAprilTag : public vpDetectorBase | |||
std::vector<vpHomogeneousMatrix> &cMo_vec, std::vector<vpHomogeneousMatrix> *cMo_vec2=NULL, | |||
std::vector<double> *projErrors=NULL, std::vector<double> *projErrors2=NULL); | |||
|
|||
std::vector<std::vector<vpPoint> > getPoint3D(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current getPoint3D()
will not work if getPose()
is used.
Also, it requires to actually compute the tags pose while the 3D tag coordinates can be computed easily.
I suggest to add getPoint3D()
independant of the pose computation machinery in vpDetectorAprilTagDetector
.
This would allow using getTagsCorners()
introduced in #680 to compute the pose with OpenCV or any other library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I will do the changes
Co-Authored-By: s-trinh <[email protected]>
…into test_pose_from_RGBD
See #668
/cc @jmirabel
If you want to test to see if the tag pose estimation is better.
depthMap
is aNxM
image that contains depth. The depth map must be registered with the color image (same image size, same(u,v)
coordinates in the depth map represents the same physical element in the color image)corners
are the fours tag corners detected in the color imagecolorIntrinsics
are the color intrinsic parameters (that are equal to the depth intrinsic parameters since the depth map is registered with the color image)tagSize
is the tag size wheretagSize/2
represents the half tag sizecMo
the estimated tag poseAnd then you can do:
For my tests, I used the RealSense sensor that allows getting directly the depth map registered with the color image. It is also much simpler for the code.
I don't know how you will get the depth information and you may need to register the depth map with the color image manually. It should be something like:
(u,v)
compute(Xd,Yd,Zd)
using the depth intrinsics and the depth information(Xc,Yc,Zc)
into the image plane to get the corresponding color(u,v)
coordinateIf the fov of the depth sensor is bigger than the one of the color sensor, you should not get too much holes in the registered depth map.