Ask Your Question
0

Building minimal OpenCV with just Features2D

asked 2017-08-22 16:06:13 -0500

Mr.Curious gravatar image

updated 2017-08-23 15:09:05 -0500

Hi

I want to build a minimal version of OpenCV 3.2.0 which includes the features2d module, for including in an iOS project. I'm using the handy build_framework.py script to generate the library.

By reading the CMakeLists.txt files, I gather that features2d requires core, flann, imgproc, and ml. None of those have additional dependencies so it should be possible to build the library excluding all but those 5.

However, while that does build, I get linker errors when trying to build an app against it. If I also include the calib3d module, the errors go away. This is rather strange as none of the above modules have a dependency on calib3d.

Specific error message when building a mobile app using this library without calib3d included:

Undefined symbols for architecture arm64: "cv::findHomography(cv::_InputArray const&, cv::_InputArray const&, int, double, cv::_OutputArray const&, int, double)", referenced from: myMethod in myLibrary.a(myLibrary.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Appreciate any pointers.

edit retag flag offensive close merge delete

Comments

1

Can you post linker errors here?

mshabunin gravatar imagemshabunin ( 2017-08-23 09:25:04 -0500 )edit

Added the error message to the question - thanks.

Mr.Curious gravatar imageMr.Curious ( 2017-08-23 16:22:00 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-08-25 01:33:44 -0500

mshabunin gravatar image

updated 2017-08-25 01:34:53 -0500

You are using cv::findHomography in your app and this function is provided by the calib3d module, that is why you have this dependency.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-08-22 16:06:13 -0500

Seen: 944 times

Last updated: Aug 25 '17