Ask Your Question

Revision history [back]

executing stitching example throws error: (-2:Unspecified error) OpenCV samples: Can't find required data file: --try_use_gpu in function 'findFile'

following these steps i had compiled the "stitching.cpp" example

g++ stitching.cpp -o stitching.o -c -Wall -I/usr/include/opencv -I/usr/include/opencv2

g++ stitching.o -o stitching -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_highgui -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_quality -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_shape -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_dnn -lopencv_plot -lopencv_ml -lopencv_videostab -lopencv_videoio -lopencv_viz -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core -ldl -lm -lpthread -lrt

but while executing the binary i'm getting the following error

[ WARN:0] global ../modules/core/src/utils/samples.cpp (59) findFile cv::samples::findFile('--try_use_gpu') => '' terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.2.0) ../modules/core/src/utils/samples.cpp:62: error: (-2:Unspecified error) OpenCV samples: Can't find required data file: --try_use_gpu in function 'findFile'

Aborted (core dumped)

executing stitching example throws error: (-2:Unspecified error) OpenCV samples: Can't find required data file: --try_use_gpu in function 'findFile'

following these steps i had compiled the "stitching.cpp" exampleexample:

g++ stitching.cpp -o stitching.o -c
-c -Wall -I/usr/include/opencv -I/usr/include/opencv2

-I/usr/include/opencv2

g++ stitching.o -o stitching stitching -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_highgui -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_quality -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_shape -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_dnn -lopencv_plot -lopencv_ml -lopencv_videostab -lopencv_videoio -lopencv_viz -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core -ldl -lm -lpthread -lrt

-lrt

but while executing the binary i'm getting the following error

  

[ WARN:0] global ../modules/core/src/utils/samples.cpp (59) findFile cv::samples::findFile('--try_use_gpu') => '' terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.2.0) ../modules/core/src/utils/samples.cpp:62: error: (-2:Unspecified error) OpenCV samples: Can't find required data file: --try_use_gpu in function 'findFile'

'findFile'

Aborted (core dumped)