6 #include <visp3/core/vpConfig.h>
7 #include <visp3/core/vpException.h>
8 #include <visp3/core/vpImage.h>
9 #include <visp3/core/vpImageConvert.h>
10 #include <visp3/core/vpImageDraw.h>
11 #include <visp3/core/vpIoTools.h>
12 #include <visp3/core/vpTime.h>
13 #include <visp3/imgproc/vpCircleHoughTransform.h>
14 #include <visp3/imgproc/vpImgproc.h>
15 #include <visp3/io/vpImageIo.h>
16 #include <visp3/io/vpVideoReader.h>
18 #include "drawingHelpers.h"
24 std::vector<vpImageCircle> detectedCircles = detector.
detect(I_src, nbCirclesToDetect);
28 std::cout <<
"Process time = " << (tF - t0) * 0.001 <<
"ms" << std::endl << std::flush;
33 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
36 std::vector<vpColor> v_colors;
43 unsigned int idColor = 0;
45 const unsigned int nbCircle =
static_cast<unsigned int>(detectedCircles.size());
46 for (
unsigned int idCircle = 0; idCircle < nbCircle; ++idCircle) {
47 const vpImageCircle &circleCandidate = detectedCircles[idCircle];
49 std::cout <<
"Circle #" <<
id <<
":" << std::endl;
50 std::cout <<
"\tCenter: (" << circleCandidate.
getCenter() <<
")" << std::endl;
51 std::cout <<
"\tRadius: (" << circleCandidate.
getRadius() <<
")" << std::endl;
52 std::cout <<
"\tProba: " << probas[id] << std::endl;
55 idColor = (idColor + 1) % v_colors.size();
57 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_17)
58 std::optional<vpImage<bool>> opt_mask = std::nullopt;
59 std::optional<std::vector<std::vector<std::pair<unsigned int, unsigned int>>>> opt_votingPoints = std::nullopt;
60 #elif (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
62 std::vector<std::vector<std::pair<unsigned int, unsigned int>>> *opt_votingPoints =
nullptr;
66 std::vector<std::vector<std::pair<unsigned int, unsigned int> > > *opt_votingPoints = NULL;
70 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_17)
72 #elif (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
73 if (opt_votingPoints !=
nullptr)
75 if (opt_votingPoints != NULL)
78 const unsigned int crossSize = 3;
79 const unsigned int crossThickness = 1;
80 unsigned int nbVotedCircles =
static_cast<unsigned int>(opt_votingPoints->size());
81 for (
unsigned int idCircle = 0; idCircle < nbVotedCircles; ++idCircle) {
83 const std::vector<std::pair<unsigned int, unsigned int> > &votingPoints = (*opt_votingPoints)[idCircle];
84 unsigned int nbVotingPoints =
static_cast<unsigned int>(votingPoints.size());
85 for (
unsigned int idPoint = 0; idPoint < nbVotingPoints; ++idPoint) {
87 const std::pair<unsigned int, unsigned int> &pt = votingPoints[idPoint];
92 #if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_17)
93 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
94 if (opt_mask !=
nullptr)
101 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
102 if (opt_votingPoints !=
nullptr)
104 if (opt_votingPoints != NULL)
107 delete opt_votingPoints;
119 int main(
int argc,
char **argv)
121 const std::string def_input(
"coins2.jpg");
122 const std::string def_jsonFilePath = std::string(
"");
123 const int def_nbCirclesToDetect = -1;
124 const int def_gaussianKernelSize = 5;
125 const float def_gaussianSigma = 1.f;
126 const int def_sobelKernelSize = 3;
127 const float def_lowerCannyThresh = -1.f;
128 const float def_upperCannyThresh = -1.f;
129 const int def_nbEdgeFilteringIter = 3;
130 const std::pair<int, int> def_centerXlimits = std::pair<int, int>(0, 1920);
131 const std::pair<int, int> def_centerYlimits = std::pair<int, int>(0, 1080);
132 const unsigned int def_minRadius = 34;
133 const unsigned int def_maxRadius = 75;
134 const int def_dilatationKernelSize = 5;
135 const float def_centerThresh = 70.f;
136 const float def_circleProbaThresh = 0.725f;
137 const float def_circlePerfectness = 0.85f;
138 const float def_centerDistanceThresh = 5.f;
139 const float def_radiusDifferenceThresh = 5.f;
140 const int def_averagingWindowSize = 5;
143 const float def_lowerCannyThreshRatio = 0.6f;
144 const float def_upperCannyThreshRatio = 0.9f;
145 const int def_expectedNbCenters = -1;
146 const bool def_recordVotingPoints =
false;
147 const float def_visibilityRatioThresh = 0.1f;
149 std::string opt_input(def_input);
150 std::string opt_jsonFilePath = def_jsonFilePath;
151 int opt_nbCirclesToDetect = def_nbCirclesToDetect;
152 int opt_gaussianKernelSize = def_gaussianKernelSize;
153 float opt_gaussianSigma = def_gaussianSigma;
154 int opt_sobelKernelSize = def_sobelKernelSize;
155 float opt_lowerCannyThresh = def_lowerCannyThresh;
156 float opt_upperCannyThresh = def_upperCannyThresh;
157 int opt_nbEdgeFilteringIter = def_nbEdgeFilteringIter;
158 std::pair<int, int> opt_centerXlimits = def_centerXlimits;
159 std::pair<int, int> opt_centerYlimits = def_centerYlimits;
160 unsigned int opt_minRadius = def_minRadius;
161 unsigned int opt_maxRadius = def_maxRadius;
162 int opt_dilatationKerneSize = def_dilatationKernelSize;
163 float opt_centerThresh = def_centerThresh;
164 float opt_circleProbaThresh = def_circleProbaThresh;
165 float opt_circlePerfectness = def_circlePerfectness;
166 float opt_centerDistanceThresh = def_centerDistanceThresh;
167 float opt_radiusDifferenceThresh = def_radiusDifferenceThresh;
168 int opt_averagingWindowSize = def_averagingWindowSize;
171 float opt_lowerCannyThreshRatio = def_lowerCannyThreshRatio;
172 float opt_upperCannyThreshRatio = def_upperCannyThreshRatio;
173 int opt_expectedNbCenters = def_expectedNbCenters;
174 bool opt_recordVotingPoints = def_recordVotingPoints;
175 float opt_visibilityRatioThresh = def_visibilityRatioThresh;
176 bool opt_displayCanny =
false;
178 for (
int i = 1; i < argc; i++) {
179 std::string argName(argv[i]);
180 if (argName ==
"--input" && i + 1 < argc) {
181 opt_input = std::string(argv[i + 1]);
184 #ifdef VISP_HAVE_NLOHMANN_JSON
185 else if (argName ==
"--config" && i + 1 < argc) {
186 opt_jsonFilePath = std::string(argv[i + 1]);
190 else if (argName ==
"--nb-circles" && i + 1 < argc) {
191 opt_nbCirclesToDetect = atoi(argv[i + 1]);
194 else if (argName ==
"--gaussian-kernel" && i + 1 < argc) {
195 opt_gaussianKernelSize = atoi(argv[i + 1]);
198 else if (argName ==
"--gaussian-sigma" && i + 1 < argc) {
199 opt_gaussianSigma =
static_cast<float>(atof(argv[i + 1]));
202 else if (argName ==
"--gradient-kernel" && i + 1 < argc) {
203 opt_sobelKernelSize = atoi(argv[i + 1]);
206 else if (argName ==
"--canny-thresh" && i + 2 < argc) {
207 opt_lowerCannyThresh =
static_cast<float>(atof(argv[i + 1]));
208 opt_upperCannyThresh =
static_cast<float>(atof(argv[i + 2]));
211 else if (argName ==
"--edge-filter" && i + 1 < argc) {
212 opt_nbEdgeFilteringIter = atoi(argv[i + 1]);
215 else if (argName ==
"--dilatation-kernel-size" && i + 1 < argc) {
216 opt_dilatationKerneSize = atoi(argv[i + 1]);
219 else if (argName ==
"--averaging-window-size" && i + 1 < argc) {
220 opt_averagingWindowSize = atoi(argv[i + 1]);
223 else if (argName ==
"--radius-limits" && i + 2 < argc) {
224 opt_minRadius = atoi(argv[i + 1]);
225 opt_maxRadius = atoi(argv[i + 2]);
228 else if (argName ==
"--center-thresh" && i + 1 < argc) {
229 opt_centerThresh =
static_cast<float>(atof(argv[i + 1]));
232 else if (argName ==
"--center-xlim" && i + 2 < argc) {
233 opt_centerXlimits = std::pair<int, int>(atoi(argv[i + 1]), atoi(argv[i + 2]));
236 else if (argName ==
"--center-ylim" && i + 2 < argc) {
237 opt_centerYlimits = std::pair<int, int>(atoi(argv[i + 1]), atoi(argv[i + 2]));
240 else if (argName ==
"--circle-probability-thresh" && i + 1 < argc) {
241 opt_circleProbaThresh =
static_cast<float>(atof(argv[i + 1]));
244 else if (argName ==
"--circle-perfectness" && i + 1 < argc) {
245 opt_circlePerfectness =
static_cast<float>(atof(argv[i + 1]));
248 else if (argName ==
"--merging-thresh" && i + 2 < argc) {
249 opt_centerDistanceThresh =
static_cast<float>(atof(argv[i + 1]));
250 opt_radiusDifferenceThresh =
static_cast<float>(atof(argv[i + 2]));
253 else if (argName ==
"--filtering-type" && i + 1 < argc) {
257 else if (argName ==
"--canny-backend" && i + 1 < argc) {
261 else if (argName ==
"--lower-canny-ratio" && i + 1 < argc) {
262 opt_lowerCannyThreshRatio =
static_cast<float>(atof(argv[i + 1]));
265 else if (argName ==
"--upper-canny-ratio" && i + 1 < argc) {
266 opt_upperCannyThreshRatio =
static_cast<float>(atof(argv[i + 1]));
269 else if (argName ==
"--expected-nb-centers" && i + 1 < argc) {
270 opt_expectedNbCenters = atoi(argv[i + 1]);
273 else if (argName ==
"--visibility-ratio-thresh" && i + 1 < argc) {
274 opt_visibilityRatioThresh =
static_cast<float>(atof(argv[i + 1]));
277 else if (argName ==
"--record-voting-points") {
278 opt_recordVotingPoints =
true;
280 else if (argName ==
"--display-edge-map") {
281 opt_displayCanny =
true;
283 else if (argName ==
"--help" || argName ==
"-h") {
284 std::cout <<
"NAME" << std::endl;
285 std::cout <<
"\t" << argv[0] <<
" Test program for the home-made Hough Circle Detection algorithm" << std::endl
287 std::cout <<
"SYNOPSIS" << std::endl;
288 std::cout <<
"\t" << argv[0]
289 <<
"\t [--input <path/to/file>]" << std::endl
290 #ifdef VISP_HAVE_NLOHMANN_JSON
291 <<
"\t [--config <path/to/json/file>] (default: " << (def_jsonFilePath.empty() ?
"unused" : def_jsonFilePath) <<
")" << std::endl
293 <<
"\t [--nb-circles <number-circles-to-detect>] (default: " << def_nbCirclesToDetect <<
")" << std::endl
294 <<
"\t [--gaussian-kernel <kernel-size>] (default: " << def_gaussianKernelSize <<
")" << std::endl
295 <<
"\t [--gaussian-sigma <stddev>] (default: " << def_gaussianSigma <<
")" << std::endl
296 <<
"\t [--gradient-kernel <kernel-size>] (default: " << def_sobelKernelSize <<
")" << std::endl
297 <<
"\t [--canny-thresh <lower-canny-thresh upper-canny-thresh>] (default: " << def_lowerCannyThresh <<
" ; " << def_upperCannyThresh <<
")" << std::endl
298 <<
"\t [--edge-filter <nb-iter>] (default: " << def_nbEdgeFilteringIter <<
")" << std::endl
299 <<
"\t [--radius-limits <radius-min> <radius-max>] (default: min = " << def_minRadius <<
", max = " << def_maxRadius <<
")" << std::endl
300 <<
"\t [--dilatation-kernel-size <kernel-size>] (default: " << def_dilatationKernelSize <<
")" << std::endl
301 <<
"\t [--averaging-window-size <size>] (default: " << def_averagingWindowSize <<
")" << std::endl
302 <<
"\t [--center-thresh <center-detection-threshold>] (default: " << def_centerThresh <<
")" << std::endl
303 <<
"\t [--center-xlim <center-horizontal-min center-horizontal-max>] (default: " << def_centerXlimits.first <<
" , " << def_centerXlimits.second <<
")" << std::endl
304 <<
"\t [--center-ylim <center-vertical-min center-vertical-max>] (default: " << def_centerYlimits.first <<
" , " << def_centerYlimits.second <<
")" << std::endl
305 <<
"\t [--circle-probability-thresh <probability-threshold>] (default: " << def_circleProbaThresh <<
")" << std::endl
306 <<
"\t [--circle-perfectness <circle-perfectness-threshold>] (default: " << def_circlePerfectness <<
")" << std::endl
307 <<
"\t [--merging-thresh <center-distance-thresh> <radius-difference-thresh>] (default: centers distance threshold = " << def_centerDistanceThresh <<
", radius difference threshold = " << def_radiusDifferenceThresh <<
")" << std::endl
308 <<
"\t [--filtering-type <type-name>]"
310 <<
"\t [--canny-backend <backend-name>]"
312 <<
"\t [--lower-canny-ratio <value>]"
313 <<
" (default: " << def_lowerCannyThreshRatio<<
")" << std::endl
314 <<
"\t [--upper-canny-ratio <value>]"
315 <<
" (default: " << def_upperCannyThreshRatio <<
")" << std::endl
316 <<
"\t [--expected-nb-centers <number>]"
317 #if (VISP_CXX_STANDARD > VISP_CXX_STANDARD_98)
318 <<
" (default: " << (def_expectedNbCenters < 0 ?
"no limits" : std::to_string(def_expectedNbCenters)) <<
")" << std::endl
322 <<
"\t [--visibility-ratio-thresh <ratio ]0; 1[> ]"
323 <<
" (default: " << def_visibilityRatioThresh <<
")" << std::endl
324 <<
"\t [--record-voting-points]" << std::endl
325 <<
"\t [--display-edge-map]" << std::endl
326 <<
"\t [--help, -h]" << std::endl
329 std::cout <<
"DESCRIPTION" << std::endl
330 <<
"\t--input" << std::endl
331 <<
"\t\tPermit to choose the input of the Hough Circle Algorithm." << std::endl
332 <<
"\t\tIf you want to use a succession of images as video, their name must be in the format ${BASENAME}%d.{jpg, png}." << std::endl
333 <<
"\t\tDefault: " << def_input << std::endl
335 #ifdef VISP_HAVE_NLOHMANN_JSON
336 <<
"\t--config" << std::endl
337 <<
"\t\tPermit to configure the Hough Circle Algorithm using a JSON file." << std::endl
338 <<
"\t\tDefault: " << (def_jsonFilePath.empty() ?
"unused" : def_jsonFilePath) << std::endl
341 <<
"\t--nb-circles" << std::endl
342 <<
"\t\tPermit to choose the number of circles we want to detect in the image" << std::endl
343 <<
"\t\tThe results will be the circles having the greatest number of votes." << std::endl
344 <<
"\t\tDefault: " << def_nbCirclesToDetect << std::endl
346 <<
"\t--gaussian-kernel" << std::endl
347 <<
"\t\tPermit to set the size of the Gaussian filter used to smooth the input image and compute its gradients." << std::endl
348 <<
"\t\tMust be an odd value." << std::endl
349 <<
"\t\tDefault: " << def_gaussianKernelSize << std::endl
351 <<
"\t--gaussian-sigma" << std::endl
352 <<
"\t\tPermit to set the standard deviation of the Gaussian filter." << std::endl
353 <<
"\t\tMust be a positive value." << std::endl
354 <<
"\t\tDefault: " << def_gaussianSigma << std::endl
356 <<
"\t--gradient-kernel" << std::endl
357 <<
"\t\tPermit to set the size of the Gaussian filter used to smooth the input image and compute its gradients." << std::endl
358 <<
"\t\tMust be an odd value." << std::endl
359 <<
"\t\tDefault: " << def_gaussianKernelSize << std::endl
361 <<
"\t--canny-thresh" << std::endl
362 <<
"\t\tPermit to set the lower and upper thresholds of the Canny edge detector." << std::endl
363 <<
"\t\tIf a value is negative, it will be automatically computed." << std::endl
364 <<
"\t\tDefault: " << def_lowerCannyThresh <<
" ; " << def_upperCannyThresh << std::endl
366 <<
"\t--edge-filter" << std::endl
367 <<
"\t\tPermit to set the number of iteration of 8-neighbor filter iterations of the result of the Canny edge detector." << std::endl
368 <<
"\t\tIf negative, no filtering is performed." << std::endl
369 <<
"\t\tDefault: " << def_nbEdgeFilteringIter << std::endl
371 <<
"\t--radius-limits" << std::endl
372 <<
"\t\tPermit to set the minimum and maximum radii of the circles we are looking for." << std::endl
373 <<
"\t\tDefault: min = " << def_minRadius <<
", max = " << def_maxRadius << std::endl
375 <<
"\t--dilatation-kernel-size" << std::endl
376 <<
"\t\tPermit to set the size of the kernel of the dilatation operation used to detect the maxima of the centers votes." << std::endl
377 <<
"\t\tMinimum tolerated value is 1." << std::endl
378 <<
"\t\tDefault: " << def_dilatationKernelSize << std::endl
380 <<
"\t--averaging-window-size" << std::endl
381 <<
"\t\tPermit to set the number size of the averaging window used to detect the maxima of the centers votes." << std::endl
382 <<
"\t\tMust be odd." << std::endl
383 <<
"\t\tDefault: " << def_averagingWindowSize << std::endl
385 <<
"\t--center-thresh" << std::endl
386 <<
"\t\tPermit to set the minimum number of votes a point must reach to be considered as a center candidate." << std::endl
387 <<
"\t\tIf the input is a real image, must be a positive value." << std::endl
388 <<
"\t\tOtherwise, if the input is a synthetic image and the value is negative, a fine-tuned value will be used." << std::endl
389 <<
"\t\tDefault: " << def_centerThresh << std::endl
391 <<
"\t--center-xlim" << std::endl
392 <<
"\t\tPermit to set the minimum and maximum horizontal position to be considered as a center candidate." << std::endl
393 <<
"\t\tThe search area is limited to [-maxRadius; +image.width + maxRadius]." << std::endl
394 <<
"\t\tDefault: " << def_centerXlimits.first <<
" , " << def_centerXlimits.second << std::endl
396 <<
"\t--center-ylim" << std::endl
397 <<
"\t\tPermit to set the minimum and maximum vertical position to be considered as a center candidate." << std::endl
398 <<
"\t\tThe search area is limited to [-maxRadius; +image.height + maxRadius]." << std::endl
399 <<
"\t\tDefault: " << def_centerYlimits.first <<
" , " << def_centerYlimits.second << std::endl
401 <<
"\t--circle-probability-thresh" << std::endl
402 <<
"\t\tPermit to to set the minimum probability a circle must reach to be kept." << std::endl
403 <<
"\t\tDefault: " << def_circleProbaThresh << std::endl
405 <<
"\t--circle-perfectness" << std::endl
406 <<
"\t\tPermit to set the set the circle perfectness threshold." << std::endl
407 <<
"\t\tThis parameter is used during the radius candidates computation." << std::endl
408 <<
"\t\tThe scalar product radius RC_ij . gradient(Ep_j) >= m_circlePerfectness * || RC_ij || * || gradient(Ep_j) || to add a vote for the radius RC_ij." << std::endl
409 <<
"\t\tDefault: " << def_circlePerfectness << std::endl
411 <<
"\t--merging-thresh" << std::endl
412 <<
"\t\tPermit to set the thresholds used during the merging stage of the algorithm." << std::endl
413 <<
"\t\tThe center distance threshold indicates the maximum distance the centers can be in order to be merged." << std::endl
414 <<
"\t\tThe radius difference threshold indicates the maximum absolute difference between the two circle candidates in order to be merged." << std::endl
415 <<
"\t\tTwo circle candidates must met these two conditions in order to be merged together." << std::endl
416 <<
"\t\tDefault: centers distance threshold = " << def_centerDistanceThresh <<
", radius difference threshold = " << def_radiusDifferenceThresh << std::endl
418 <<
"\t--filtering-type" << std::endl
419 <<
"\t\tPermit to choose the gradient filters." << std::endl
422 <<
"\t--canny-backend" << std::endl
423 <<
"\t\tPermit to choose the backend used to compute the edge map." << std::endl
426 <<
"\t--lower-canny-ratio" << std::endl
427 <<
"\t\tPermit to choose the ratio for the lower threshold if automatic thresholding is chosen." << std::endl
428 <<
"\t\tDefault: " << def_lowerCannyThreshRatio << std::endl
430 <<
"\t--upper-canny-ratio" << std::endl
431 <<
"\t\tPermit to choose the ratio for the upper threshold if automatic thresholding is chosen." << std::endl
432 <<
"\t\tDefault: " << def_upperCannyThreshRatio << std::endl
434 <<
"\t--expected-nb-centers" << std::endl
435 <<
"\t\tPermit to choose the maximum number of centers having more votes than the threshold that are kept." << std::endl
436 <<
"\t\tA negative value makes that all the centers having more votes than the threshold are kept." << std::endl
437 #if (VISP_CXX_STANDARD > VISP_CXX_STANDARD_98)
438 <<
"\t\tDefault: " << (def_expectedNbCenters < 0 ?
"no limits" : std::to_string(def_expectedNbCenters)) << std::endl
443 <<
"\t--expected-nb-centers" << std::endl
444 <<
"\t\tPermit to choose the maximum number of centers having more votes than the threshold that are kept." << std::endl
445 <<
"\t\tA negative value makes that all the centers having more votes than the threshold are kept." << std::endl
446 #
if (VISP_CXX_STANDARD > VISP_CXX_STANDARD_98)
447 <<
"\t\tDefault: " << (def_expectedNbCenters < 0 ?
"no limits" : std::to_string(def_expectedNbCenters)) << std::endl
452 <<
"\t--record-voting-points" << std::endl
453 <<
"\t\tPermit to display the edge map used to detect the circles" << std::endl
454 <<
"\t\tDefault: off" << std::endl
456 <<
"\t--display-edge-map" << std::endl
457 <<
"\t\tPermit to display the edge map used to detect the circles" << std::endl
458 <<
"\t\tDefault: off" << std::endl
466 algoParams(opt_gaussianKernelSize
468 , opt_sobelKernelSize
469 , opt_lowerCannyThresh
470 , opt_upperCannyThresh
471 , opt_nbEdgeFilteringIter
474 ,
static_cast<float>(opt_minRadius)
475 ,
static_cast<float>(opt_maxRadius)
476 , opt_dilatationKerneSize
477 , opt_averagingWindowSize
479 , opt_circleProbaThresh
480 , opt_circlePerfectness
481 , opt_centerDistanceThresh
482 , opt_radiusDifferenceThresh
483 , opt_filteringAndGradientType
484 , opt_cannyBackendType
485 , opt_lowerCannyThreshRatio
486 , opt_upperCannyThreshRatio
487 , opt_expectedNbCenters
488 , opt_recordVotingPoints
489 , opt_visibilityRatioThresh
495 if (opt_jsonFilePath.empty()) {
496 std::cout <<
"Initializing detector from the program arguments [...]" << std::endl;
497 detector.
init(algoParams);
500 #ifdef VISP_HAVE_NLOHMANN_JSON
501 std::cout <<
"Initializing detector from JSON file \"" << opt_jsonFilePath <<
"\", some of the program arguments will be ignored [...]" << std::endl;
508 std::cout << detector;
513 if (opt_input.find(
"%") != std::string::npos) {
515 bool hasToContinue =
true;
519 while (!g.
end() && hasToContinue) {
521 hasToContinue = run_detection(I_src, detector, opt_nbCirclesToDetect,
false, opt_displayCanny);
534 run_detection(I_src, detector, opt_nbCirclesToDetect,
true, opt_displayCanny);
static const vpColor orange
static const vpColor blue
static const vpColor purple
static const vpColor yellow
error that can be emitted by ViSP classes.
@ functionNotImplementedError
Function not implemented.
Class that defines a 2D circle in an image.
vpImagePoint getCenter() const
float computeArcLengthInRoI(const vpRect &roi, const float &roundingTolerance=0.001f) const
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
static void drawCircle(vpImage< unsigned char > &I, const vpImageCircle &circle, unsigned char color, unsigned int thickness=1)
static void drawCross(vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, unsigned char color, unsigned int thickness=1)
static std::string vpCannyBackendTypeToString(const vpCannyBackendType &type)
Cast a vpImageFilter::vpCannyBackendTypeToString into a string, to know its name.
static std::string vpCannyFiltAndGradTypeToStr(const vpCannyFilteringAndGradientType &type)
Cast a vpImageFilter::vpCannyFilteringAndGradientType into a string, to know its name.
vpCannyFilteringAndGradientType
Canny filter and gradient operators to apply on the image before the edge detection stage.
@ CANNY_GBLUR_SCHARR_FILTERING
Apply Gaussian blur + Scharr operator on the input image.
vpCannyBackendType
Canny filter backends for the edge detection operations.
@ CANNY_OPENCV_BACKEND
Use OpenCV.
static std::string vpCannyBackendTypeList(const std::string &pref="<", const std::string &sep=" , ", const std::string &suf=">")
Get the list of available vpCannyBackendType.
static vpCannyFilteringAndGradientType vpCannyFiltAndGradTypeFromStr(const std::string &name)
Cast a string into a vpImageFilter::vpCannyFilteringAndGradientType.
static vpCannyBackendType vpCannyBackendTypeFromString(const std::string &name)
Cast a string into a vpImageFilter::vpCannyBackendTypeToString.
static std::string vpGetCannyFiltAndGradTypes(const std::string &pref="<", const std::string &sep=" , ", const std::string &suf=">")
Get the list of available vpCannyFilteringAndGradientType.
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
unsigned int getWidth() const
unsigned int getHeight() const
Defines a rectangle in the plane.
Class that enables to manipulate easily a video file or a sequence of images. As it inherits from the...
void acquire(vpImage< vpRGBa > &I)
void open(vpImage< vpRGBa > &I)
void setFileName(const std::string &filename)
void display(vpImage< unsigned char > &I, const std::string &title)
Display a gray-scale image.
VISP_EXPORT int wait(double t0, double t)
VISP_EXPORT double measureTimeMicros()