iPhone and OpenCV

2019-01-01 09:37发布

I know that OpenCV was ported to Mac OS X, however I did not find any info about a port to the iPhone.

I am not a Mac developer, so that I do not know whether a Mac OS X port is enough for the iPhone.

Does anyone know better than me?

标签: iphone opencv
13条回答
大哥的爱人
2楼-- · 2019-01-01 10:25

You can also install OpenCV using a package manager like Cocoapods.

To quote the installation guide:

You want to add pod 'OpenCV', '~> 3.0' similar to the following to your Podfile:

target 'MyApp' do
    pod 'OpenCV', '~> 3.0' 
end

Then run a pod install inside your terminal, or from CocoaPods.app.

查看更多
梦该遗忘
3楼-- · 2019-01-01 10:29

All you need is to generate XCode project for OpenCV project using cmake or cmake gui tool. Remember to set option to generate XCode project instead of the default option to use CMakeFiles. Open generated project, change the base SDK to iPhone SDK, and hit build!

Since OpenCV does not support iOS at now (but they has announced iPhone support in version 2.2), highgui library won't compile. So if you need camera access you have to write it yourself.

Anyway, other libraries should compile and work on the device. (Works for me).

查看更多
千与千寻千般痛.
4楼-- · 2019-01-01 10:30

OpenCV does indeed work on the iphone. Use the configure script here to compile the library: cross compiling for iphone

You just have to cross-compile just as you do your apps.

查看更多
泛滥B
5楼-- · 2019-01-01 10:30

I haven't tried using OpenCV specifically, but I do dev for the iPhone and can say that most libraries I've tried that work on OS X DO NOT work on the iPhone out of the box. Some of them just needed a little tweaking/configuration to be done and then it was fine on the iPhone, but the reality is that the phone is missing quite a few backend components that OS X supports. Most complex libraries (OpenCV sounds like one of them) aren't going to work without a major effort - particularly since OpenCV sounds like it depends on several other external libraries as well...so those would have to be ported too.

查看更多
冷夜・残月
6楼-- · 2019-01-01 10:32

Here's modified script (based on the one from LambdaJive) that builds universal OpenCV framework for iPhone/iPhone Simulator - universal-i386arm opencv framework

查看更多
流年柔荑漫光年
7楼-- · 2019-01-01 10:35

Note that OpenCV runs very fast on Intel chips but the iPhone is arm. Of course OpenCV is extremely useful but it won't be that fast. Also, there's no way to get a live video stream on the iPhone so all of the normal potential CV applications sort of lose their appeal, don't they?

查看更多
登录 后发表回答