Issue 1:
System information (version)

OpenCV => 3.2.0

Operating System / Platform => Ubuntu 18.04

Compiler => Ubuntu terminal (g++)

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

Detailed description

The Image stitching tutorial gives the following error

: error: ‘samples’ has not been declared

Mat img = imread(samples::findFile(argv[i]));

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"

It can be corrected by replacing the above line with

Mat image=imread(argv[1],IMREAD_COLOR);

Can I take up this issue and fix this

Steps to reproduce

Here is the code from the tutorial

#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
String imageName( "HappyFish.jpg" ); // by default
if( argc > 1)
{
imageName = argv[1];
}
Mat image;
image = imread( samples::findFile( imageName ), IMREAD_COLOR ); // Read the file

if( image.empty() ) // Check for invalid input
{
cout << "Could not open or find the image" << std::endl ;
return -1;
}
namedWindow( "Display window", WINDOW_AUTOSIZE ); // Create a window for display.
imshow( "Display window", image ); // Show our image inside it.
waitKey(0); // Wait for a keystroke in the window
return 0;
}

Issue 2:
System information (version)

OpenCV => 3.4.3

Operating System / Platform => Ubuntu 16.04 64bit

Compiler => GCC 5.4.0

Cuda => 9.2

TBB/MKL => 2018 Update 3 (2018.3.222)

Detailed description

make VERBOSE=1 install produces the following error:

[ 25%] Linking CXX executable ../../bin/opencv_test_hdf
cd /ascldap/users/aparikh/opencv/build/modules/hdf && /usr/bin/cmake -E cmake_link_script CMakeFiles/opencv_test_hdf.dir/link.txt --verbose=1
/usr/bin/c++ -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -Wno-invalid-offsetof -O3 -DNDEBUG -DNDEBUG -Wl,--gc-sections CMakeFiles/opencv_test_hdf.dir/test/test_main.cpp.o CMakeFiles/opencv_test_hdf.dir/test/test_hdf5.cpp.o -o ../../bin/opencv_test_hdf -L/usr/local/cuda/lib64 ../../lib/libopencv_ts.a ../../lib/libopencv_hdf.so.4.0.0 ../../lib/libopencv_highgui.so.4.0.0 -ldl -lm -lpthread -lrt ../../3rdparty/lib/libippiw.a ../../3rdparty/ippicv/ippicv_lnx/lib/intel64/libippicv.a -lcudart -lnppc -lnppial -lnppicc -lnppicom -lnppidei -lnppif -lnppig -lnppim -lnppist -lnppisu -lnppitc -lnpps -lcublas -lcufft -L/usr/local/cuda/lib64 ../../lib/libopencv_videoio.so.4.0.0 ../../lib/libopencv_imgcodecs.so.4.0.0 ../../lib/libopencv_imgproc.so.4.0.0 ../../lib/libopencv_core.so.4.0.0 ../../lib/libopencv_cudev.so.4.0.0 -Wl,-rpath,/usr/local/cuda/lib64:/ascldap/users/aparikh/opencv/build/lib
/usr/bin/ld: warning: libtbb.so.2, needed by ../../lib/libopencv_core.so.4.0.0, not found (try using -rpath or -rpath-link)
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::interface5::internal::task_base::destroy(tbb::task&)'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::task::note_affinity(unsigned short)'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::interface7::internal::task_arena_base::internal_current_slot()'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::task_group_context::is_group_execution_cancelled() const'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
../../lib/libopencv_core.so.4.0.0: undefined reference to `typeinfo for tbb::task'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::task_group_context::reset()'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::interface7::internal::task_arena_base::internal_terminate()'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::internal::allocate_root_with_context_proxy::free(tbb::task&) const'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::task_group_context::init()'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::interface7::internal::task_arena_base::internal_initialize()'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::internal::get_initial_auto_partitioner_divisor()'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::task_group_context::~task_group_context()'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::internal::allocate_child_proxy::allocate(unsigned long) const'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::interface7::internal::task_arena_base::internal_execute(tbb::interface7::internal::delegate_base&) const'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::internal::allocate_root_with_context_proxy::allocate(unsigned long) const'
../../lib/libopencv_core.so.4.0.0: undefined reference to `tbb::interface7::internal::task_arena_base::internal_max_concurrency(tbb::interface7::task_arena const*)'
collect2: error: ld returned 1 exit status
modules/hdf/CMakeFiles/opencv_test_hdf.dir/build.make:130: recipe for target 'bin/opencv_test_hdf' failed
make[2]: *** [bin/opencv_test_hdf] Error 1
make[2]: Leaving directory '/home/aparikh/opencv/build'
CMakeFiles/Makefile2:3617: recipe for target 'modules/hdf/CMakeFiles/opencv_test_hdf.dir/all' failed
make[1]: *** [modules/hdf/CMakeFiles/opencv_test_hdf.dir/all] Error 2
make[1]: Leaving directory '/home/aparikh/opencv/build'
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

