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

asked 2020-05-24 02:22:29 -0500

dharma gravatar image

updated 2020-05-24 03:25:06 -0500

supra56 gravatar image

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)

edit retag flag offensive close merge delete

Comments

show your cmdline, how you call your program, please

(looks like you messed up your arguments)

berak gravatar imageberak ( 2020-05-24 03:58:23 -0500 )edit
1

This is how i called the program ./stitching --d3 --try_use_gpu yes --mode scans img1.jpg img2.jpg

dharma gravatar imagedharma ( 2020-05-24 04:07:42 -0500 )edit

--try_use_gpu yes is not an option in the current master branch sample (so it's taken for a file ?)

3.4 has it, but not master

berak gravatar imageberak ( 2020-05-24 06:21:57 -0500 )edit