开发者

Is it justified to use C/C++ for iOS/Android cross platform code in this case?

开发者 https://www.devze.com 2023-03-13 13:48 出处:网络
I am planning to write a mobile application (iOS and Android) where there is a lot of image recogn开发者_StackOverflowition processing.

I am planning to write a mobile application (iOS and Android) where there is a lot of image recogn开发者_StackOverflowition processing.

Is it a good solution to write the image recognition code in C or C++ to reuse it in both platforms ?

Will there be a lot platform specific C/C++ code that makes writing and maintaining it unjustified ?

Note: This application is based on image recognition and the biggest part of the code is for image recognition.


I would say yes. This is the kind of thing I believe the Android-NDK is best used for and since straight C compiles fine from OBJ-C, there could be a lot of code reused between the two platforms.


Try looking at the OpenCV library. It is a "library of programming functions for real time computer vision", and contains a lot of optimized code for image processing and recognition.

The OpenCV library readily supports Android-NDK in the source, here are the instructions for compiling the OpenCV library for Android and using it in your applications.

There is also an OpenCV - iOS project, which provides XCode project files to build OpenCV for iPhone and iPad.


I can't speak to the specifics of your image recognition library, but I can tell you that nearly all of the actual APIs for Android are in Java and all of Cocoa touch is in ObjC. This may not be an issue just for your library, but as soon as you need to hook into any of the existing APIs you will want to be writing Java or ObjC.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号