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

Circle Hough Transform improvements #1244

Merged
merged 23 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
476b489
[WIP] Added a method to compute the arc length of a circle that is co…
Sep 25, 2023
8209a0d
[WIP] Manage cases where a single axis is touched (additionally to ca…
Sep 25, 2023
e6a2865
[WIP] Added cases of crossing top and left axes once, and crossing on…
Sep 27, 2023
6340a89
[CORPS] Validated last case of intersection with both left and top bo…
Sep 27, 2023
e980cb7
[WIP] Added top right cases
Sep 28, 2023
0b75cc8
[WIP] Added cases of crossings with bottom and left axes
Sep 28, 2023
8fa5445
[WIP] Handle crossing bottom and right axes
Sep 28, 2023
0ba0579
[CORPS] vpCHT radius candidate validation policy is now based on a pr…
Sep 29, 2023
2273658
[WIP] Added case top + bottom + X and tested case with two intersecti…
Sep 29, 2023
0262a6d
[WIP] Successful tests: top/right/bottom with two intersections on ea…
Sep 29, 2023
52bec05
[WIP] Added tests for top/bottom/left and top/bottom/right where only…
Sep 29, 2023
e595d5c
[WIP] Added tests for top/bottom/left and top/bottom/right where only…
Sep 29, 2023
baf5b16
[WIP] Added test for top/bottom/right and top/bottom/left where top a…
Sep 29, 2023
ecc391a
[WIP] Added tests for top/bottom/left and top/bottom/right where the …
Sep 29, 2023
201575c
[TEST] Added tests for bottom/top/right and bottom/top/left for cases…
Oct 2, 2023
07ea845
[TEST] Made homogeneity in the notation of the tests
Oct 2, 2023
149a41e
Added case where all the axes are crossed
Oct 2, 2023
fc7500a
[FIX] Fixed typos when the left and right axes are the only axes that…
Oct 2, 2023
19f36b7
[FIX] Fixed some typos in the left/right/top case + tested all the ca…
Oct 2, 2023
2bbd72f
[CORPS] The method vpImageCircle::computeArcLengthInRoI has been succ…
Oct 3, 2023
db37b1f
[TUTO] Updated the vpCircleHoughTransform tutorial based on the recen…
Oct 3, 2023
c494c16
Merge branch 'master' into vpCHTimprovements
Oct 3, 2023
e5cce9c
[FIX] Forgot to clean the votes vector
Oct 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions doc/tutorial/imgproc/tutorial-imgproc-cht.dox
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ parameter.

\image html img-tutorial-cht-radius-votes.png

\section imgproc_cht_requirements Requirements

With the current implementation, the `vpCircleHoughTransform` requires ViSP to be compiled with OpenCV.
If you do not know how to do it, please refer to the installation guidelines of \ref soft_vision_opencv.

\section imgproc_cht_howto How to use the tutorial

It is possible to configure the `vpCircleHoughTransform` class using a JSON file.
Expand Down Expand Up @@ -74,7 +69,7 @@ If the detections seem a bit off, you might need to change the parameters in `co

To run the software on an actual image using command line arguments instead, please run:
```
$ ./tutorial-circle-hough --input /path/to/my/image --gaussian-kernel 5 --gaussian-sigma 1 --canny-thresh -1. --dilatation-repet 1 --center-thresh 200 --radius-bin 2 --radius-thresh 2 --radius-limits 80 90 --merging-thresh 15 2 --circle-perfectness 0.9
$ ./tutorial-circle-hough --input /path/to/my/image --gaussian-kernel 5 --gaussian-sigma 1 --canny-thresh 100. 200. --dilatation-repet 1 --center-thresh 200 --radius-bin 2 --circle-probability-thresh 0.75 --radius-limits 80 90 --merging-thresh 15 2 --circle-perfectness 0.9
```

If the detections seem a bit off, you might need to change the parameters
Expand Down Expand Up @@ -139,6 +134,8 @@ to the command line arguments:

To run the circle detection, you must call the following method:
\snippet tutorial-circle-hough.cpp Run detection
The call to vpCircleHoughTransform::getDetectionsProbabilities permits to know the confidence in each detection.
It is sorted in the same way that are sorted the detections.

You could have also used the following method to get only the `num_best` best
detections:
Expand Down
20 changes: 18 additions & 2 deletions modules/core/include/visp3/core/vpImageCircle.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,25 @@ class VISP_EXPORT vpImageCircle
virtual ~vpImageCircle();

/*!
* Get the center of the image (2D) circle
* \return The center of the image (2D) circle.
* Compute the angular coverage, in terms of radians, that is contained in the Region of Interest (RoI).
* \sa \ref vpImageCircle::computeArcLengthInRoI() "vpImageCircle::computeArcLengthInRoI(const vpRect &roi)"
* \param[in] roi The rectangular RoI in which we want to know the number of pixels of the circle that are contained.
* \return Returns 2.f * M_PI for a circle that is fully visible in the RoI, or the sum of the angles of the arc(s) that is(are) visible in the RoI.
*/
float computeAngularCoverageInRoI(const vpRect &roi) const;

/*!
* Compute the arc length, in terms of number of pixels, that is contained in the Region of Interest (RoI).
* \sa \ref vpImageCircle::computeAngularCoverageInRoI() "vpImageCircle::computeAngularCoverageInRoI(const vpRect &roi)"
* \param[in] roi The rectangular RoI in which we want to know the number of pixels of the circle that are contained.
* \return The number of pixels of the circle that are contained in the RoI.
*/
float computeArcLengthInRoI(const vpRect &roi) const;

/*!
* Get the center of the image (2D) circle
* \return The center of the image (2D) circle.
*/
vpImagePoint getCenter() const;

/*!
Expand Down
959 changes: 959 additions & 0 deletions modules/core/src/image/vpImageCircle.cpp

Large diffs are not rendered by default.

Loading
Loading