Hello together,
is it possible to use the openCV C/C++ (windows download) code in a shared or a portable project?
I tried to use the android native openCV in an android project with java binding and it works, but I also need it in windows phone and iOS. It would be very
handsome, if I could use one library for all three project (iOS, WindowsPhone, Android).
Unfortunately, you can't mix regular C/C++ and .NET in a single application. Also, the opencv code has to be compiled to native code for each platform, so you have to have a separate library for each target anyway. There's no way to create a universal library from the native code. Also, Xamarin.iOS can't use native libraries directly, so you'd have to either create a binding or implement P/Invokes for everything (not recommended).
So, in the end, you wind up having to implement a bunch of separate stuff for each platform anyway.
Answers
Portable Class Libraries are specifically .NET assemblies, so that's not going to work.
Generally, what you would do is write an interface that your PCL will use, then have each of your platform-specific projects create a concrete instance and inject that into the PCL.
Okey and in a Shared Project?
I want to implement my opencv code one time (in the shared part) and not in each plattform. If I do it with the dependency service I have to implement the code in each plattform and add the opencv library for each project seperatly.
Unfortunately, you can't mix regular C/C++ and .NET in a single application. Also, the opencv code has to be compiled to native code for each platform, so you have to have a separate library for each target anyway. There's no way to create a universal library from the native code. Also, Xamarin.iOS can't use native libraries directly, so you'd have to either create a binding or implement P/Invokes for everything (not recommended).
So, in the end, you wind up having to implement a bunch of separate stuff for each platform anyway.