Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@JStech
Copy link
Contributor

@JStech JStech commented Jan 21, 2024

Fixes to the hand-eye calibration methods, from #24871.

The Tsai method is sensitive to poses separated by small rotations, so I filter those out.

The Horaud and Daniilidis methods use quaternions (and dual quaternions), where $q$ and $-q$ represent the same transform. However, these methods depend on the gripper motion and camera motion having the same sign for the real part. The fix was simply to multiply the (dual) quaternions by -1 if their real part is negative.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake N/A

@asmorkalov
Copy link
Contributor

@JStech Great job! Thanks a lot for the contribution! We need some time to analyze the implementation and understand the fix.

@asmorkalov asmorkalov requested a review from vpisarev January 22, 2024 07:46
@asmorkalov
Copy link
Contributor

@vpisarev @savuor Could you take a look?

@opencv-alalek
Copy link
Contributor

/cc @catree

Copy link
Contributor

@catree catree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of this issue.
Just some quick comments.


@JStech How do these implementations compare wrt. to the ones in MoveIt?

//Rotation axis for Rcij
Mat Pcij = 2*rot2quatMinimal(Hcij);

// Discard motions with rotation too small or too close to pi radians
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.


Mat qgij = rot2quat(Rgij);
if (qgij.at<double>(0, 0) < 0) {
qgij *= -1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, this can be checked with this online tool: https://www.andre-gaschler.com/rotationconverter/

Copy link
Contributor Author

@JStech JStech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review, @catree.

MoveIt Calibration uses crigroup/handeye under the hood. I don't see any condition checking on the Tsai method, so it might be susceptible to the same issue (although they don't use all pairs of poses, just the motions in order). Their Daniilidis implementation uses a dual quaternion function that won't generate a negative real component (because the angle output by the axis-angle function comes from atan2, which only outputs [-pi, pi]).

@JStech
Copy link
Contributor Author

JStech commented Jan 31, 2024

The failed checks aren't related to the changes. Can I retrigger CI somehow?

@JStech
Copy link
Contributor Author

JStech commented Feb 6, 2024

CI is still failing, and it seems unrelated to the patch:

> Task :tests_module:connectedDebugAndroidTest
3443
04:37:48 E/DeviceMonitor: Failed to start monitoring 2195b0157d83
3444

3445
Feb 06, 2024 4:37:09 AM com.google.testing.platform.server.strategy.NonInteractiveServerStrategy run
3446
INFO: Constructing runner from config.
3447
Feb 06, 2024 4:37:10 AM com.google.testing.platform.runtime.android.driver.AndroidInstrumentationDriver configure
3448
INFO: Configuring Android Instrumentation driver: android_instrumentation_runtime {
3449
  instrumentation_info {
3450
Exception thrown during onBeforeAll invocation of plugin com.google.testing.platform.plugin.android.AndroidDevicePlugin.
3451
Failed to install APK(s): /Users/xperience/GHA-Actions-OpenCV/_work/opencv/opencv/build/android_test/tests_module/build/outputs/apk/debug/tests_module-debug.apk
3452
Unknown failure: pkg: /data/local/tmp/tests_module-debug.apk
3453
com.android.ddmlib.InstallException: Unknown failure: pkg: /data/local/tmp/tests_module-debug.apk
3454
	at com.android.ddmlib.internal.DeviceImpl.installRemotePackage(DeviceImpl.java:1315)
3455
	at com.android.ddmlib.internal.DeviceImpl.installPackage(DeviceImpl.java:1141)
3456

🀷

@asmorkalov
Copy link
Contributor

@JStech @catree please ignore Android related failures. OpenCV team works on Android path stabilization now.

@asmorkalov
Copy link
Contributor

@catree Is the PR redy for integration.

@catree
Copy link
Contributor

catree commented May 24, 2024

@asmorkalov Looks good to me πŸ‘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants