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

Feature: weighted hough#21407

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

Merged

Conversation

@MasahiroOgawa
Copy link
Contributor

Pull Request Readiness Checklist

See details athttps://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

crackwitz reacted with hooray emoji
@MasahiroOgawa
Copy link
ContributorAuthor

How can I add optional function to the original (modules/imgproc) function?
I read doc(https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request) and I know we should commit to opencv_contrib, but there is no imgproc/src/hough.cpp file in opencv_contrib.
I just want to add 1 option to add "weghted hough".

@asmorkalov
Copy link
Contributor

@vpisarev Could you take a look?

@MasahiroOgawa
Copy link
ContributorAuthor

MasahiroOgawa commentedJan 11, 2022 via email

Thank you for taking your time to check my pull request! I will revise andtell you soon.2022年1月10日(月) 16:39 Alexander Alekhin ***@***.***>:
***@***.**** commented on this pull request. ------------------------------ In modules/imgproc/src/hough.cpp <#21407 (comment)>: > @@ -180,7 +180,11 @@ HoughLinesStandard( InputArray src, OutputArray lines, int type, { int r = cvRound( j * tabCos[n] + i * tabSin[n] ); r += (numrho - 1) / 2; - accum[(n+1) * (numrho+2) + r+1]++; + if (use_edgeval) { if in inner loops is slow. ------------------------------ In modules/imgproc/include/opencv2/imgproc.hpp <#21407 (comment)>: > @@ -2112,11 +2112,15 @@ parameters should be positive. Must fall between 0 and max_theta.@param max_theta For standard and multi-scale Hough transform, maximum angle to check for lines. Must fall between min_theta and CV_PI. ***@***.*** use_weight True if you want to use weighted Hough transform. ***@***.*** thre_edgeval For weighted Hough transform, only account for over this No such params. — Reply to this email directly, view it on GitHub <#21407 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADESA3BXDUJIXVYEOAZ37ZTUVKEMRANCNFSM5LN3N6KQ> . Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>. You are receiving this because you authored the thread.Message ID: ***@***.***>

@MasahiroOgawa
Copy link
ContributorAuthor

