opencv-mobile icon indicating copy to clipboard operation
opencv-mobile copied to clipboard

Need guidence on how to build opencv-mobile

Open CyCle1024 opened this issue 4 years ago • 6 comments

It's a very useful repo!!! I have a suggestion that owners can release a guide on how to build opencv-mobile library on target platform with this repo and opencv official repo. Users can use this guide to do more custom changes and get a smaller package.

CyCle1024 avatar Feb 05 '21 08:02 CyCle1024

The OpenCV official documentation gives a page about cmake options, including how to list options, each option's meaning, etc, if you would like build a more customized opencv, you may refer to it: https://docs.opencv.org/4.5.0/db/d05/tutorial_config_reference.html

zchrissirhcz avatar Feb 10 '21 02:02 zchrissirhcz

how to build opencv2.framework with opencv+opencv_contrib and get a smaller package.

bjheweihua avatar Mar 07 '21 12:03 bjheweihua

Wonderful project! I can successfully build a customized OpenCV 4.5.4 with Emscripten SDK according to the instructions provided in "How-to-build your custom package". Only one minor problem: I apply the no-rtti patch but can't find -fno-rtti compiling option added to the C or CXX compiler flags. Do I need manually add this compiling option to each OpenCV target? Thanks!

mczhao1977 avatar Apr 18 '22 03:04 mczhao1977

Wonderful project! I can successfully build a customized OpenCV 4.5.4 with Emscripten SDK according to the instructions provided in "How-to-build your custom package". Only one minor problem: I apply the no-rtti patch but can't find -fno-rtti compiling option added to the C or CXX compiler flags. Do I need manually add this compiling option to each OpenCV target? Thanks!

Those patches remove rtti and exception related code. -fno-rtti and -fno-exceptions are specified when calling cmake. See the github action configure file for details: https://github.com/nihui/opencv-mobile/blob/master/.github/workflows/release.yml

zchrissirhcz avatar Apr 18 '22 05:04 zchrissirhcz

Hi zchrissirhcz, thanks for quick answer. I tried it and it works fine. Another question: If I want to include the module calib3d (and its dependency flann), do I need manually remove the rtti and exceptions related code? Thanks!

mczhao1977 avatar Apr 18 '22 07:04 mczhao1977

Hi zchrissirhcz, thanks for quick answer. I tried it and it works fine. Another question: If I want to include the module calib3d (and its dependency flann), do I need manually remove the rtti and exceptions related code? Thanks!

I didn't try using calib3d in opencv-mobile. I think you may try: compile with the official OpenCV's calib3d source code (same version as other modules, say, 4.5.5), with -fno-rtti and -fno-exceptions passed to cmake, if compler/linker gives error then modify related code, just like the provided patches do (e.g. opencv-4.5.4-no-rtti.patch). That it, manually remove some code then compile, until linking error.

zchrissirhcz avatar Apr 18 '22 08:04 zchrissirhcz