Skip to content

Do not dilate binary images on first iteration in findChessboardCorners#24710

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
MaximSmolskiy:do-not-dilate-binary-images-on-first-iteration-in-findChessboardCorners
Feb 12, 2024
Merged

Do not dilate binary images on first iteration in findChessboardCorners#24710
asmorkalov merged 1 commit intoopencv:4.xfrom
MaximSmolskiy:do-not-dilate-binary-images-on-first-iteration-in-findChessboardCorners

Conversation

@MaximSmolskiy
Copy link
Copy Markdown
Contributor

Pull Request Readiness Checklist

In some cases quadrangles can be separated already on first binary images and dilation is not needed on first iteration.

Following example was received on 3.2.0 code version with some modern patches. This is a histogram based binarization (first (new) part of algorithm).
img_bgr
thresh_img_new

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

@MaximSmolskiy MaximSmolskiy changed the title Do not dilate binary images on first iteration in find chessboard corners Do not dilate binary images on first iteration in findChessboardCorners Dec 18, 2023
@asmorkalov
Copy link
Copy Markdown
Contributor

please rebase and fix conflicts

@MaximSmolskiy
Copy link
Copy Markdown
Contributor Author

please rebase and fix conflicts

@asmorkalov Done

@MaximSmolskiy
Copy link
Copy Markdown
Contributor Author

@asmorkalov @AleksandrPanov Could you please review this PR?

@asmorkalov
Copy link
Copy Markdown
Contributor

Yes. It's in a queue. Sorry for delay.

@AleksandrPanov
Copy link
Copy Markdown
Contributor

@MaximSmolskiy, could you squash the commits?

@MaximSmolskiy MaximSmolskiy force-pushed the do-not-dilate-binary-images-on-first-iteration-in-findChessboardCorners branch from d9bff44 to bcbc74d Compare February 7, 2024 22:31
@MaximSmolskiy
Copy link
Copy Markdown
Contributor Author

@MaximSmolskiy, could you squash the commits?

@AleksandrPanov Done

@AleksandrPanov
Copy link
Copy Markdown
Contributor

AleksandrPanov commented Feb 8, 2024

I tested PR with benchmark:
--configuration=generate_run --board_x=7 --path=res_chessboard --synthetic_object=chessboard
before PR fix:
chess1

after PR fix:
chess2

There are no regressions. I also got a speed up of about 6%.
@asmorkalov, I propose to merge this PR.

Copy link
Copy Markdown
Contributor

@AleksandrPanov AleksandrPanov left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

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

👍

@asmorkalov asmorkalov merged commit 82914e4 into opencv:4.x Feb 12, 2024
@MaximSmolskiy MaximSmolskiy deleted the do-not-dilate-binary-images-on-first-iteration-in-findChessboardCorners branch February 12, 2024 12:52
@asmorkalov asmorkalov mentioned this pull request Feb 16, 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.

3 participants