1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge pull request #1581 from SpecLad:merge-2.4

This commit is contained in:
Roman Donchenko
2013-10-09 12:33:49 +04:00
committed by OpenCV Buildbot
128 changed files with 9431 additions and 3900 deletions
-8
View File
@@ -133,17 +133,9 @@ int main(int argc, const char* argv[])
}
#endif
#if defined(HAVE_OPENCV_OCL)
std::vector<cv::ocl::Info>info;
if(useCuda)
{
CV_Assert(!useOcl);
info.clear();
}
if(useOcl)
{
CV_Assert(!useCuda);
cv::ocl::getDevice(info);
}
#endif
Ptr<SuperResolution> superRes;
@@ -26,9 +26,6 @@ int main( int argc, const char** argv )
return -1;
}
std::vector<ocl::Info> infos;
ocl::getDevice(infos);
ocl::oclMat dsrc(src), dABFilter, dBFilter;
Size ksize(ks, ks);
+1 -4
View File
@@ -25,7 +25,7 @@ int main(int argc, const char** argv)
if (cmd.get<bool>("help"))
{
cout << "Usage : bgfg_segm [options]" << endl;
cout << "Avaible options:" << endl;
cout << "Available options:" << endl;
cmd.printMessage();
return 0;
}
@@ -55,9 +55,6 @@ int main(int argc, const char** argv)
return -1;
}
std::vector<cv::ocl::Info>info;
cv::ocl::getDevice(info);
Mat frame;
cap >> frame;
-3
View File
@@ -46,9 +46,6 @@ int main(int argc, char** argv)
createTrackbar("Tile Size", "CLAHE", &tilesize, 32, (TrackbarCallback)TSize_Callback);
createTrackbar("Clip Limit", "CLAHE", &cliplimit, 20, (TrackbarCallback)Clip_Callback);
vector<ocl::Info> info;
CV_Assert(ocl::getDevice(info));
Mat frame, outframe;
ocl::oclMat d_outframe;
+2 -11
View File
@@ -75,7 +75,8 @@ int main( int argc, const char** argv )
CommandLineParser cmd(argc, argv, keys);
if (cmd.get<bool>("help"))
{
cout << "Avaible options:" << endl;
cout << "Available options:" << endl;
cmd.printMessage();
return 0;
}
CvCapture* capture = 0;
@@ -122,16 +123,6 @@ int main( int argc, const char** argv )
cvNamedWindow( "result", 1 );
vector<ocl::Info> oclinfo;
int devnums = ocl::getDevice(oclinfo);
if( devnums < 1 )
{
std::cout << "no device found\n";
return -1;
}
//if you want to use undefault device, set it here
//setDevice(oclinfo[0]);
ocl::setBinpath("./");
if( capture )
{
cout << "In capture ..." << endl;
-2
View File
@@ -136,8 +136,6 @@ App::App(CommandLineParser& cmd)
void App::run()
{
vector<ocl::Info> oclinfo;
ocl::getDevice(oclinfo);
running = true;
VideoWriter video_writer;
+2 -7
View File
@@ -87,13 +87,6 @@ static void drawArrows(Mat& frame, const vector<Point2f>& prevPts, const vector<
int main(int argc, const char* argv[])
{
static std::vector<Info> ocl_info;
ocl::getDevice(ocl_info);
//if you want to use undefault device, set it here
setDevice(ocl_info[0]);
//set this to save kernel compile time from second time you run
ocl::setBinpath("./");
const char* keys =
"{ help h | false | print help message }"
"{ left l | | specify left image }"
@@ -109,6 +102,8 @@ int main(int argc, const char* argv[])
if (cmd.has("help"))
{
cout << "Usage: pyrlk_optical_flow [options]" << endl;
cout << "Available options:" << endl;
cmd.printMessage();
return 0;
}
+1 -3
View File
@@ -285,13 +285,11 @@ int main(int argc, char** argv)
string outfile = cmd.get<string>("o");
if(inputName.empty())
{
cout << "Avaible options:" << endl;
cout << "Available options:" << endl;
cmd.printMessage();
return 0;
}
vector<ocl::Info> info;
CV_Assert(ocl::getDevice(info));
int iterations = 10;
namedWindow( wndname, 1 );
vector<vector<Point> > squares_cpu, squares_ocl;
+2 -12
View File
@@ -79,28 +79,18 @@ int main(int argc, char** argv)
"{ r | right | | specify right image }"
"{ m | method | BM | specify match method(BM/BP/CSBP) }"
"{ n | ndisp | 64 | specify number of disparity levels }"
"{ s | cpu_ocl | false | use cpu or gpu as ocl device to process the image }"
"{ o | output | stereo_match_output.jpg | specify output path when input is images}";
CommandLineParser cmd(argc, argv, keys);
if (cmd.get<bool>("help"))
{
cout << "Avaible options:" << endl;
cout << "Available options:" << endl;
cmd.printMessage();
return 0;
}
try
{
App app(cmd);
int flag = CVCL_DEVICE_TYPE_GPU;
if(cmd.get<bool>("s") == true)
flag = CVCL_DEVICE_TYPE_CPU;
vector<Info> info;
if(getDevice(info, flag) == 0)
{
throw runtime_error("Error: Did not find a valid OpenCL device!");
}
cout << "Device name:" << info[0].DeviceName[0] << endl;
cout << "Device name:" << cv::ocl::Context::getContext()->getDeviceInfo().deviceName << endl;
app.run();
}
+2 -10
View File
@@ -146,19 +146,11 @@ int main(int argc, char* argv[])
CommandLineParser cmd(argc, argv, keys);
if (cmd.get<bool>("help"))
{
std::cout << "Avaible options:" << std::endl;
std::cout << "Available options:" << std::endl;
cmd.printMessage();
return 0;
}
std::vector<cv::ocl::Info> info;
if(cv::ocl::getDevice(info) == 0)
{
std::cout << "Error: Did not find a valid OpenCL device!" << std::endl;
return -1;
}
ocl::setDevice(info[0]);
Mat cpu_img1, cpu_img2, cpu_img1_grey, cpu_img2_grey;
oclMat img1, img2;
bool useCPU = cmd.get<bool>("c");
@@ -191,7 +183,7 @@ int main(int argc, char* argv[])
{
std::cout
<< "Device name:"
<< info[0].DeviceName[0]
<< cv::ocl::Context::getContext()->getDeviceInfo().deviceName
<< std::endl;
}
double surf_time = 0.;
+1 -8
View File
@@ -81,13 +81,6 @@ static void getFlowField(const Mat& u, const Mat& v, Mat& flowField)
int main(int argc, const char* argv[])
{
static std::vector<Info> ocl_info;
ocl::getDevice(ocl_info);
//if you want to use undefault device, set it here
setDevice(ocl_info[0]);
//set this to save kernel compile time from second time you run
ocl::setBinpath("./");
const char* keys =
"{ h | help | false | print help message }"
"{ l | left | | specify left image }"
@@ -102,7 +95,7 @@ int main(int argc, const char* argv[])
if (cmd.get<bool>("help"))
{
cout << "Usage: pyrlk_optical_flow [options]" << endl;
cout << "Avaible options:" << endl;
cout << "Available options:" << endl;
cmd.printMessage();
return 0;
}