Ask Your Question
0

Is imread necessary in the sfm module?

asked 2019-06-23 16:03:30 -0500

jfields gravatar image

I would thank if someone could help me with a linkage error.

I compiled opencv with the sfm module and now I am trying to run a simple example using the command:

g++ estimate_3d_points.cpp -o estimate_3d_points -std=c++11 -I/usr/local/include/opencv4 -L/usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lopencv_viz -lopencv_sfm

I have a linkage error: /usr/bin/ld: /usr/local/lib/libopencv_sfm.so: undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&, int)' collect2: error: ld returned 1 exit status

Shouldn't opencv_codecs (where imread is) and opencv_fsm be two independent packages? How do I go around this?

edit retag flag offensive close merge delete

Comments

do you try to use static libs ?

berak gravatar imageberak ( 2019-06-23 16:46:38 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-06-24 02:56:34 -0500

LBerger gravatar image

updated 2019-06-24 07:46:17 -0500

No it can't be two independent packages. To reconstruct a scene you must call sfm::reconstruct. All prototypes use vector<string> for an image. image must be saved on hard drive.

reconstruct calls libmv_solveReconstructionImpl third party lib

Without a pull request you cannot changed this : to build sfm module imread is necessary

I don't know what is estimate_3d_points.cpp

on windows to build trajectory_reconstruction.cpp I need libs

..\..\lib\Debug\opencv_sfm411d.lib;..\..\lib\Debug\opencv_xfeatures2d411d.lib;..\..\lib\Debug\opencv_highgui411d.lib;..\..\lib\Debug\opencv_viz411d.lib;..\..\lib\Debug\opencv_ml411d.lib;..\..\lib\Debug\opencv_shape411d.lib;..\..\lib\Debug\opencv_calib3d411d.lib;..\..\lib\Debug\opencv_features2d411d.lib;..\..\lib\Debug\opencv_flann411d.lib;..\..\lib\Debug\opencv_videoio411d.lib;..\..\lib\Debug\opencv_imgcodecs411d.lib;..\..\lib\Debug\opencv_imgproc411d.lib;..\..\lib\Debug\opencv_core411d.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib

and sfm module libs are

..\..\lib\Debug\opencv_imgcodecs411d.lib
..\..\lib\Debug\opencv_imgcodecs411d.lib;..\..\lib\Debug\opencv_xfeatures2d411d.lib;opengl32.lib;glu32.lib;..\..\3rdparty\lib\Debug\ippiwd.lib;..\..\3rdparty\ippicv\ippicv_win\icv\lib\intel64\ippicvmt.lib;..\..\lib\Debug\correspondence.lib;..\..\lib\Debug\multiview.lib;..\..\lib\Debug\numeric.lib;G:\Lib\install\glog\lib\glogd.lib;..\..\lib\Debug\simple_pipeline.lib;..\..\lib\Debug\opencv_ml411d.lib;..\..\lib\Debug\opencv_shape411d.lib;..\..\lib\Debug\opencv_calib3d411d.lib;..\..\lib\Debug\opencv_features2d411d.lib;..\..\lib\Debug\opencv_flann411d.lib;..\..\lib\Debug\opencv_imgproc411d.lib;..\..\lib\Debug\opencv_core411d.lib;..\..\lib\Debug\multiview.lib;..\..\lib\Debug\numeric.lib;G:\Lib\install\ceres-solver\lib\ceres-debug.lib;G:\Lib\install\glog\lib\glogd.lib;G:\Lib\install\gflags\lib\gflags.lib;G:\Lib\install\gflags\lib\gflags.lib;shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib
edit flag offensive delete link more

Comments

Very well, but if that is so, and I have no problem using imread on its own, how do I compile opencv so I do not get this error?

jfields gravatar imagejfields ( 2019-06-24 07:05:07 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-06-23 16:03:30 -0500

Seen: 46 times

Last updated: Jun 24