#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
std::string in;
cv::CommandLineParser parser(argc, argv,
"{@input|../samples/data/corridor.jpg|input image}{help h||show help message}");
if (parser.has("help"))
{
parser.printMessage();
return 0;
}
in = parser.get<string>("@input");
if( image.empty() )
{
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_fld;
for(int run_count = 0; run_count < 10; run_count++) {
lines_fld.clear();
fld->detect(image, lines_fld);
double duration_ms = double(
getTickCount() - start) * 1000 / freq;
std::cout << "Elapsed time for FLD " << duration_ms << " ms." << std::endl;
}
Mat line_image_fld(image);
fld->drawSegments(line_image_fld, lines_fld);
imshow(
"FLD result", line_image_fld);
return 0;
}
Designed for command line parsing.
Definition: utility.hpp:789
int64_t int64
Definition: interface.h:61
double getTickFrequency()
Returns the number of ticks per second.
int64 getTickCount()
Returns the number of ticks.
void imshow(const String &winname, InputArray mat)
Displays an image in the specified window.
int waitKey(int delay=0)
Waits for a pressed key.
@ IMREAD_GRAYSCALE
If set, always convert image to the single channel grayscale image (codec internal conversion).
Definition: imgcodecs.hpp:71
CV_EXPORTS_W Mat imread(const String &filename, int flags=IMREAD_COLOR)
Loads an image from a file.
Ptr< FastLineDetector > createFastLineDetector(int _length_threshold=10, float _distance_threshold=1.414213562f, double _canny_th1=50.0, double _canny_th2=50.0, int _canny_aperture_size=3, bool _do_merge=false)
Creates a smart pointer to a FastLineDetector object and initializes it.
Definition: brightedges.hpp:47
"black box" representation of the file storage associated with a file on disk.
Definition: affine.hpp:52