Visual Servoing Platform  version 3.5.1 under development (2023-09-22)
vpCircleHoughTransform::vpCircleHoughTransformParameters Class Reference

#include <visp3/imgproc/vpCircleHoughTransform.h>

Public Member Functions

 vpCircleHoughTransformParameters ()
 
 vpCircleHoughTransformParameters (const int &gaussianKernelSize, const float &gaussianStdev, const int &sobelKernelSize, const float &lowerCannyThresh, const float &upperCannyThresh, const int &edgeMapFilterNbIter, const std::pair< int, int > &centerXlimits, const std::pair< int, int > &centerYlimits, const unsigned int &minRadius, const unsigned int &maxRadius, const int &dilatationNbIter, const float &centerThresh, const float &radiusThreshRatio, const float &circlePerfectness, const float &centerMinDistThresh, const float &mergingRadiusDiffThresh)
 
std::string toString () const
 
void saveConfigurationInJSON (const std::string &jsonPath) const
 

Static Public Member Functions

static vpCircleHoughTransformParameters createFromJSON (const std::string &jsonFile)
 

Friends

class vpCircleHoughTransform
 
void from_json (const json &j, vpCircleHoughTransformParameters &params)
 
void to_json (json &j, const vpCircleHoughTransformParameters &params)
 

Detailed Description

Class that gather the algorithm parameters.

Definition at line 72 of file vpCircleHoughTransform.h.

Constructor & Destructor Documentation

◆ vpCircleHoughTransformParameters() [1/2]

vpCircleHoughTransform::vpCircleHoughTransformParameters::vpCircleHoughTransformParameters ( )
inline

Construct a new vpCircleHoughTransformParameters object with default parameters.

Definition at line 110 of file vpCircleHoughTransform.h.

◆ vpCircleHoughTransformParameters() [2/2]

vpCircleHoughTransform::vpCircleHoughTransformParameters::vpCircleHoughTransformParameters ( const int &  gaussianKernelSize,
const float &  gaussianStdev,
const int &  sobelKernelSize,
const float &  lowerCannyThresh,
const float &  upperCannyThresh,
const int &  edgeMapFilterNbIter,
const std::pair< int, int > &  centerXlimits,
const std::pair< int, int > &  centerYlimits,
const unsigned int &  minRadius,
const unsigned int &  maxRadius,
const int &  dilatationNbIter,
const float &  centerThresh,
const float &  radiusThreshRatio,
const float &  circlePerfectness,
const float &  centerMinDistThresh,
const float &  mergingRadiusDiffThresh 
)
inline

Construct a new vpCircleHoughTransformParameters object.

Parameters
[in]gaussianKernelSizeSize of the Gaussian filter kernel used to smooth the input image. Must be an odd number.
[in]gaussianStdevStandard deviation of the Gaussian filter.
[in]sobelKernelSizeSize of the Sobel kernels used to compute the gradients. Must be an odd number.
[in]lowerCannyThreshThe 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]upperCannyThreshThe 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]edgeMapFilterNbIterNumber of 8-neighbor connectivity filtering iterations to apply to the edge map.
[in]centerXlimitsMinimum and maximum position on the horizontal axis of the center of the circle we want to detect.
[in]centerYlimitsMinimum and maximum position on the vertical axis of the center of the circle we want to detect.
[in]minRadiusMinimum radius of the circles we want to detect.
[in]maxRadiusMaximum radius of the circles we want to detect.
[in]dilatationNbIterNumber of times dilatation is performed to detect the maximum number of votes for the center candidates
[in]centerThreshMinimum number of votes a point must exceed to be considered as center candidate.
[in]radiusThreshRatioMinimum number of votes per radian a radius candidate RC_ij of a center candidate CeC_i must have in order that the circle of center CeC_i and radius RC_ij must be considered as circle candidate.
[in]circlePerfectnessThe scalar product radius RC_ij . gradient(Ep_j) >= m_circlePerfectness * || RC_ij || * || gradient(Ep_j) || to add a vote for the radius RC_ij.
[in]centerMinDistThreshTwo circle candidates whose centers are closer than this threshold are considered for merging.
[in]mergingRadiusDiffThreshMaximum radius difference between two circle candidates to consider merging them.

Definition at line 153 of file vpCircleHoughTransform.h.

Member Function Documentation

◆ createFromJSON()

static vpCircleHoughTransformParameters vpCircleHoughTransform::vpCircleHoughTransformParameters::createFromJSON ( const std::string &  jsonFile)
inlinestatic

Create a new vpCircleHoughTransformParameters from a JSON file.

Parameters
[in]jsonFileThe path towards the JSON file.
Returns
vpCircleHoughTransformParameters The corresponding vpCircleHoughTransformParameters object.

Definition at line 222 of file vpCircleHoughTransform.h.

References vpException::ioError.

◆ saveConfigurationInJSON()

void vpCircleHoughTransform::vpCircleHoughTransformParameters::saveConfigurationInJSON ( const std::string &  jsonPath) const
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.

Parameters
[in]jsonPathThe path towards the JSON output file.

Definition at line 254 of file vpCircleHoughTransform.h.

Referenced by vpCircleHoughTransform::saveConfigurationInJSON().

◆ toString()

std::string vpCircleHoughTransform::vpCircleHoughTransformParameters::toString ( ) const
inline

Create a string with all the Hough transform parameters.

Definition at line 194 of file vpCircleHoughTransform.h.

Referenced by vpCircleHoughTransform::toString().

Friends And Related Function Documentation

◆ from_json

void from_json ( const json &  j,
vpCircleHoughTransformParameters params 
)
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.

Parameters
[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 269 of file vpCircleHoughTransform.h.

◆ to_json

void to_json ( json &  j,
const vpCircleHoughTransformParameters params 
)
friend

Parse a vpCircleHoughTransform into JSON format.

Parameters
[out]j: A JSON parser object.
[in]params: The circle Hough transform parameters that will be serialized in the json object.

Definition at line 328 of file vpCircleHoughTransform.h.

◆ vpCircleHoughTransform

friend class vpCircleHoughTransform
friend

Definition at line 105 of file vpCircleHoughTransform.h.