Skip to content

Feature: weighted hough#21407

Merged
asmorkalov merged 25 commits intoopencv:4.xfrom
sensyn-robotics:feature/weighted_hough
Jan 6, 2025
Merged

Feature: weighted hough#21407
asmorkalov merged 25 commits intoopencv:4.xfrom
sensyn-robotics:feature/weighted_hough

Conversation

@MasahiroOgawa
Copy link
Copy Markdown
Contributor

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 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

@MasahiroOgawa
Copy link
Copy Markdown
Contributor Author

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 asmorkalov requested a review from vpisarev January 10, 2022 06:16
@asmorkalov
Copy link
Copy Markdown
Contributor

@vpisarev Could you take a look?

@MasahiroOgawa
Copy link
Copy Markdown
Contributor Author

MasahiroOgawa commented Jan 11, 2022 via email

@MasahiroOgawa
Copy link
Copy Markdown
Contributor Author

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

@vpisarev vpisarev self-assigned this Apr 28, 2022
@asmorkalov
Copy link
Copy Markdown
Contributor

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

@MasahiroOgawa
Copy link
Copy Markdown
Contributor Author

MasahiroOgawa commented May 20, 2022 via email

@asmorkalov
Copy link
Copy Markdown
Contributor

@MasahiroOgawa Friendly reminder.

@MasahiroOgawa
Copy link
Copy Markdown
Contributor Author

MasahiroOgawa commented Jun 3, 2022 via email

@asmorkalov
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

MasahiroOgawa commented Jun 3, 2022 via email

@MasahiroOgawa
Copy link
Copy Markdown
Contributor Author

MasahiroOgawa commented Jun 4, 2022 via email

@quan787
Copy link
Copy Markdown

quan787 commented Jun 21, 2022

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

@MasahiroOgawa
Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor

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

@MasahiroOgawa
Copy link
Copy Markdown
Contributor Author

MasahiroOgawa commented Sep 8, 2022 via email

@asmorkalov
Copy link
Copy Markdown
Contributor

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

@MasahiroOgawa
Copy link
Copy Markdown
Contributor Author

MasahiroOgawa commented Oct 9, 2022 via email

@asmorkalov
Copy link
Copy Markdown
Contributor

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

@asmorkalov
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

MasahiroOgawa commented Dec 20, 2024

 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?

…s: 'const int' and 'const long unsigned int'
@MasahiroOgawa
Copy link
Copy Markdown
Contributor Author


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

@asmorkalov asmorkalov changed the title Feature/weighted hough Feature: weighted hough Dec 23, 2024
@asmorkalov
Copy link
Copy Markdown
Contributor

@MasahiroOgawa Friendly reminder.

@asmorkalov asmorkalov modified the milestones: 4.11.0, 4.12.0 Dec 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
Copy Markdown
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
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor Author

MasahiroOgawa commented Jan 6, 2025

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

 Run cd /home/ci/opencv
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. 
Error: Process completed with exit code 2.

@asmorkalov asmorkalov merged commit fc994a6 into opencv:4.x Jan 6, 2025
@asmorkalov asmorkalov modified the milestones: 4.12.0, 4.11.0 Jan 6, 2025
@asmorkalov asmorkalov mentioned this pull request Jan 15, 2025
shyama7004 pushed a commit to shyama7004/opencv that referenced this pull request Jan 20, 2025
…_hough

Feature: weighted Hough Transform opencv#21407

### Pull Request Readiness Checklist

See details at https://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 request Feb 24, 2025
…_hough

Feature: weighted Hough Transform opencv#21407

### Pull Request Readiness Checklist

See details at https://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 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.

6 participants