Visual Servoing Platform
version 3.6.1 under development (2024-12-17)
|
#include <visp3/imgproc/vpCircleHoughTransform.h>
Public Member Functions | |
vpCircleHoughTransformParams () | |
vpCircleHoughTransformParams (const int &gaussianKernelSize, const float &gaussianStdev, const int &gradientFilterKernelSize, const float &lowerCannyThresh, const float &upperCannyThresh, const int &edgeMapFilterNbIter, const std::pair< int, int > ¢erXlimits, const std::pair< int, int > ¢erYlimits, const float &minRadius, const float &maxRadius, const int &dilatationKernelSize, const int &averagingWindowSize, const float ¢erThresh, const float &circleProbabilityThresh, const float &circlePerfectness, const float ¢erMinDistThresh, const float &mergingRadiusDiffThresh, const vpImageFilter::vpCannyFilteringAndGradientType &filteringAndGradientMethod=vpImageFilter::CANNY_GBLUR_SOBEL_FILTERING, const vpImageFilter::vpCannyBackendType &backendType=vpImageFilter::CANNY_OPENCV_BACKEND, const float &lowerCannyThreshRatio=0.6f, const float &upperCannyThreshRatio=0.8f, const int &expectedNbCenters=-1, const bool &recordVotingPoints=false, const float &visibilityRatioThresh=0.1f) | |
int | getGaussianKernelSize () const |
float | getGaussianStdev () const |
int | getGradientKernelSize () const |
float | getLowerCannyThreshold () const |
float | getUpperCannyThreshold () const |
int | getEdgeMapFilteringNbIter () const |
std::pair< int, int > | getCenterXLimits () const |
std::pair< int, int > | getCenterYLimits () const |
float | getMinRadius () const |
float | getMaxRadius () const |
int | getDilatationKernelSize () const |
int | getAveragingWindowSize () const |
float | getCenterMinThreshold () const |
int | getExpectedNbCenters () const |
float | getProbabilityThreshold () const |
float | getVisibilityRatioThreshold () const |
float | getCirclePerfectness () const |
bool | getRecordVotingPoints () const |
float | getCenterMinDist () const |
float | getMergingRadiusDiff () const |
std::string | toString () const |
void | saveConfigurationInJSON (const std::string &jsonPath) const |
Static Public Member Functions | |
static vpCircleHoughTransformParams | createFromJSON (const std::string &jsonFile) |
Friends | |
class | vpCircleHoughTransform |
void | from_json (const nlohmann::json &j, vpCircleHoughTransformParams ¶ms) |
void | to_json (nlohmann::json &j, const vpCircleHoughTransformParams ¶ms) |
Class that gather the algorithm parameters.
Definition at line 70 of file vpCircleHoughTransform.h.
|
inline |
Construct a new vpCircleHoughTransformParams object with default parameters.
Definition at line 76 of file vpCircleHoughTransform.h.
|
inline |
Construct a new vpCircleHoughTransformParams object.
[in] | gaussianKernelSize | Size of the Gaussian filter kernel used to smooth the input image. Must be an odd number. |
[in] | gaussianStdev | Standard deviation of the Gaussian filter. |
[in] | gradientFilterKernelSize | Size of the Sobel or Scharr kernels used to compute the gradients. Must be an odd number. |
[in] | lowerCannyThresh | The lower threshold for the Canny operator. Values lower than this value are rejected. A negative value makes the algorithm compute this threshold and the lower one automatically. |
[in] | upperCannyThresh | The upper threshold for the Canny operator. Only values greater than this value are marked as an edge. A negative value makes the algorithm compute this threshold and the lower one automatically. |
[in] | edgeMapFilterNbIter | Number of 8-neighbor connectivity filtering iterations to apply to the edge map. |
[in] | centerXlimits | Minimum and maximum position on the horizontal axis of the center of the circle we want to detect. |
[in] | centerYlimits | Minimum and maximum position on the vertical axis of the center of the circle we want to detect. |
[in] | minRadius | Minimum radius of the circles we want to detect. |
[in] | maxRadius | Maximum radius of the circles we want to detect. |
[in] | dilatationKernelSize | Kernel size of the dilatation that is performed to detect the maximum number of votes for the center candidates. |
[in] | averagingWindowSize | Size of the averaging window around the maximum number of votes to compute the center candidate such as it is the barycenter of the window. Must be odd. |
[in] | centerThresh | Minimum number of votes a point must exceed to be considered as center candidate. |
[in] | circleProbabilityThresh | Probability threshold in order to keep a circle candidate. |
[in] | circlePerfectness | The threshold for the colinearity between the gradient of a point and the radius it would form with a center candidate to be able to vote. The formula to get the equivalent angle is: angle = acos(circle_perfectness) . |
[in] | centerMinDistThresh | Two circle candidates whose centers are closer than this threshold are considered for merging. |
[in] | mergingRadiusDiffThresh | Maximum radius difference between two circle candidates to consider merging them. |
[in] | filteringAndGradientMethod | The choice of the filter and gradient operator to apply before the edge detection step. |
[in] | backendType | Permits to choose the backend used to compute the edge map. |
[in] | lowerCannyThreshRatio | If the thresholds must be computed,the lower threshold will be equal to the upper threshold times lowerThresholdRatio . |
[in] | upperCannyThreshRatio | If the thresholds must be computed,the upper threshold will be equal to the value such as the number of pixels of the image times upperThresholdRatio have an absolute gradient lower than the upper threshold. |
[in] | expectedNbCenters | Expected number of centers in the image. If the number is negative, all the centers are kept. Otherwise, maximum up to this number of centers are kept. |
[in] | recordVotingPoints | If true, the edge-map points having voted for each circle will be stored. |
[in] | visibilityRatioThresh | Visibility threshold: which minimum ratio of the circle must be visible in order to keep a circle candidate. |
Definition at line 147 of file vpCircleHoughTransform.h.
|
inlinestatic |
Create a new vpCircleHoughTransformParams from a JSON file.
[in] | jsonFile | The path towards the JSON file. |
Definition at line 453 of file vpCircleHoughTransform.h.
References vpException::ioError.
|
inline |
Get the size of the averaging window around the maximum number of votes to compute the center candidate such as it is the barycenter of the window.
Definition at line 318 of file vpCircleHoughTransform.h.
|
inline |
Get the Maximum distance between two circle candidates centers to consider merging them.
Definition at line 391 of file vpCircleHoughTransform.h.
|
inline |
Get the minimum number of votes a point must exceed to be considered as center candidate.
Definition at line 328 of file vpCircleHoughTransform.h.
|
inline |
Get the minimum and maximum position on the horizontal axis of the center of the circle we want to detect.
Definition at line 266 of file vpCircleHoughTransform.h.
|
inline |
Get the minimum and maximum position on the vertical axis of the center of the circle we want to detect.
Definition at line 276 of file vpCircleHoughTransform.h.
|
inline |
Get the threshold for the colinearity between the gradient of a point and the radius it would form with a center candidate to be able to vote. The formula to get the equivalent angle is: angle = acos(circle_perfectness)
.
Definition at line 371 of file vpCircleHoughTransform.h.
|
inline |
Get the kernel size of the dilatation that is performed to detect the maximum number of votes for the center candidates.
Definition at line 307 of file vpCircleHoughTransform.h.
|
inline |
Get the number of iterations of 8-neighbor connectivity filtering to apply to the edge map.
Definition at line 256 of file vpCircleHoughTransform.h.
|
inline |
Get the expected number of centers in the image. If the number is negative, all the centers are kept. Otherwise, maximum up to this number of centers are kept.
Definition at line 339 of file vpCircleHoughTransform.h.
|
inline |
Get the size of the Gaussian filter kernel used to smooth the input image.
Definition at line 204 of file vpCircleHoughTransform.h.
|
inline |
Get the standard deviation of the Gaussian filter.
Definition at line 214 of file vpCircleHoughTransform.h.
|
inline |
Get the size of the gradient kernel filters used to compute the gradients.
Definition at line 224 of file vpCircleHoughTransform.h.
|
inline |
Get the lower threshold for the Canny operator. Values lower than this value are rejected. A negative value means that the algorithm computes the lower threshold automatically.
Definition at line 235 of file vpCircleHoughTransform.h.
|
inline |
Get the maximum radius of the circles we want to detect.
Definition at line 296 of file vpCircleHoughTransform.h.
|
inline |
Get the Maximum radius difference between two circle candidates to consider merging them.
Definition at line 401 of file vpCircleHoughTransform.h.
|
inline |
Get the minimum radius of the circles we want to detect.
Definition at line 286 of file vpCircleHoughTransform.h.
|
inline |
Get the probability threshold in order to keep a circle candidate.
Definition at line 349 of file vpCircleHoughTransform.h.
|
inline |
Get the boolean indicating if we have to record the edge-map points having voted for the circles.
Definition at line 381 of file vpCircleHoughTransform.h.
|
inline |
Get the upper threshold for the Canny operator. Values lower than this value are rejected. A negative value means that the algorithm computes the lower and upper thresholds automatically.
Definition at line 246 of file vpCircleHoughTransform.h.
|
inline |
Get the visibility ratio threshold in order to keep a circle candidate.
Definition at line 359 of file vpCircleHoughTransform.h.
|
inline |
Save the configuration of the detector in a JSON file described by the path jsonPath. Throw a vpException is the file cannot be created.
[in] | jsonPath | The path towards the JSON output file. |
Definition at line 487 of file vpCircleHoughTransform.h.
Referenced by vpCircleHoughTransform::saveConfigurationInJSON().
|
inline |
Create a string with all the Hough transform parameters.
Definition at line 409 of file vpCircleHoughTransform.h.
References vpImageFilter::vpCannyBackendTypeToString(), and vpImageFilter::vpCannyFiltAndGradTypeToStr().
Referenced by vpCircleHoughTransform::toString().
|
friend |
Read the detector configuration from JSON. All values are optional and if an argument is not present, the default value defined in the constructor is kept.
[in] | j | : The JSON object, resulting from the parsing of a JSON file. |
[out] | params | : The circle Hough transform parameters that will be initialized from the JSON data. |
Definition at line 504 of file vpCircleHoughTransform.h.
|
friend |
Parse a vpCircleHoughTransform into JSON format.
[out] | j | : A JSON parser object. |
[in] | params | : The circle Hough transform parameters that will be serialized in the json object. |
Definition at line 583 of file vpCircleHoughTransform.h.
|
friend |
Definition at line 663 of file vpCircleHoughTransform.h.