|
1 |
| -Xamarin.Android.OpenCV v3.1.0 |
2 |
| -======================== |
| 1 | +<img src="./art/repo_header.png" alt="OpenCV for Xamarin.Android" width="728" /> |
3 | 2 |
|
4 |
| -## C# bindings for the OpenCV Android SDK ## |
| 3 | +# OpenCV for Xamarin.Android |
5 | 4 |
|
6 |
| -I am not associated with either [OpenCV](http://opencv.org/) or [Xamarin .inc](http://xamarin.com/). All rights belong to their respective owners. |
| 5 | +A Xamarin.Android binding library for [OpenCV](https://opencv.org/) library. |
7 | 6 |
|
8 |
| -This repository includes a C# translation of the demo applications included with OpenCV4Android. |
| 7 | +## About |
| 8 | +This project is forked from [TrekDev/Xamarin.Android.OpenCV](https://github.com/TrekDev/Xamarin.Android.OpenCV), enhanced and maintained by Naxam Co.,Ltd.<br> |
| 9 | +We specialize in developing mobile applications using Xamarin and native technology stack.<br> |
9 | 10 |
|
10 |
| -## Installation ## |
11 |
| -1. Clone this repo |
12 |
| -2. Build the OpenCV.Binding project |
13 |
| -3. Reference "OpenCV.dll" from your project; found under `"Xamarin.Android.OpenCV\src\OpenCV.Binding\bin\[Debug|Release][-$ABI]\OpenCV.dll"` |
| 11 | +**Looking for developers for your project?**<br> |
14 | 12 |
|
15 |
| -## Reducing the `.dll` size ## |
16 |
| -OpenCV is huge; building the OpenCV binding project for the AnyCPU platform results in a .dll which is ~64MB! If this is too large for your Android application (and it should be) here are some methods to reduce the size: |
| 13 | +<a href="mailto:[email protected]"> |
| 14 | +<img src="https://github.com/NAXAM/naxam.github.io/blob/master/assets/img/hire_button.png?raw=true" height="40"></a> <br> |
17 | 15 |
|
18 |
| -### 1. Using platform specific build configurations ### |
19 |
| -There are platform specific build configurations for each ABI supported by both Xamarin.Android and OpenCV: `arm64-v8a`, `armeabi`, `armeabi-v7a`, `x86` & `x86_64`. Building for one ABI only includes the native libraries for that platform and the Java wrappers. This reduces OpenCV.dll to ~15MB. The down-side of using this method is that it may complicate your final build process if you wish to [support multiple platforms](https://developer.xamarin.com/guides/android/advanced_topics/build-abi-specific-apks/). |
| 16 | +## Installation |
| 17 | +``` |
| 18 | +Install-Package Xamarin.OpenCV.Droid |
| 19 | +``` |
20 | 20 |
|
21 |
| -### 2. Removing unnecessary native libraries |
22 |
| -It's very likely your project won't need *all* the native libraries included in the `OpenCV.Binding\Jars\[Abi]\` folders. You can delete any unnecessary `.so` files, but make sure to test your app *thoroughly*. If you remove a native library file that is later needed your users will get a nasty runtime error! Combining this with the method above we can reduce our `.dll` size to between 5-10MB. Much better. |
| 21 | +## Usage |
23 | 22 |
|
24 |
| -### 3. Using the `None` configuration ### |
25 |
| -If the `None` platform configuration is used no native libraries are bundled in the .dll, only the Java wrappers. The result is a .dll of ~1.5MB. However, now the native libraries must be installed at runtime. This is done using [OpenCVManager](https://play.google.com/store/apps/details?id=org.opencv.engine), a separate application the user installs from the GooglePlay store, which installs the native OpenCV libraries once which every application that uses OpenCV on the device can use. The `OpenCVLoader` class provides a utility method for detecting if the OpenCV libraries are provided by the application, or the OpenCVManager apk. |
| 23 | +Plz follow its official guide [here](https://docs.opencv.org/master/d9/d3f/tutorial_android_dev_intro.html) for more details. |
26 | 24 |
|
27 |
| - if (!OpenCVLoader.InitDebug()) |
28 |
| - { |
29 |
| - Log.Debug(TAG, |
30 |
| - "Internal OpenCV library not found. Using OpenCV Manager for initialization"); |
31 |
| - OpenCVLoader.InitAsync(OpenCVLoader.OpencvVersion300, this, mLoaderCallback); |
32 |
| - } |
33 |
| - else |
34 |
| - { |
35 |
| - Log.Debug(TAG, "OpenCV library found inside package. Using it!"); |
36 |
| - mLoaderCallback.OnManagerConnected(LoaderCallbackInterface.Success); |
37 |
| - } |
| 25 | +``` |
| 26 | +This binding library currently only contains native SO library. I |
| 27 | +f you want to use external libraries such as `libjpeg`, `libpng`, etc, you will need to download them following above guide then include directly into your application project. |
| 28 | +``` |
38 | 29 |
|
39 |
| -OpenCV can now be used when `OnManagerConnected(...)` has been called with the `Success` status. See the SDKDemo applications for working examples. |
| 30 | +## License |
40 | 31 |
|
41 |
| -This is the ideal solution if you have many separate applications that use the OpenCV library. To see what the installation process involves, build the SDK demo with the `None` configuration and follow the instructions when starting it up. |
| 32 | +OpenCV binding library for Android is released under the MIT license. |
| 33 | +See [LICENSE](./LICENSE) for details. |
42 | 34 |
|
43 |
| -More tricks to reduce the final size have been suggested by [@MarcorOnline](https://github.com/MarcorOnline) [here](https://github.com/TrekDev/Xamarin.Android.OpenCV/issues/14). |
| 35 | +# Get our showcases on AppStore/PlayStore |
| 36 | +Try our showcases to know more about our capabilities. |
44 | 37 |
|
45 |
| -## Documentation ## |
46 |
| -Documentation is available from [OpenCV](http://docs.opencv.org/2.4/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html). As with other Xamarin.Android binding projects, get/set method pairs have been replaced with C# properties and Events have been added to correspond with callback interface methods. Namespaces drop the `org.` prefix and are CamelCased. |
| 38 | +<a href="https://itunes.apple.com/us/developer/tuyen-vu/id1255432728/" > |
| 39 | +<img src="https://github.com/NAXAM/imagepicker-android-binding/raw/master/art/apple_store.png" width="117" height="34"></a> |
47 | 40 |
|
48 |
| -## Native application development ## |
49 |
| -It is possible to use C/C++ in your mobile OpenCV applications. See the facial recognition and mixed processing examples for how to do this. The C++ code is not compiled in the SDK demo project; it is only included for reference. The C++ code was compiled with eclipse and the ADT/NDK plugins, the resulting `.so` files are then included in this project in the /lib folder. |
| 41 | +<a href="https://play.google.com/store/apps/developer?id=NAXAM+CO.,+LTD" > |
| 42 | +<img src="https://github.com/NAXAM/imagepicker-android-binding/raw/master/art/google_store.png" width="117" height="34"></a> |
50 | 43 |
|
51 |
| -Cross compiling C++ libraries in the same solution is possible with Visual Studio 2015, see [this Xamarin blog post for details](https://blog.xamarin.com/build-and-debug-c-libraries-in-xamarin-android-apps-with-visual-studio-2015/). |
| 44 | +Contact us if interested. |
52 | 45 |
|
53 |
| -## Demo App ## |
54 |
| -The OpenCV4Android demo apps have been merged into a single application for simplicity |
| 46 | +< a href= "mailto:[email protected]"> |
| 47 | +<img src="https://github.com/NAXAM/naxam.github.io/blob/master/assets/img/hire_button.png" height="34"></a> <br> |
| 48 | +<br> |
55 | 49 |
|
56 |
| - |
57 |
| - |
58 |
| - |
59 |
| - |
60 |
| - |
61 |
| -## Contributing ## |
62 |
| -Contributions are very welcome, the OpenCV library is huge and any help is appreciated. If you notice an error, either with the Bindings (eg. a missing class) or the SDK demo [please raise an issue](https://github.com/TrekDev/Xamarin.Android.OpenCV/issues). |
63 |
| - |
64 |
| -Alternatively, you can fix it yourself and raise a pull request. Do this by forking the repo and creating a feature branch from `develop`. |
65 |
| - |
66 |
| -## License ## |
67 |
| -The Bindings and SDKDemo are provided under the MIT license. See LICENSE for details. OpenCV is provided under the [BSD licence](http://opencv.org/license.html). |
| 50 | +Follow us for the latest updates<br>[](https://twitter.com/intent/tweet?text=https://github.com/naxam/opencv-android-binding) |
| 51 | +[](https://twitter.com/naxamco) |
0 commit comments