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

Skip to content

Conversation

@Kumataro
Copy link
Contributor

Close #3756

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

TEST_P(bgsubgmg_allTypes, accuracy)
{
const int mtype = CV_MAKETYPE(get<0>(GetParam()), get<1>(GetParam()));
CV_BackgroundSubtractorTest test;
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps the whole test can be reworked in modern style since you've already done large part of this task. In order to do this we need to:

  1. Remove CV_BackgroundSubtractorTest class and move whole run function body to the test body (mtype becomes local variable)
  2. Use cv::theRNG() or TS::ptr()->get_rng() for rng
  3. Use proper EXPECT_/ASSERT_ macros for error checking instead of CV_Assert and ts->set_failed_test_info(...). It can be as simple as just using EXPECT_GE(TS::ptr()->cmpEps2(...), 0) or slightly more changed, e.g. EXPECT_MAT_NEAR(... ,..., ...) or EXPECT_LT(norm(..., ..., ...), some_eps)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your comment ! I fixed them.

@asmorkalov asmorkalov merged commit a886fa5 into opencv:4.x Jun 14, 2024
@mshabunin mshabunin mentioned this pull request Jun 14, 2024
@asmorkalov asmorkalov mentioned this pull request Jul 1, 2024
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 bgsegm will random fail

4 participants