All Projects → jeremy-ellis-tech → Xamarin.Android.OpenCV

jeremy-ellis-tech / Xamarin.Android.OpenCV

Licence: MIT license
C# bindings for the OpenCV Android SDK

Programming Languages

C#
18002 projects
C++
36643 projects - #6 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to Xamarin.Android.OpenCV

ably-dotnet
.NET, Xamarin and Mono client library SDK for Ably realtime messaging service
Stars: ✭ 32 (-63.22%)
Mutual labels:  xamarin
XamarinClipboardPlugin
Cross Platform Clipboard access for Xamarin
Stars: ✭ 24 (-72.41%)
Mutual labels:  xamarin
Xamarin.Forms.GoogleMaps.Clustering
A map library that brings support for clustering for Xamarin.Forms.GoogleMaps.
Stars: ✭ 23 (-73.56%)
Mutual labels:  xamarin
VersionTrackingPlugin
Version Tracking Plugin for Xamarin and Windows
Stars: ✭ 62 (-28.74%)
Mutual labels:  xamarin
PastelXamarinIos
🌒 Gradient animations on Xamarin-iOS
Stars: ✭ 17 (-80.46%)
Mutual labels:  xamarin
parquet-dotnet
🐬 Apache Parquet for modern .Net
Stars: ✭ 199 (+128.74%)
Mutual labels:  xamarin
XamarinIoTWorkshop
A workshop that demonstrates how to collect IoT data from a mobile device using a Xamarin app, aggregating the data to the cloud using Azure IoT Hub
Stars: ✭ 13 (-85.06%)
Mutual labels:  xamarin
bottomnavigationviewex-android-binding
Xamarin.Android Binding Library for Ittianyu BottomNavigationViewEx
Stars: ✭ 25 (-71.26%)
Mutual labels:  xamarin
YuzuMarker
🍋 [WIP] Manga Translation Tool
Stars: ✭ 76 (-12.64%)
Mutual labels:  xamarin
Xamarin.MediaGallery
This plugin is designed to picking and save images and video files from native gallery of Android and iOS devices and capture photos
Stars: ✭ 106 (+21.84%)
Mutual labels:  xamarin
DotNetGeoJson
GeoJson library for .Net
Stars: ✭ 22 (-74.71%)
Mutual labels:  xamarin
FocusOnXamarin
NET Conf: Focus on Xamarin samples
Stars: ✭ 55 (-36.78%)
Mutual labels:  xamarin
vs-material-icons-generator
This plugin will help you to set material design icons to your Xamarin projects In Visual Studio.
Stars: ✭ 50 (-42.53%)
Mutual labels:  xamarin
Xamarin.BookReader
Xamarin.Android复刻实现的 📕 "任阅" 网络小说阅读器 https://github.com/JustWayward/BookReader
Stars: ✭ 74 (-14.94%)
Mutual labels:  xamarin
PTVGlass
Melbourne Public Transport timetable for Google Glass
Stars: ✭ 41 (-52.87%)
Mutual labels:  xamarin
Xamarin.Android.Skobbler
C# bindings for the Skobbler Android SDK
Stars: ✭ 16 (-81.61%)
Mutual labels:  xamarin
auth0-xamarin-oidc-samples
Auth0 OIDC Client with Xamarin applications
Stars: ✭ 26 (-70.11%)
Mutual labels:  xamarin
ScreenshotPlugin
A simple Screenshot plugin for Xamarin and Windows to get and save screenshot in yours apps.
Stars: ✭ 32 (-63.22%)
Mutual labels:  xamarin
PCLExt.FileStorage
Portable Storage APIs
Stars: ✭ 35 (-59.77%)
Mutual labels:  xamarin
MvvmCross-Dreams
Xamarin MvvmCross DREAMS is an opinionated take on how to make an MvvmCross app.
Stars: ✭ 30 (-65.52%)
Mutual labels:  xamarin

Xamarin.Android.OpenCV v3.1.0

C# bindings for the OpenCV Android SDK

I am not associated with either OpenCV or Xamarin .inc. All rights belong to their respective owners.

This repository includes a C# translation of the demo applications included with OpenCV4Android.

Installation

  1. Clone this repo
  2. Build the OpenCV.Binding project
  3. Reference "OpenCV.dll" from your project; found under "Xamarin.Android.OpenCV\src\OpenCV.Binding\bin\[Debug|Release][-$ABI]\OpenCV.dll"

Reducing the .dll size

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:

1. Using platform specific build configurations

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.

2. Removing unnecessary native libraries

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.

3. Using the None configuration

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, 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.

        if (!OpenCVLoader.InitDebug())
        {
            Log.Debug(TAG,
			"Internal OpenCV library not found. Using OpenCV Manager for initialization");
            OpenCVLoader.InitAsync(OpenCVLoader.OpencvVersion300, this, mLoaderCallback);
        }
        else
        {
            Log.Debug(TAG, "OpenCV library found inside package. Using it!");
            mLoaderCallback.OnManagerConnected(LoaderCallbackInterface.Success);
        }

OpenCV can now be used when OnManagerConnected(...) has been called with the Success status. See the SDKDemo applications for working examples.

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.

More tricks to reduce the final size have been suggested by @MarcorOnline here.

Documentation

Documentation is available from OpenCV. 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.

Native application development

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.

Cross compiling C++ libraries in the same solution is possible with Visual Studio 2015, see this Xamarin blog post for details.

Demo App

The OpenCV4Android demo apps have been merged into a single application for simplicity

Histogram EdgeDetection Zoom Puzzle

Contributing

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.

Alternatively, you can fix it yourself and raise a pull request. Do this by forking the repo and creating a feature branch from develop.

License

The Bindings and SDKDemo are provided under the MIT license. See LICENSE for details. OpenCV is provided under the BSD licence.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].