mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-20 21:40:49 +08:00
Lines extraction and descriptors testing completed
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include <opencv2/line_descriptor.hpp>
|
||||
|
||||
|
||||
#include "opencv2/core/utility.hpp"
|
||||
#include "opencv2/core/private.hpp"
|
||||
#include <opencv2/imgproc.hpp>
|
||||
@@ -18,6 +17,14 @@ static const char* keys =
|
||||
};
|
||||
|
||||
|
||||
static void help()
|
||||
{
|
||||
cout << "\nThis example shows the functionalities of lines extraction " <<
|
||||
"furnished by BinaryDescriptor class\n" <<
|
||||
"Please, run this sample using a command in the form\n" <<
|
||||
"./example_line_descriptor_lines_extraction <path_to_input_image>" << endl;
|
||||
}
|
||||
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
/* get parameters from comand line */
|
||||
@@ -26,7 +33,7 @@ int main( int argc, char** argv )
|
||||
|
||||
if(image_path.empty())
|
||||
{
|
||||
// help();
|
||||
help();
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -49,7 +56,7 @@ int main( int argc, char** argv )
|
||||
vector<KeyLine> lines;
|
||||
|
||||
/* extract lines */
|
||||
bd->detectKL(imageMat, lines, mask);
|
||||
bd->detect(imageMat, lines, mask);
|
||||
|
||||
/* draw lines extracted from octave 0 */
|
||||
cv::Mat output = imageMat.clone();
|
||||
@@ -70,9 +77,6 @@ int main( int argc, char** argv )
|
||||
|
||||
/* draw line */
|
||||
line(output, pt1, pt2, Scalar(B,G,R), 5);
|
||||
std::cout << "Dati linea" << " " << kl.startPointX << " " <<
|
||||
kl.startPointY << " " << kl.endPointX << " " <<
|
||||
kl.endPointY << " " << kl.lineLength << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user