Fix build of samples
This commit is contained in:
@@ -26,41 +26,41 @@ static Mat loadImage(const string& name)
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
CommandLineParser cmd(argc, argv,
|
||||
"{ image i | pic1.png | input image }"
|
||||
"{ template t | templ.png | template image }"
|
||||
"{ scale s | | estimate scale }"
|
||||
"{ rotation r | | estimate rotation }"
|
||||
"{ gpu | | use gpu version }"
|
||||
"{ minDist | 100 | minimum distance between the centers of the detected objects }"
|
||||
"{ levels | 360 | R-Table levels }"
|
||||
"{ votesThreshold | 30 | the accumulator threshold for the template centers at the detection stage. The smaller it is, the more false positions may be detected }"
|
||||
"{ angleThresh | 10000 | angle votes treshold }"
|
||||
"{ scaleThresh | 1000 | scale votes treshold }"
|
||||
"{ posThresh | 100 | position votes threshold }"
|
||||
"{ dp | 2 | inverse ratio of the accumulator resolution to the image resolution }"
|
||||
"{ minScale | 0.5 | minimal scale to detect }"
|
||||
"{ maxScale | 2 | maximal scale to detect }"
|
||||
"{ scaleStep | 0.05 | scale step }"
|
||||
"{ minAngle | 0 | minimal rotation angle to detect in degrees }"
|
||||
"{ maxAngle | 360 | maximal rotation angle to detect in degrees }"
|
||||
"{ angleStep | 1 | angle step in degrees }"
|
||||
"{ maxSize | 1000 | maximal size of inner buffers }"
|
||||
"{ help h ? | | print help message }"
|
||||
"{ i | image | pic1.png | input image }"
|
||||
"{ t | template | templ.png | template image }"
|
||||
"{ s | scale | | estimate scale }"
|
||||
"{ r | rotation | | estimate rotation }"
|
||||
"{ | gpu | | use gpu version }"
|
||||
"{ | minDist | 100 | minimum distance between the centers of the detected objects }"
|
||||
"{ | levels | 360 | R-Table levels }"
|
||||
"{ | votesThreshold | 30 | the accumulator threshold for the template centers at the detection stage. The smaller it is, the more false positions may be detected }"
|
||||
"{ | angleThresh | 10000 | angle votes treshold }"
|
||||
"{ | scaleThresh | 1000 | scale votes treshold }"
|
||||
"{ | posThresh | 100 | position votes threshold }"
|
||||
"{ | dp | 2 | inverse ratio of the accumulator resolution to the image resolution }"
|
||||
"{ | minScale | 0.5 | minimal scale to detect }"
|
||||
"{ | maxScale | 2 | maximal scale to detect }"
|
||||
"{ | scaleStep | 0.05 | scale step }"
|
||||
"{ | minAngle | 0 | minimal rotation angle to detect in degrees }"
|
||||
"{ | maxAngle | 360 | maximal rotation angle to detect in degrees }"
|
||||
"{ | angleStep | 1 | angle step in degrees }"
|
||||
"{ | maxSize | 1000 | maximal size of inner buffers }"
|
||||
"{ h | help | | print help message }"
|
||||
);
|
||||
|
||||
cmd.about("This program demonstrates arbitary object finding with the Generalized Hough transform.");
|
||||
//cmd.about("This program demonstrates arbitary object finding with the Generalized Hough transform.");
|
||||
|
||||
if (cmd.has("help"))
|
||||
if (cmd.get<bool>("help"))
|
||||
{
|
||||
cmd.printMessage();
|
||||
cmd.printParams();
|
||||
return 0;
|
||||
}
|
||||
|
||||
const string templName = cmd.get<string>("template");
|
||||
const string imageName = cmd.get<string>("image");
|
||||
const bool estimateScale = cmd.has("scale");
|
||||
const bool estimateRotation = cmd.has("rotation");
|
||||
const bool useGpu = cmd.has("gpu");
|
||||
const bool estimateScale = cmd.get<bool>("scale");
|
||||
const bool estimateRotation = cmd.get<bool>("rotation");
|
||||
const bool useGpu = cmd.get<bool>("gpu");
|
||||
const double minDist = cmd.get<double>("minDist");
|
||||
const int levels = cmd.get<int>("levels");
|
||||
const int votesThreshold = cmd.get<int>("votesThreshold");
|
||||
@@ -76,12 +76,6 @@ int main(int argc, const char* argv[])
|
||||
const double angleStep = cmd.get<double>("angleStep");
|
||||
const int maxSize = cmd.get<int>("maxSize");
|
||||
|
||||
if (!cmd.check())
|
||||
{
|
||||
cmd.printErrors();
|
||||
return -1;
|
||||
}
|
||||
|
||||
Mat templ = loadImage(templName);
|
||||
Mat image = loadImage(imageName);
|
||||
|
||||
|
@@ -364,7 +364,7 @@ TEST(BruteForceMatcher)
|
||||
|
||||
// Init GPU matcher
|
||||
|
||||
gpu::BFMatcher_GPU d_matcher(NORM_L2);
|
||||
gpu::BruteForceMatcher_GPU_base d_matcher(gpu::BruteForceMatcher_GPU_base::L2Dist);
|
||||
|
||||
gpu::GpuMat d_query(query);
|
||||
gpu::GpuMat d_train(train);
|
||||
|
@@ -57,7 +57,7 @@ int main(int argc, char* argv[])
|
||||
cout << "FOUND " << keypoints2GPU.cols << " keypoints on second image" << endl;
|
||||
|
||||
// matching descriptors
|
||||
BFMatcher_GPU matcher(NORM_L2);
|
||||
gpu::BruteForceMatcher_GPU_base matcher(gpu::BruteForceMatcher_GPU_base::L2Dist);
|
||||
GpuMat trainIdx, distance;
|
||||
matcher.matchSingle(descriptors1GPU, descriptors2GPU, trainIdx, distance);
|
||||
|
||||
@@ -69,7 +69,7 @@ int main(int argc, char* argv[])
|
||||
surf.downloadKeypoints(keypoints2GPU, keypoints2);
|
||||
surf.downloadDescriptors(descriptors1GPU, descriptors1);
|
||||
surf.downloadDescriptors(descriptors2GPU, descriptors2);
|
||||
BFMatcher_GPU::matchDownload(trainIdx, distance, matches);
|
||||
BruteForceMatcher_GPU_base::matchDownload(trainIdx, distance, matches);
|
||||
|
||||
// drawing the results
|
||||
Mat img_matches;
|
||||
|
Reference in New Issue
Block a user