fixed gpu samples build

pull/13383/head
Vladislav Vinogradov 13 years ago
parent 804d9b72f6
commit 11a5e78042
  1. 2
      samples/gpu/hog.cpp
  2. 14
      samples/gpu/morfology.cpp
  3. 12
      samples/gpu/stereo_match.cpp
  4. 4
      samples/gpu/surf_keypoint_matcher.cpp

@ -312,7 +312,7 @@ void App::run()
hogWorkBegin();
if (use_gpu)
{
gpu_img = img;
gpu_img.upload(img);
gpu_hog.detectMultiScale(gpu_img, found, hit_threshold, win_stride,
Size(0, 0), scale, gr_threshold);
}

@ -61,8 +61,18 @@ void ErodeDilate(int, void*)
int main( int argc, char** argv )
{
char* filename = argc == 2 ? argv[1] : (char*)"baboon.jpg";
if(string(argv[1]) == "--help" || (src = imread(filename,1)).data == 0)
return help(), -1;
if (string(argv[1]) == "--help")
{
help();
return -1;
}
src.upload(imread(filename, 1));
if (src.empty())
{
help();
return -1;
}
help();

@ -162,8 +162,8 @@ void App::run()
if (right_src.empty()) throw runtime_error("can't open file \"" + p.right + "\"");
cvtColor(left_src, left, CV_BGR2GRAY);
cvtColor(right_src, right, CV_BGR2GRAY);
d_left = left;
d_right = right;
d_left.upload(left);
d_right.upload(right);
imshow("left", left);
imshow("right", right);
@ -193,8 +193,8 @@ void App::run()
cvtColor(left_src, left, CV_BGR2GRAY);
cvtColor(right_src, right, CV_BGR2GRAY);
cout << "image_channels: " << left.channels() << endl;
d_left = left;
d_right = right;
d_left.upload(left);
d_right.upload(right);
imshow("left", left);
imshow("right", right);
}
@ -262,8 +262,8 @@ void App::handleKey(char key)
cvtColor(left_src, left, CV_BGR2GRAY);
cvtColor(right_src, right, CV_BGR2GRAY);
}
d_left = left;
d_right = right;
d_left.upload(left);
d_right.upload(right);
cout << "image_channels: " << left.channels() << endl;
imshow("left", left);
imshow("right", right);

@ -28,12 +28,12 @@ int main(int argc, char* argv[])
{
if (string(argv[i]) == "--left")
{
img1 = imread(argv[++i], CV_LOAD_IMAGE_GRAYSCALE);
img1.upload(imread(argv[++i], CV_LOAD_IMAGE_GRAYSCALE));
CV_Assert(!img1.empty());
}
else if (string(argv[i]) == "--right")
{
img2 = imread(argv[++i], CV_LOAD_IMAGE_GRAYSCALE);
img2.upload(imread(argv[++i], CV_LOAD_IMAGE_GRAYSCALE));
CV_Assert(!img2.empty());
}
else if (string(argv[i]) == "--help")

Loading…
Cancel
Save