我想使用 Xamarin 为 iOS 和 Android 创建一个移动应用程序,我想调用一些 OpenCV 函数(例如,轮廓检测和透视变换).
I would like to create a mobile app using Xamarin for both iOS and Android, and I would like to call a few OpenCV functions (for example, contour detection and perspective transform).
我大致了解从C#调用C++函数的过程,但不知道如何从OpenCV 二进制文件适用于 iOS 和 Android.有一个 OpenCvSharp 的分支 支持 Xamarin.Android,但不支持 Xamarin.iOS.
I generally understand the process of calling C++ functions from C#, but I don't know how to do this from the OpenCV binaries provided for iOS and Android. There's a fork of OpenCvSharp that supports Xamarin.Android, but it doesn't support Xamarin.iOS.
我不打算将整个 OpenCV 库移植到 Xamarin(目前).我只是想调用一个非常小的函数子集.
I'm not looking to port the entire OpenCV library to Xamarin (yet). I'm just looking to call a very small subset of functions.
推荐答案对于 iOS,您应该自己为 Objective-C 提供绑定.这是一个如何做的例子,代码不是我的.
For iOS you should provide binding for Objective-C yourself. Here is an example of how to do, code is NOT mine.
github/trinnguyen/xamarin.ios-opencv
这是一篇描述步骤的文章:chamoda/how-to-use-opencv-with-xamarin-ios/
Here is an article describing the steps: chamoda/how-to-use-opencv-with-xamarin-ios/
[BaseType(typeof(NSObject))] interface OpenCV { [Export("version:")] NSString Version(); } private OpenCV OpenCV = new OpenCV(); Console.WriteLine(OpenCV.Version());更多推荐
如何从 Xamarin(Android 和 iOS)使用 OpenCV?
发布评论