Skip to content

Commit

Permalink
-Test- adding ED , EDPF and EDLines algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
sturkmen72 committed Nov 3, 2019
1 parent 229cd72 commit 7c41cb5
Show file tree
Hide file tree
Showing 11 changed files with 2,926 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/ximgproc/include/opencv2/ximgproc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ CV_EXPORTS_W void thinning( InputArray src, OutputArray dst, int thinningType =
*/
CV_EXPORTS_W void anisotropicDiffusion(InputArray src, OutputArray dst, float alpha, float K, int niters );

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

}
Expand Down
43 changes: 43 additions & 0 deletions modules/ximgproc/samples/EDdemo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include <opencv2/highgui.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/ximgproc.hpp>
#include <iostream>

using namespace std;
using namespace cv;

int main(int argc, const char** argv)
{
CommandLineParser parser(argc, argv, "{ @video | vtest.avi | path to video file}" );
VideoCapture cap(samples::findFileOrKeep(parser.get<String>("@video")));

Mat frame,out;

int algo = 0;

for (;;)
{
cap >> frame;

if (frame.empty())
{
cap.set(CAP_PROP_POS_FRAMES, 0);
continue;
}

cout << cv::ximgproc::EDTest(frame, out, algo) << endl;
imshow("test", out);

int Key = waitKey(1);

if (Key == 27)
break;

if (Key == 32)
{
algo = (algo + 1) % 5;
}
}
return 0;
}
Loading

0 comments on commit 7c41cb5

Please sign in to comment.