简体   繁体   English

如何在 Swift 中集成 openCV python 代码

[英]how to integrate openCV python code in Swift

I wrote a code using openCV in Python and I want to integrate it into my IOS application.我在 Python 中使用 openCV 编写了一个代码,我想将它集成到我的 IOS 应用程序中。 Existing tutorials are outdated and I got error saying "'opencv2/core.hpp' file not found".现有教程已过时,我收到错误消息“找不到‘opencv2/core.hpp’文件”。 I really appreciate if you can help me answering these:如果你能帮我回答这些问题,我真的很感激:

  1. Can I integrate openCV in Python directly into IOS or do I have to convert it to C++?我可以将 openCV 中的 Python 直接集成到 IOS 中还是必须将其转换为 ZF6F87C39FDCF8B3C3FEEZF7?
  2. If I can integrate it how to do it without getting core.hpp error?如果我可以集成它怎么做而不会出现 core.hpp 错误?

after a couple of days more intensive study I understood that to use OpenCV framework does not mean to integrate a python code into the Swift code.经过几天的深入研究,我了解到使用 OpenCV 框架并不意味着将 python 代码集成到 Swift 代码中。 It requires to code in the.mm file with C++ syntax.它需要使用 C++ 语法在 .mm 文件中编码。 There is a python to C converter called cython and you can create c extension for your code but it does not solve the problem.有一个名为 cython 的 python 到 C 转换器,您可以为您的代码创建 c 扩展,但它不能解决问题。

The best openCV framework integration into the code described in the link below.最好将 openCV 框架集成到下面链接中描述的代码中。 Plus there is a sample code you can download to check.另外,您可以下载示例代码以进行检查。 Hope it helps:希望能帮助到你:

OpenCVFramework integration in Xcode Xcode 中的 OpenCVFramework 集成

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM