如何从 Xamarin(Android 和 iOS)使用 OpenCV?

编程入门 行业动态 更新时间:2024-10-10 17:27:26
本文介绍了如何从 Xamarin(Android 和 iOS)使用 OpenCV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想使用 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?

本文发布于:2023-11-27 11:00:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637795.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Android   Xamarin   OpenCV   iOS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!