#include <iostream>
int main(
int argc,
char** argv)
{
string in;
CommandLineParser parser(argc, argv,
"{@input|corridor.jpg|input image}{help h||show help message}");
{
return 0;
}
in = samples::findFile(parser.
get<
string>(
"@input"));
Mat image = imread(in, IMREAD_GRAYSCALE);
{
return -1;
}
int length_threshold = 10;
float distance_threshold = 1.41421356f;
double canny_th1 = 50.0;
double canny_th2 = 50.0;
int canny_aperture_size = 3;
bool do_merge = false;
distance_threshold, canny_th1, canny_th2, canny_aperture_size,
do_merge);
vector<Vec4f> lines;
for (int run_count = 0; run_count < 5; run_count++) {
double freq = getTickFrequency();
lines.clear();
int64 start = getTickCount();
fld->detect(image, lines);
double duration_ms = double(getTickCount() - start) * 1000 / freq;
cout << "Elapsed time for FLD " << duration_ms << " ms." << endl;
}
Mat line_image_fld(image);
fld->drawSegments(line_image_fld, lines);
imshow("FLD result", line_image_fld);
waitKey();
return 0;
}
Designed for command line parsing.
Definition utility.hpp:890
T get(const String &name, bool space_delete=true) const
Access arguments by name.
Definition utility.hpp:956
void printMessage() const
Print help message.
bool has(const String &name) const
Check if field was provided in the command line.
n-dimensional dense array class
Definition mat.hpp:830
bool empty() const
Returns true if the array has no elements.
std::shared_ptr< _Tp > Ptr
Definition cvstd_wrapper.hpp:23
int64_t int64
Definition interface.h:61
int main(int argc, char *argv[])
Definition highgui_qt.cpp:3
Definition ximgproc.hpp:149