12 cout <<
"\nThis program demonstrates circle finding with the Hough transform.\n"
14 "./houghcircles <image_name>, Default is ../data/board.jpg\n" << endl;
17 int main(
int argc,
char** argv)
19 const char* filename = argc >= 2 ? argv[1] :
"../data/board.jpg";
25 cout <<
"can not open " << filename << endl;
33 vector<Vec3f> circles;
38 for(
size_t i = 0; i < circles.size(); i++ )
45 imshow(
"detected circles", cimg);
bool empty() const
Returns true if the array has no elements.
Scalar_< double > Scalar
Definition: types.hpp:597
void cvtColor(InputArray src, OutputArray dst, int code, int dstCn=0)
Converts an image from one color space to another.
Mat imread(const String &filename, int flags=IMREAD_COLOR)
Loads an image from a file.
void imshow(const String &winname, InputArray mat)
Displays an image in the specified window.
Definition: imgproc.hpp:513
void medianBlur(InputArray src, OutputArray dst, int ksize)
Blurs an image using the median filter.
Template class for short numerical vectors, a partial case of Matx.
Definition: matx.hpp:300
void HoughCircles(InputArray image, OutputArray circles, int method, double dp, double minDist, double param1=100, double param2=100, int minRadius=0, int maxRadius=0)
Finds circles in a grayscale image using the Hough transform.
antialiased line
Definition: core.hpp:207
for i
Definition: modelConvert.m:63
basically 21HT, described in
Definition: imgproc.hpp:446
int main(int argc, const char *argv[])
Definition: facerec_demo.cpp:67
n-dimensional dense array class
Definition: mat.hpp:726
void circle(InputOutputArray img, Point center, int radius, const Scalar &color, int thickness=1, int lineType=LINE_8, int shift=0)
Draws a circle.
Point2i Point
Definition: types.hpp:181
int waitKey(int delay=0)
Waits for a pressed key.