Skip to content

Commit ac5dc05

Browse files
committed
-Test- EdgeDrawing, EDLines, EDPF, EDCircles algorithms
1 parent 229cd72 commit ac5dc05

File tree

15 files changed

+8470
-0
lines changed

15 files changed

+8470
-0
lines changed

modules/ximgproc/include/opencv2/ximgproc.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ CV_EXPORTS_W void thinning( InputArray src, OutputArray dst, int thinningType =
169169
*/
170170
CV_EXPORTS_W void anisotropicDiffusion(InputArray src, OutputArray dst, float alpha, float K, int niters );
171171

172+
CV_EXPORTS_W double EDTest(InputArray img, OutputArray out, int algo);
172173
//! @}
173174

174175
}

modules/ximgproc/samples/EDdemo.cpp

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#include <opencv2/highgui.hpp>
2+
#include <opencv2/videoio.hpp>
3+
#include <opencv2/imgproc.hpp>
4+
#include <opencv2/ximgproc.hpp>
5+
#include <iostream>
6+
7+
using namespace std;
8+
using namespace cv;
9+
10+
int main(int argc, const char** argv)
11+
{
12+
CommandLineParser parser(argc, argv, "{ @video | vtest.avi | path to video file}");
13+
VideoCapture cap(samples::findFileOrKeep(parser.get<String>("@video")));
14+
15+
Mat frame, out;
16+
17+
int algo = 0;
18+
19+
for (;;)
20+
{
21+
cap >> frame;
22+
23+
if (frame.empty())
24+
{
25+
cap.set(CAP_PROP_POS_FRAMES, 0);
26+
continue;
27+
}
28+
29+
cout << cv::ximgproc::EDTest(frame, out, algo) << endl;
30+
imshow("test", out);
31+
32+
int Key = waitKey(1);
33+
34+
if (Key == 27)
35+
break;
36+
37+
if (Key == 32)
38+
{
39+
algo = (algo + 1) % 6;
40+
}
41+
}
42+
return 0;
43+
}

0 commit comments

Comments
 (0)