Ask Your Question
0

How to build opencv_contrib module for iOS

asked 2014-08-27 02:58:48 -0600

sinsin gravatar image

I want to use some function in the newly introduced opencv_contrib modules on iOS, how can I build a iOS framework with those extra modules. Thanks in advance.

edit retag flag offensive close merge delete

Comments

Hi, i am having same problem, i need to build opencv_contrib as iOS framework but when i build it doesn't show me 'opencv/platforms/ios/build_framework.py' which i could run to create the framework. could you help, how you created the opencv2.framework file by including opencv_contrib. Any help is highly appreciated thanks.

zarar gravatar imagezarar ( 2014-09-20 15:05:34 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
2

answered 2014-11-29 03:35:07 -0600

onemach gravatar image

The official document does not include building iOS framework with opencv_contrib.

But inferring from the cmake file, you can copy the module you want (ximgproc in your case) to opencv/modules. Then run build_framework.py as usual.

You can checkout this post

edit flag offensive delete link more
1

answered 2014-08-27 07:30:30 -0600

The README file of the OpenCV contrib Github page has the complete explanation on how to do so. It involves adding a CMAKE command to the list pointing out the contribution modules.

You can build OpenCV, so it will include the modules from this repository. Here is the CMake command for you:

$ cd <opencv_build_directory>
$ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules <opencv_source_directory>
$ make -j5

As the result, OpenCV will be built in the <opencv_build_directory> with all modules from opencv_contrib repository. If you don't want all of the modules, use CMake's BUILD_opencv_* options. Like in this example:

$ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules -DBUILD_opencv_legacy=OFF <opencv_source_directory>

If you prefer using the gui version of cmake (cmake-gui), then, you can add opencv_contrib modules within opencv core by doing the following:

  1. start cmake-gui
  2. select the opencv source code folder and the folder where binaries will be built (the 2 upper forms of the interface)
  3. press the configure button. you will see all the opencv build parameters in the central interface
  4. browse the parameters and look for the form called OPENCV_EXTRA_MODULES_PATH (use the search form to focus rapidly on it)
  5. complete this OPENCV_EXTRA_MODULES_PATH by the proper pathname to the <opencv_contrib>/modules value using its browse button.
  6. press the configure button followed by the generate button (the first time, you will be asked which makefile style to use)
  7. build the opencv core with the method you chose (make and make install if you chose Unix makfile at step 6)
edit flag offensive delete link more

Comments

I followed the steps: $ cd <opencv_build_directory> $ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules <opencv_source_directory> $ make -j5 and all the modules of contrib are placing to the build folder which i was created. After this, what is next? I tried to execute the build_framework.py and the opencv2.framework still does not has xfeatures2d inside.

Ares gravatar imageAres ( 2017-04-29 02:45:39 -0600 )edit

This post is old. May be you should ask a new question and give a link to this post

LBerger gravatar imageLBerger ( 2017-04-29 02:53:34 -0600 )edit

Can anyone please suggest me right method to combine face.hpp file?

mau.tasol gravatar imagemau.tasol ( 2018-04-03 05:36:56 -0600 )edit

Question Tools

Stats

Asked: 2014-08-27 02:58:48 -0600

Seen: 7,113 times

Last updated: Nov 29 '14