How to create a library that depends on OpenCV? - opencv

If I want to create a static library that depends on OpenCV, how do I do it? The idea is to make it easier for clients to link against the library I'm creating.
I'm using CMake to create the library. For me, linking against the library is not an issue.
Clients will receive my library and they will need to use it. How do I bundle OpenCV with it?
Update: For now I'm using a .so and this solves my problem. Now, is it possible to do the same thing with.a?

Related

CardIO conflicts with OpenCV framework

I thoroughly enjoy using Card.IO but in order for me to use it, it would have to be decoupled from it's OpenCV .a files, and instead link to the OpenCV framework. Most people have moved on from OpenCV2 to OpenCV3, and this library is stuck in the past. There appears to be no way to work around this, since your dependency is baked into your .a file. (calling creators of Card IO)
Has anyone else been able to work around this? Or is this library junk now if you use OpenCV?
Thanks,
Kevin

Using a third party library inside a framework

I am building an SDK which uses some third party library (for example, AFNetworking).
As far as I know, if an app using my SDK also wants to use the same library, it will end up generating a compile error with duplicate symbols.
What is the best way to overcome it?
Thanks!
P.S. I understand that prefixing the library's files inside the framework with some SDK prefix will solve the problem, but is there a cleaner way?

adding opencv to cmake --help-module

I like the help which is provided by --help-module. Here you can read how to add new libraries and which variables are being set. Because I only occasionally create a framework from scratch I only add libraries once and forget how to add them for the next time.
So, if I want to create a new project I only have to make a quick search with --help-module and the package I want to use. Unfortunately OpenCV is not in this list. So, I am curious if there is a way to add a help for Opencv?
TLTR; I want to add a help for OpenCV. Where I can refresh my mind on how to find opencv and how link against it etc.
I doubt this can be done.
The help module is generated from the RST CMake documentation. You are not supposed to add it there. It should be part of the documentation from the project which provides the module.

Objective-C – Use library from another library

I'm using SSToolKit in my project. The SSToolKit project uses GHUnitTest. I want to use GHUnitTest in my project. Do I need to download and install GHUnitTest or can I use the one included with SSToolKit. What is the best practice to do in this situation? (my app is an iOS-app)
You can use the one bundled with SSToolKit, there is no point in downloading another library. Basically, this is the same as if you downloaded the library alone - it is just bundled with another library.
If you try to add another GHUnitTest, it will create errors (not good :D ).

Implementing ASIFT in Android

I am new to both openCV and Android. I have to detect objects in my project. So, I have decided to use ASIFT for the same. However, the code they have given here is very lengthy. It contains lots of C file. It also doesn't have openCV support.
Some search on the SO itself suggested that it is easier to connect the ASIFT code to the openCV library, but I can't figure out how to do that. Can anyone help me by giving some link or by telling the steps that I should use to add ASIFT to my openCv library, which I can further utilize in making my Android application?
Also, I would like to know whether using Android NDK along with JNI to make calls to the C files or using Android SDK along with binary package for my android project(Object Detection) would be a suitable option for me?
Finally , I solved my problem by using the source code given at the website of ASIFT developers. I compacted all the source files together to make my own library using make. I then called the required function from the library using JNI.
It worked for me, but the execution is taking approximate 2 mins on an Android device. Anyone having some idea about ways to reduce the running time ?
They used very simple and slow brute force matching (just for proving of concept). You can use FLANN library and it will help a lot. http://docs.opencv.org/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.html

Resources