Remove deprecated methods from cv::Algorithm
This commit is contained in:
@@ -26,32 +26,32 @@ using namespace cv::superres;
|
||||
cout << tm.getTimeSec() << " sec" << endl; \
|
||||
}
|
||||
|
||||
static Ptr<DenseOpticalFlowExt> createOptFlow(const string& name, bool useGpu)
|
||||
static Ptr<cv::superres::DenseOpticalFlowExt> createOptFlow(const string& name, bool useGpu)
|
||||
{
|
||||
if (name == "farneback")
|
||||
{
|
||||
if (useGpu)
|
||||
return createOptFlow_Farneback_CUDA();
|
||||
return cv::superres::createOptFlow_Farneback_CUDA();
|
||||
else
|
||||
return createOptFlow_Farneback();
|
||||
return cv::superres::createOptFlow_Farneback();
|
||||
}
|
||||
/*else if (name == "simple")
|
||||
return createOptFlow_Simple();*/
|
||||
else if (name == "tvl1")
|
||||
{
|
||||
if (useGpu)
|
||||
return createOptFlow_DualTVL1_CUDA();
|
||||
return cv::superres::createOptFlow_DualTVL1_CUDA();
|
||||
else
|
||||
return createOptFlow_DualTVL1();
|
||||
return cv::superres::createOptFlow_DualTVL1();
|
||||
}
|
||||
else if (name == "brox")
|
||||
return createOptFlow_Brox_CUDA();
|
||||
return cv::superres::createOptFlow_Brox_CUDA();
|
||||
else if (name == "pyrlk")
|
||||
return createOptFlow_PyrLK_CUDA();
|
||||
return cv::superres::createOptFlow_PyrLK_CUDA();
|
||||
else
|
||||
cerr << "Incorrect Optical Flow algorithm - " << name << endl;
|
||||
|
||||
return Ptr<DenseOpticalFlowExt>();
|
||||
return Ptr<cv::superres::DenseOpticalFlowExt>();
|
||||
}
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
@@ -92,15 +92,15 @@ int main(int argc, const char* argv[])
|
||||
else
|
||||
superRes = createSuperResolution_BTVL1();
|
||||
|
||||
Ptr<DenseOpticalFlowExt> of = createOptFlow(optFlow, useCuda);
|
||||
Ptr<cv::superres::DenseOpticalFlowExt> of = createOptFlow(optFlow, useCuda);
|
||||
|
||||
if (of.empty())
|
||||
return EXIT_FAILURE;
|
||||
superRes->set("opticalFlow", of);
|
||||
superRes->setOpticalFlow(of);
|
||||
|
||||
superRes->set("scale", scale);
|
||||
superRes->set("iterations", iterations);
|
||||
superRes->set("temporalAreaRadius", temporalAreaRadius);
|
||||
superRes->setScale(scale);
|
||||
superRes->setIterations(iterations);
|
||||
superRes->setTemporalAreaRadius(temporalAreaRadius);
|
||||
|
||||
Ptr<FrameSource> frameSource;
|
||||
if (useCuda)
|
||||
|
@@ -62,19 +62,17 @@ int main(int argc, char* argv[])
|
||||
cout << "FOUND " << keypoints2GPU.cols << " keypoints on second image" << endl;
|
||||
|
||||
// matching descriptors
|
||||
BFMatcher_CUDA matcher(surf.defaultNorm());
|
||||
GpuMat trainIdx, distance;
|
||||
matcher.matchSingle(descriptors1GPU, descriptors2GPU, trainIdx, distance);
|
||||
Ptr<cv::cuda::DescriptorMatcher> matcher = cv::cuda::DescriptorMatcher::createBFMatcher(surf.defaultNorm());
|
||||
vector<DMatch> matches;
|
||||
matcher->match(descriptors1GPU, descriptors2GPU, matches);
|
||||
|
||||
// downloading results
|
||||
vector<KeyPoint> keypoints1, keypoints2;
|
||||
vector<float> descriptors1, descriptors2;
|
||||
vector<DMatch> matches;
|
||||
surf.downloadKeypoints(keypoints1GPU, keypoints1);
|
||||
surf.downloadKeypoints(keypoints2GPU, keypoints2);
|
||||
surf.downloadDescriptors(descriptors1GPU, descriptors1);
|
||||
surf.downloadDescriptors(descriptors2GPU, descriptors2);
|
||||
BFMatcher_CUDA::matchDownload(trainIdx, distance, matches);
|
||||
|
||||
// drawing the results
|
||||
Mat img_matches;
|
||||
|
Reference in New Issue
Block a user