I wrote about this new function "weighted Hough transform" (https://qiita.com/Mas-sensyn/items/b9c2bfb87106acaa74d8).
Hope this will help.

@vpisarevvpisarev self-assigned thisApr 28, 2022
@asmorkalov
Copy link
Contributor

@MasahiroOgawa Friendly reminder. Could you add couple of tests for the new code.

@MasahiroOgawa
Copy link
ContributorAuthor

MasahiroOgawa commentedMay 20, 2022 via email

Oh, I see. Thank you for your feedback!2022年5月20日(金) 16:50 Alexander Smorkalov ***@***.***>:
@MasahiroOgawa <https://github.com/MasahiroOgawa> Friendly reminder. Could you add couple of tests for the new code. — Reply to this email directly, view it on GitHub <#21407 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADESA3FWWG3RMPUKRFBZD6DVK474HANCNFSM5LN3N6KQ> . You are receiving this because you were mentioned.Message ID: ***@***.***>

@asmorkalov
Copy link
Contributor

@MasahiroOgawa Friendly reminder.

@MasahiroOgawa
Copy link
ContributorAuthor

MasahiroOgawa commentedJun 3, 2022 via email

I am working on it.I still working on creating unit test, but even the original unit testfails.It seems the test image data is not exist in proper place.I ran $ bin/opencv_test_imgproc .I will send this issue to github issues later.2022年6月3日(金) 17:56 Alexander Smorkalov ***@***.***>:
@MasahiroOgawa <https://github.com/MasahiroOgawa> Friendly reminder. — Reply to this email directly, view it on GitHub <#21407 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADESA3CRKOBM2ONYGUIL4HLVNHCETANCNFSM5LN3N6KQ> . You are receiving this because you were mentioned.Message ID: ***@***.***>

@asmorkalov
Copy link
Contributor

OpenCV stores all test data in opencv_extra repo:https://github.com/opencv/opencv_extra/. You need to create PR to the repo with the same branch name as you original PR. They'll be tested together automatically.

@MasahiroOgawa
Copy link
ContributorAuthor

MasahiroOgawa commentedJun 3, 2022 via email

Thank you.Yes I noticed that and pulled opencv_extra, and built opencv with "OPENCV_TEST_DATA_PATH" specifying pulled opencv_extra/testdata path.But even though I did, I still failed to run opencv_test_imgproc with thesame error(imread_ fails to open /shared/fruits.png).The data exists in opencv_extra/testdata/cv/shared, so I need to pass "cv/"directory.I'm still struggling with that.I will continue to try.
On Fri, Jun 3, 2022 at 23:10 Alexander Smorkalov ***@***.***> wrote: OpenCV stores all test data in opencv_extra repo:https://github.com/opencv/opencv_extra/. You need to create PR to the repo with the same branch name as you original PR. They'll be tested together automatically. — Reply to this email directly, view it on GitHub <#21407 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADESA3ER4C32ZG2DHZFYGB3VNIG5PANCNFSM5LN3N6KQ> . You are receiving this because you were mentioned.Message ID: ***@***.***>

@MasahiroOgawa
Copy link
ContributorAuthor

MasahiroOgawa commentedJun 4, 2022 via email

Succeeded to run the test!When I run $ export OPENCV_TEST_DATA_PATH=/home/.../opencv_extra/testdata/before running "bin/opencv_test_imgproc", it successfully passed all thetest.I will add unit tests for weighted hough from now on.2022年6月4日(土) 7:25 小川雅弘 ***@***.***>:
Thank you. Yes I noticed that and pulled opencv_extra, and built opencv with " OPENCV_TEST_DATA_PATH" specifying pulled opencv_extra/testdata path. But even though I did, I still failed to run opencv_test_imgproc with the same error(imread_ fails to open /shared/fruits.png). The data exists in opencv_extra/testdata/cv/shared, so I need to pass "cv/" directory. I'm still struggling with that. I will continue to try. On Fri, Jun 3, 2022 at 23:10 Alexander Smorkalov ***@***.***> wrote:> OpenCV stores all test data in opencv_extra repo:>https://github.com/opencv/opencv_extra/. You need to create PR to the> repo with the same branch name as you original PR. They'll be tested> together automatically.>> —> Reply to this email directly, view it on GitHub> <#21407 (comment)>,> or unsubscribe> <https://github.com/notifications/unsubscribe-auth/ADESA3ER4C32ZG2DHZFYGB3VNIG5PANCNFSM5LN3N6KQ>> .> You are receiving this because you were mentioned.Message ID:> ***@***.***>>
asmorkalov, quan787, and alalek reacted with thumbs up emoji

@quan787
Copy link

Thank you for considering this, as this looks very promising for my implication. Very eager to see it being merged.

@MasahiroOgawa
Copy link
ContributorAuthor

Thank you for considering this, as this looks very promising for my implication. Very eager to see it being merged.

Sorry for my late update of unit test. Please wait for several days. I will add unit tests soon, then I hope this will be merged.

@asmorkalov
Copy link
Contributor

@MasahiroOgawa Friendly reminder. Please rebase and finish the PR.

@MasahiroOgawa
Copy link
ContributorAuthor

MasahiroOgawa commentedSep 8, 2022 via email

Sorry, but I'm still struggling to implement the unit test for this.So first I have to finish it.2022年9月7日(水) 22:17 Alexander Smorkalov ***@***.***>:
@MasahiroOgawa <https://github.com/MasahiroOgawa> Friendly reminder. Please rebase and finish the PR. — Reply to this email directly, view it on GitHub <#21407 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADESA3AAB53MCROUX6X2NUDV5CIWLANCNFSM5LN3N6KQ> . You are receiving this because you were mentioned.Message ID: ***@***.***>

@asmorkalov
Copy link
Contributor

@MasahiroOgawa Friendly reminder. Please add some tests to the new algo.

@MasahiroOgawa
Copy link
ContributorAuthor

MasahiroOgawa commentedOct 9, 2022 via email

Will do, thanks!2022年10月7日(金) 21:30 Alexander Smorkalov ***@***.***>:
@MasahiroOgawa <https://github.com/MasahiroOgawa> Friendly reminder. Please add some tests to the new algo. — Reply to this email directly, view it on GitHub <#21407 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADESA3EZY4QKR5SBPIYQH23WCAJXLANCNFSM5LN3N6KQ> . You are receiving this because you were mentioned.Message ID: ***@***.***>

@asmorkalov
Copy link
Contributor

@MasahiroOgawa There are some merge conflicts. Could you take a look.

@asmorkalov
Copy link
Contributor

 modules/imgproc/test/test_houghlines.cpp:350: trailing whitespace.+    modules/imgproc/test/test_houghlines.cpp:356: trailing whitespace.+    modules/imgproc/test/test_houghlines.cpp:359: trailing whitespace.+    // detected lines is assumed sorted from stronger to weaker. modules/imgproc/test/test_houghlines.cpp:371: trailing whitespace.+    // draw lines. modules/imgproc/test/test_houghlines.cpp:374: trailing whitespace.+    modules/imgproc/test/test_houghlines.cpp:380: trailing whitespace.+    modules/imgproc/test/test_houghlines.cpp:383: trailing whitespace.+    // detected lines is assumed sorted from stronger to weaker. samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp:165: space before tab in indent.+        0, CV_PI, use_edgeval);Error: Process completed with exit code 2.

@asmorkalov
Copy link
Contributor

Run cd $HOME/build && python3 $HOME/scripts/warnings-handling.py/home/ci/opencv/modules/ts/include/opencv2/ts/ts_gtest.h:21333:11: warning: comparison of integer expressions of different signedness: 'const int' and 'const long unsigned int' [-Wsign-compare]Build has warnings.

@MasahiroOgawa
Copy link
ContributorAuthor

MasahiroOgawa commentedDec 20, 2024
edited
Loading

 modules/imgproc/test/test_houghlines.cpp:350: trailing whitespace.+    modules/imgproc/test/test_houghlines.cpp:356: trailing whitespace.+    modules/imgproc/test/test_houghlines.cpp:359: trailing whitespace.+    // detected lines is assumed sorted from stronger to weaker. modules/imgproc/test/test_houghlines.cpp:371: trailing whitespace.+    // draw lines. modules/imgproc/test/test_houghlines.cpp:374: trailing whitespace.+    modules/imgproc/test/test_houghlines.cpp:380: trailing whitespace.+    modules/imgproc/test/test_houghlines.cpp:383: trailing whitespace.+    // detected lines is assumed sorted from stronger to weaker. samples/cpp/tutorial_code/ImgTrans/HoughLines_Demo.cpp:165: space before tab in indent.+        0, CV_PI, use_edgeval);Error: Process completed with exit code 2.

I'm sorry for this error, but I think the error is related to the format I posted before.

#21407 (comment)

Should I run clang formatter?

@MasahiroOgawa
Copy link
ContributorAuthor

Run cd $HOME/build && python3 $HOME/scripts/warnings-handling.py/home/ci/opencv/modules/ts/include/opencv2/ts/ts_gtest.h:21333:11: warning: comparison of integer expressions of different signedness: 'const int' and 'const long unsigned int' [-Wsign-compare]Build has warnings.

I'm sorry. I think I fixed the problem.
I rebuilt whole project after this fixation and it seems no build warnings for test_houghlines.cpp.cpp as below;
image

@asmorkalovasmorkalov changed the titleFeature/weighted houghFeature: weighted houghDec 23, 2024
@asmorkalov
Copy link
Contributor

@MasahiroOgawa Friendly reminder.

@asmorkalovasmorkalov modified the milestones:4.11.0,4.12.0Dec 30, 2024
Mat standard_hough, probabilistic_hough, weighted_hough;
int min_threshold =50;
int max_trackbar =150;
int weightedhough_max_trackbar =1e+5;
Copy link
Contributor

Choose a reason for hiding this comment

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

MS Visual Studio reports warning here. Please use 100000. See CI logs for details.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Oh I'm very sorry. Now I'm fixing and checking the build procedure. I will push after I confirmed it build without error.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I think I fixed the 2 errors in the CI.
But github workflow seems only run on branch 4.x, so I couldn't confirmed the fixation.
Could you check it by running CI?

@MasahiroOgawa
Copy link
ContributorAuthor

MasahiroOgawa commentedJan 6, 2025
edited
Loading

I noticed the below error in CI, and fixed by removing whitespace in test_houghlines.cpp.

 Run cd /home/ci/opencvmodules/imgproc/test/test_houghlines.cpp:350: trailing whitespace.+    modules/imgproc/test/test_houghlines.cpp:356: trailing whitespace.+    modules/imgproc/test/test_houghlines.cpp:359: trailing whitespace.+    // detected lines is assumed sorted from stronger to weaker. modules/imgproc/test/test_houghlines.cpp:371: trailing whitespace.+    // draw lines. modules/imgproc/test/test_houghlines.cpp:374: trailing whitespace.+    modules/imgproc/test/test_houghlines.cpp:380: trailing whitespace.+    modules/imgproc/test/test_houghlines.cpp:383: trailing whitespace.+    // detected lines is assumed sorted from stronger to weaker. Error: Process completed with exit code 2.

@asmorkalovasmorkalov merged commitfc994a6 intoopencv:4.xJan 6, 2025
30 of 31 checks passed
@asmorkalovasmorkalov modified the milestones:4.12.0,4.11.0Jan 6, 2025
@asmorkalovasmorkalov mentioned this pull requestJan 15, 2025
shyama7004 pushed a commit to shyama7004/opencv that referenced this pull requestJan 20, 2025
…_houghFeature: weighted Hough Transformopencv#21407### Pull Request Readiness ChecklistSee details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request- [x] I agree to contribute to the project under Apache 2 License.- [x] 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- [x] The PR is proposed to proper branch- [x] There is reference to original bug report and related work- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable      Patch to opencv_extra has the same branch name.- [x] The feature is well documented and sample code can be built with the project CMake
NanQin555 pushed a commit to NanQin555/opencv that referenced this pull requestFeb 24, 2025
…_houghFeature: weighted Hough Transformopencv#21407### Pull Request Readiness ChecklistSee details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request- [x] I agree to contribute to the project under Apache 2 License.- [x] 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- [x] The PR is proposed to proper branch- [x] There is reference to original bug report and related work- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable      Patch to opencv_extra has the same branch name.- [x] The feature is well documented and sample code can be built with the project CMake
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@alalekalalekalalek left review comments

@opencv-alalekopencv-alalekopencv-alalek left review comments

@vpisarevvpisarevvpisarev approved these changes

@asmorkalovasmorkalovasmorkalov approved these changes

Assignees

@vpisarevvpisarev

Projects

None yet

Milestone

4.11.0

Development

Successfully merging this pull request may close these issues.

6 participants

@MasahiroOgawa@asmorkalov@quan787@vpisarev@alalek@opencv-alalek

[8]ページ先頭

©2009-2025 Movatter.jp