Skip to content

change flags and bugfix graph in new RANSAC. #18483

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
ivashmak:bugfix_graph
Oct 2, 2020
Merged

change flags and bugfix graph in new RANSAC. #18483
opencv-pushbot merged 1 commit intoopencv:masterfrom
ivashmak:bugfix_graph

Conversation

@ivashmak
Copy link
Copy Markdown
Contributor

@ivashmak ivashmak commented Oct 1, 2020

Related: #17683 #18482
Fixes #18454

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 other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to 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

@ivashmak ivashmak mentioned this pull request Oct 1, 2020
6 tasks
Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

Thank you 👍

@opencv-pushbot opencv-pushbot merged commit 955909b into opencv:master Oct 2, 2020
@llschloesser
Copy link
Copy Markdown

The USAC additions are great, but I think the documentation additions are sorely lacking. Briefly looking at the source code, one gets the impression that one can use these more state-of-the-art methods for homographies, essential matrices, fundamental matrices, and PnP, all with the previously existing function signatures (not the new one with the UsacParams struct). However, the documentation of 4.5.0 says next to nothing about this. The consequence is that this great new addition will fly somewhat under the radar until made prominent in the documentation. Or have I misunderstood the USAC additions?

@ivashmak
Copy link
Copy Markdown
Contributor Author

The USAC additions are great, but I think the documentation additions are sorely lacking. Briefly looking at the source code, one gets the impression that one can use these more state-of-the-art methods for homographies, essential matrices, fundamental matrices, and PnP, all with the previously existing function signatures (not the new one with the UsacParams struct). However, the documentation of 4.5.0 says next to nothing about this. The consequence is that this great new addition will fly somewhat under the radar until made prominent in the documentation. Or have I misunderstood the USAC additions?

The documentation of new features indeed could have been better. This was my Google Summer of Code project, so I had a bit lack of time when I was writing it.
Let me summarize the main improvements:

  1. reimplementation of solvers. Of course, this is not something significant, however, I quite sped up all of them. For example, for homography and fundamental matrix is using Gaussian elimination instead of SVD. Also, Nister's 5-point solver for essential matrix is replaced by Stewenius's faster version. The same for P3P. If RANSAC runs more than 10,000 iterations it can bring high speed up even if the new solver is faster on 1 mcs.
  2. there are new degenerate tests for the fundamental matrix. For example, orientation constraint which can reject many bad models. Or test if the fundamental matrix is affected by the dominant plane. These checks are quite important because otherwise one can have a problem with 3D reconstruction or obtain degenerate fundamental matrix.
  3. Local Optimization -- there are few implemented methods which can be switched in UsacParams. Idea is to terminate RANSAC much earlier (save time) and have more accurate model in the end.
  4. MAGSAC -- threshold-free version of RANSAC.
  5. UsacParams.SAMPLING_PROSAC -- can be speed up RANSAC by passing sorted points. It is convenient if someone has ratio of distances from detector to sort correspondences and save a lot of time.
  6. Parallel implementation.

There are other minor things but I think everything written above should be enough for USAC to be attractive.

Nevertheless, thank you for your comment and feedback. I will rewrite documentation as it is important to make clear what is new and why should someone use it.

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.

test_calib3d: usac_Homography.accuracy crash (Debug+Windows)

4 participants