Recover pose from different cameras#17981
Conversation
|
@vpisarev i added another interface for directly recovering R and t from different cameras. |
|
@vpisarev i think its ready for review. The only thing that is missing are the tests. How should this be tested? I think i could compare the rodruigez vectors given a simple dataset, similar to what you did for #17816 as well as scaling the translation to a unit vector and then compare the directions of two different recoverPose functions? |
| return findEssentialMat(_pointsUntistorted1, _pointsUntistorted2, cm0, method, prob, threshold, _mask); | ||
| } | ||
|
|
||
| int cv::recoverPose( InputArray _points1, InputArray _points2, |
There was a problem hiding this comment.
what i dont like is the mixed use of sometimes using _ prefix for parameters and sometimes for variables. It seems to be mixed a lot in the whole code. Is there a guideline when to exactly use _ and when not to?
|
@tompollok Friendly reminder about test. |
|
Sorry i wont have time the next 2 weeks. I can do it in the last week of august |
|
@tompollok There is merge conflict still. Could you squash commits and rebase to current master? |
|
yes ill fix it today |
1845f0d to
9c5c137
Compare
9c5c137 to
aa16dde
Compare
|
@tompollok @vpisarev Do you plan to finish the PR? |
| length. | ||
| @param method Method for computing an essential matrix. | ||
| - **RANSAC** for the RANSAC algorithm. | ||
| - **LMEDS** for the LMedS algorithm. |
There was a problem hiding this comment.
Please use doxygen @ref instead of bold font for RANSAC and LMEDS.
|
@tompollok, thank you for the contribution! 👍 |
| points2.at<Point2f>(12) = Point2f(0.0f, 0.0f); // provoke an outlier detection | ||
| Inliers = recoverPose(E, points1, points2, cameraMatrix, R, t, mask); | ||
| EXPECT_EQ(0, (int)mask.at<unsigned char>(12)) << "Detecting outliers in function failed, testcase " << testcase; | ||
| Inliers2 = recoverPose(points1, points2, cameraMatrix, zeroDistCoeffs, cameraMatrix, zeroDistCoeffs, E3, R, t, RANSAC, 0.999, 1.0, mask); |
There was a problem hiding this comment.
cameraMatrix, zeroDistCoeffs, cameraMatrix, zeroDistCoeffs
Test passes the same camera intrinsics for this call anywhere.
It doesn't validate the added functionality ("different cameras").
|
@tompollok, could you, please, fix the builds and change the test so that the intrinsic cameras are different (so that the new functionality is actually tested)? |
|
@tompollok Friendly reminder. |
|
@tompollok Have you had a chance to finish the patch? |
|
@tompollok Friendly reminder. |
|
@tompollok Friendly reminder. Please tune the test to use really different cameras that is stated in the PR message. |
|
@tompollok Do you have a chance to finish the patch? |
|
@asmorkalov ill take a look. Sorry ive been very busy lately. but ill try to fix it in time for the next release. |
|
jenkins cn please retry a build |
|
@tompollok Friendly reminder. |
|
If @tompollok and opencv maintainers are ok with it, I would like to finish this PR as I'm interested in it. It has been open for a year and it would be good if users had access to this functionality. It appears that only unit tests need to be fixed. What does everyone think about that? |
|
@thezane please go ahead. Please presume commits history and original author. |
related to #17329 in order to get essential matrix and R and t for two different cameras
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.