-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.cpp
37 lines (32 loc) · 880 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <circle_detect.hpp>
int main (int argc, char* argv[])
{
/*
try
{
cv::Mat src_host = cv::imread("file.png", CV_LOAD_IMAGE_GRAYSCALE);
cv::gpu::GpuMat dst, src;
src.upload(src_host);
cv::gpu::threshold(src, dst, 128.0, 255.0, CV_THRESH_BINARY);
//cv::Mat result_host = dst;
cv::Mat result_host;
dst.download(result_host);
cv::imshow("Result", result_host);
cv::waitKey();
}
catch(const cv::Exception& ex)
{
std::cout << "Error: " << ex.what() << std::endl;
}
*/
Mat src;
std::vector<Vec3f> circles;
if (argc == 2)
src = imread(argv[1], CV_LOAD_IMAGE_GRAYSCALE );
else
src = imread("test_images/circle.png", CV_LOAD_IMAGE_GRAYSCALE );
CircleDetect cd;
cd.RANSAC(src, circles, 100, 2, 30);
return 0;
}