Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix non-deterministic behavior in legacy findFundamentalMat with USAC methods#28199

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Jatin-Y07 wants to merge2 commits intoopencv:4.x
base:4.x
Choose a base branch
Loading
fromJatin-Y07:fix_27388

Conversation

@Jatin-Y07
Copy link

Summary

This PR fixes a regression reported in Issue#27388 wherefindFundamentalMat produces non-deterministic results when usingUSAC methods (e.g.,USAC_MAGSAC) in recent OpenCV versions.

The Problem

In OpenCV 4.11+, the defaultUsacParams enable parallel execution (isParallel = true) and use a random seed. The legacy overload offindFundamentalMat (which takesint method) delegates to these defaults, causing the output to vary between runs even with identical inputs. This breaks behavior compatibility with older versions (e.g., 4.6.0) where results were deterministic.

The Fix

This patch modifies the legacy wrapper inmodules/calib3d/src/fundam.cpp. When aUSAC method is selected via the legacy API, we now explicitly enforce:

  • randomGeneratorState = 0: Ensures a fixed seed is used.
  • isParallel = false: Disables race conditions from parallel RANSAC to guarantee bit-exact reproducibility.

@asmorkalovasmorkalov added bug category: calib3d pr: needs testNew functionality requires minimal tests set labelsDec 16, 2025
@asmorkalovasmorkalov added this to the4.13.0 milestoneDec 16, 2025
@asmorkalov
Copy link
Contributor

@Jatin-Y07 Thanks a lot for the bug fix. Could you add simple test that highlights the issue?

@asmorkalovasmorkalov self-requested a reviewDecember 16, 2025 16:52
@Jatin-Y07
Copy link
Author

@asmorkalov Sure, I will add the test.

This PR have the fix of issueopencv#27388 and a simple test in test_fundam.cpp that highlights the issue.Thanks
@asmorkalovasmorkalov removed the pr: needs testNew functionality requires minimal tests set labelDec 17, 2025
@asmorkalovasmorkalov self-assigned thisDec 17, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@asmorkalovasmorkalovAwaiting requested review from asmorkalov

@vpisarevvpisarevAwaiting requested review from vpisarev

Assignees

@asmorkalovasmorkalov

Projects

None yet

Milestone

4.13.0

Development

Successfully merging this pull request may close these issues.

2 participants

@Jatin-Y07@asmorkalov

[8]ページ先頭

©2009-2025 Movatter.jp