Surprisingly, regular make runs fine without any errors. The intel environment variables are set by using source /opt/intel/bin/compilervars.sh -arch intel64 -platform linux in my .bashrc, which is reflected in $LD_LIBRARY_PATH and $LIBRARY_PATH:

$ echo $LIBRARY_PATH
/opt/intel/compilers_and_libraries_2018.3.222/linux/ipp/lib/intel64:/opt/intel/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64_lin:/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64_lin:/opt/intel/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7:/opt/intel/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7

$ echo $LD_LIBRARY_PATH
/opt/intel/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64:/opt/intel/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64_lin:/opt/intel/compilers_and_libraries_2018.3.222/linux/ipp/lib/intel64:/opt/intel/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64_lin:/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64_lin:/opt/intel/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7:/opt/intel/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7

Steps to reproduce

My cmake config:

General configuration for OpenCV 4.0.0-pre =====================================
Version control: 3.4.3-264-gb01f638-dirty

Extra modules:
Location (extra): /home/aparikh/opencv_contrib/modules
Version control (extra): 3.4.3

Platform:
Timestamp: 2018-09-11T00:41:46Z
Host: Linux 4.15.0-33-generic x86_64
CMake: 3.5.1
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: Release

CPU/HW features:
Baseline: SSE SSE2 SSE3
requested: SSE3
Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
SSE4_1 (4 files): + SSSE3 SSE4_1
SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2
FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
AVX (6 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
AVX2 (10 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
AVX512_SKX (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_SKX

C/C++:
Built as dynamic libs?: YES
C++ Compiler: /usr/bin/c++ (ver 5.4.0)
C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: /usr/bin/cc
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release):
Linker flags (Debug):
ccache: NO
Precompiled headers: YES
Extra dependencies: dl m pthread rt cudart nppc nppial nppicc nppicom nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cufft -L/usr/local/cuda/lib64
3rdparty dependencies:

OpenCV modules:
To be built: aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dpm face features2d flann fuzzy hdf hfs highgui img_hash imgcodecs imgproc java_bindings_generator line_descriptor ml objdetect optflow phase_unwrapping photo plot reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
Disabled: js python2 python_bindings_generator world
Disabled by dependency: -
Unavailable: cnn_3dobj cvv freetype java matlab ovis python3 sfm viz
Applications: tests perf_tests apps
Documentation: NO
Non-free algorithms: YES

GUI:
GTK+: NO
VTK support: NO

Media I/O:
ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.8)
JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 80)
WEBP: /usr/lib/x86_64-linux-gnu/libwebp.so (ver encoder: 0x0202)
PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.20)
TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.0.6)
JPEG 2000: /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
HDR: YES
SUNRASTER: YES
PXM: YES
PFM: YES

Video I/O:
DC1394: NO
FFMPEG: YES
avcodec: YES (ver 56.60.100)
avformat: YES (ver 56.40.101)
avutil: YES (ver 54.31.100)
swscale: YES (ver 3.1.101)
avresample: NO
GStreamer: NO
libv4l/libv4l2: NO
v4l/v4l2: linux/videodev2.h

Parallel framework: TBB (ver 2018.0 interface 10004)

Trace: YES (with Intel ITT)

Other third-party libraries:
Intel IPP: 2017.0.3 [2017.0.3]
at: /ascldap/users/aparikh/opencv/build/3rdparty/ippicv/ippicv_lnx
Intel IPP IW: sources (2017.0.3)
at: /ascldap/users/aparikh/opencv/build/3rdparty/ippicv/ippiw_lnx
Lapack: YES (/opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64/libmkl_intel_lp64.so /opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64/libmkl_sequential.so /opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64/libmkl_core.so /opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64/libmkl_intel_lp64.so /opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64/libmkl_sequential.so /opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64/libmkl_core.so /opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64/libmkl_intel_lp64.so /opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64/libmkl_sequential.so /opt/intel/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64/libmkl_core.so -lpthread -lm -ldl)
Eigen: YES (ver 3.3.90)
Custom HAL: NO
Protobuf: build (3.5.1)

NVIDIA CUDA: YES (ver 9.2, CUFFT CUBLAS)
NVIDIA GPU arch: 61
NVIDIA PTX archs:

OpenCL: YES (no extra features)
Include path: /ascldap/users/aparikh/opencv/3rdparty/include/opencl/1.2
Link libraries: Dynamic load

Python (for build): /usr/bin/python3

Java:
ant: NO
JNI: NO
Java wrappers: NO
Java tests: NO

Matlab: NO

Install to: /usr/local
-----------------------------------------------------------------