Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization ximgproc::thinning #3801

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from

Conversation

sturkmen72
Copy link
Contributor

Pull Request Readiness Checklist

credits @ulikoehler https://github.com/ulikoehler/cv_algorithms

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

@ulikoehler
Copy link

@sturkmen72 Thanks for crediting me! I'm fine with releasing this code under another license if that's useful. Apache License v2.0 appears to be the same though.

In any case, I fully support this merge request :-)

@sturkmen72
Copy link
Contributor Author

@ulikoehler Performance increase almost doubled. let me try to find out why GUOHALL gives different result

[----------] 2 tests from ximgproc_Thinning
[ RUN      ] ximgproc_Thinning.simple_ZHANGSUEN
[       OK ] ximgproc_Thinning.simple_ZHANGSUEN (14 ms)
[ RUN      ] ximgproc_Thinning.simple_GUOHALL
/build/precommit-contrib_linux64/4.x/opencv_contrib/modules/ximgproc/test/test_thinning.cpp:28: Failure
Expected equality of these values:
  0
  cvtest::norm(src, dst, NORM_INF)
    Which is: 255
[  FAILED  ] ximgproc_Thinning.simple_GUOHALL (13 ms)
[----------] 2 tests from ximgproc_Thinning (27 ms total)

@sturkmen72 sturkmen72 force-pushed the test_thinning branch 3 times, most recently from 6246fad to d6c0c94 Compare October 2, 2024 23:19
@sturkmen72 sturkmen72 changed the title WIP: speed up ximgproc::thinning Optimization ximgproc::thinning Oct 3, 2024
@sturkmen72
Copy link
Contributor Author

@vrabaud could you take a look

Copy link
Contributor

@vrabaud vrabaud left a comment

Choose a reason for hiding this comment

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

Nice clean-up ! And faster too.

modules/ximgproc/src/thinning.cpp Outdated Show resolved Hide resolved
modules/ximgproc/src/thinning.cpp Outdated Show resolved Hide resolved
@sturkmen72
Copy link
Contributor Author

Please merge the PR #3750 (tested manually) before this PR to give proper credit, as this PR is based on it.

@sturkmen72
Copy link
Contributor Author

@asmorkalov what is your opinion merging the PR #3750 (tested manually) before this PR to give proper credit, as this PR is based on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants