TAPI: stitching: improve warpers

This commit is contained in:
Alexander Alekhin
2014-03-12 14:54:22 +04:00
committed by Andrey Pavlenko
parent 89e3e448f5
commit c1ea6f3c42
11 changed files with 149 additions and 325 deletions

View File

@@ -74,9 +74,6 @@ static void printUsage()
" --try_cuda (yes|no)\n"
" Try to use CUDA. The default value is 'no'. All default values\n"
" are for CPU mode.\n"
" --try_ocl (yes|no)\n"
" Try to use OpenCL. The default value is 'no'. All default values\n"
" are for CPU mode.\n"
"\nMotion Estimation Flags:\n"
" --work_megapix <float>\n"
" Resolution for image registration step. The default is 0.6 Mpx.\n"
@@ -127,7 +124,6 @@ static void printUsage()
vector<String> img_names;
bool preview = false;
bool try_cuda = false;
bool try_ocl = false;
double work_megapix = 0.6;
double seam_megapix = 0.1;
double compose_megapix = -1;
@@ -178,19 +174,6 @@ static int parseCmdArgs(int argc, char** argv)
}
i++;
}
else if (string(argv[i]) == "--try_ocl")
{
if (string(argv[i + 1]) == "no")
try_ocl = false;
else if (string(argv[i + 1]) == "yes")
try_ocl = true;
else
{
cout << "Bad --try_ocl flag value\n";
return -1;
}
i++;
}
else if (string(argv[i]) == "--work_megapix")
{
work_megapix = atof(argv[i + 1]);
@@ -571,17 +554,8 @@ int main(int argc, char* argv[])
// Warp images and their masks
Ptr<WarperCreator> warper_creator;
if (try_ocl)
{
if (warp_type == "plane")
warper_creator = makePtr<cv::PlaneWarperOcl>();
else if (warp_type == "cylindrical")
warper_creator = makePtr<cv::CylindricalWarperOcl>();
else if (warp_type == "spherical")
warper_creator = makePtr<cv::SphericalWarperOcl>();
}
#ifdef HAVE_OPENCV_CUDAWARPING
else if (try_cuda && cuda::getCudaEnabledDeviceCount() > 0)
if (try_cuda && cuda::getCudaEnabledDeviceCount() > 0)
{
if (warp_type == "plane")
warper_creator = makePtr<cv::PlaneWarperGpu>();