Skip to content
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

Inaccurate #31

Open
dylan-gonzalez opened this issue Apr 17, 2024 · 9 comments
Open

Inaccurate #31

dylan-gonzalez opened this issue Apr 17, 2024 · 9 comments

Comments

@dylan-gonzalez
Copy link

Hi there,

I have tried using your library on the humble branch, but it appears to be inaccurate by about 20cm.

I am using a ZED2i camera, and giving the rectified image of the right camera lens as input.
FYI when I use the zed_aruco_localization example package, it gives detections with +- 1cm error.

Is there something I should tune?

I am using 6X6_50 dictionary.

@bjsowa
Copy link
Member

bjsowa commented Apr 17, 2024

when using rectified images, make sure to set image_is_rectified parameter to true. I forgot to add this parameter to example config. Let me know if it fixes the accuraccy.

@dylan-gonzalez
Copy link
Author

Ah I have already set that parameter

@bjsowa
Copy link
Member

bjsowa commented Apr 17, 2024

Is the offset from the actual position stable? Are the axes properly aligned with the marker on /aruco_tracker/debug images?

@dylan-gonzalez
Copy link
Author

The offset is stable.
z-axis:

  • detected offset: ~0.15m

x-axis:

  • detected offset: ~0.1m

y-axis:

  • detected offset: ~0.01m

The axes seem aligned
image (1)
image
.

@bjsowa
Copy link
Member

bjsowa commented Apr 18, 2024

How are you estimating the error?

Could you try opening RViz, adding TF display and Camera display (for the rectified images) and checking if the axes are correctly overlayed on the camera images?

@dylan-gonzalez
Copy link
Author

dylan-gonzalez commented Apr 19, 2024

I am estimating the error by measuring with a tape measure the ground truth, and then looking at the output of /aruco_opencv/aruco_detections (the z-axis mainly for now)

In this example, it is off by 10cm. It is reporting 1.26-1.29m when it is actually 1.18m
The axes look to be correctly overlayed.

image

Also the camera appears to be perfectly level horizontally:
PXL_20240419_082903333

PXL_20240419_082855957

@dylan-gonzalez
Copy link
Author

It also does not seem to make a difference if I use rectified or un-rectified images.

@dylan-gonzalez
Copy link
Author

dylan-gonzalez commented Apr 19, 2024

I also noticed that zed_aruco_localization have a refine parameter that I think uses the corners of the marker to improve detection. I noticed that when I turn this parameter off, I get pretty much the same result as ros_aruco_opencv, and when it is turned on I get an error of only ~3cm.

Ah, I have found that setting this parameter to "1" (for subpixel mode) makes it accurate for my example to ~1.5cm !

But for distances at around 2m, I am now getting ~10cm error. But increasing the resolution to 1080 reduces the error back to ~2cm. So I guess it is more or less fine tuning parameters.

Edit: looks like I might have misspoke. I didn't realise that but markers are 0.15m, not 0.16m (could have sworn I printed them out as such). Pose estimation is relatively accurate at a distance of around 1m, but drops off significantly approaching 2m.

@bjsowa
Copy link
Member

bjsowa commented Apr 19, 2024

Ah, I have found that setting this parameter to "1" (for subpixel mode) makes it accurate for my example to ~1.5cm !

That's interesting! I used the contour corner refinement as it resulted in more stable positions and was (I think) faster. I never actually measured the pose accuracy though. If you are using subpixel refinement, you can also experiment with cornerRefinementWinSize, cornerRefinementMaxIterations and cornerRefinementMinAccuracy parameters as they are applicable in this case.

But for distances at around 2m, I am now getting ~10cm error. But increasing the resolution to 1080 reduces the error back to ~2cm. So I guess it is more or less fine tuning parameters.

This package just passes the images and detection parameters to OpenCV library that's installed on the system, so I don't have much influence on the algorithms it uses. Though, with enough feedback, I might come up with better default detection parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants