Ask Your Question
0

Error while running Image stitching tutorial [closed]

asked 2019-11-12 13:50:57 -0600

Gourav gravatar image

updated 2019-11-12 14:00:33 -0600

When I compile the tutorial code on link it gives the following error

: error: ‘samples’ has not been declared
Mat img = imread(samples::findFile(argv[i]));

It can be corrected by replacing the above line with
Mat image=imread(argv[i],IMREAD_COLOR);
which compiles without any error
Also when I used the following
using namespace samples;
in the code it gives the following error
error: expected namespace-name before ‘;’ token using namespace samples;
It looks like the latest version of opencv does not support namespace "samples"
Should I edit the code on github

System Ubuntu 18.04
Compiled using "g++ stitch.cpp -o app pkg-config --cflags --libs opencv "

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2019-11-13 01:58:06.666111

1 answer

Sort by » oldest newest most voted
0

answered 2019-11-13 01:57:36 -0600

berak gravatar image

answered here

-- please make sure, your sample code matches your opencv version (samples::findFile is from 4.x)

edit flag offensive delete link more

Comments

@Gourav . Does this help if you move using namespace samples; to the top?

supra56 gravatar imagesupra56 ( 2019-11-13 06:58:28 -0600 )edit
1

supra, NO. 3.2 does not have this namespace (or the resp. code)

berak gravatar imageberak ( 2019-11-13 07:05:08 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-11-12 13:50:57 -0600

Seen: 765 times

Last updated: Nov 13 '19