Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Computer Vision support ...
-
Is there any interest in having Pythonista be able to do CV apps?
I ran across this very recent project that seems to be looking for a new home. It is a port of OpenCV for ios.
https://github.com/macmade/OpenCV-iOS
No python bindings or anything but at least you could see how they access the camera and such. The image processing functions in OpenCV are useful in of themselves IMHO.
-
@wradcliffe, I'm interested in OpenCV-iOS, too.
But I don't know how to interface between pythonista and OpenCV-iOS.
Do you have any idea or information about it? -
Yes- it is basically a high speed image processing library with support for doing image capture. It would have be built into Pythonista as it is not written in Python. It already has interfaces to Python as part of the package so the amount of work to integrate it might not be too high. Much of what it contains overlaps with PIL but it does way more - like the direct support for the Camera for still captures as well as video.
Take a look at the list of Python tutorials ... http://docs.opencv.org/trunk/doc/py_tutorials/py_tutorials.html
-
@wradcliffe, Thank you. I am now testing xcode project template 1.6 beta, so I want to know if libpythonista is able to extend and call native code function written in C or Objective-C, like OpenCV-iOS.
-
+1 for OpenCV. I do image processing when I'm not having fun with Pythonista. I have heavily relied on python's wrappers for OpenCV over the last few years. The speed gain on PIL would be significant, in my opinion.
That being said, I'm guessing this would be one of the harder libraries to build and support. While the python wrappers have been around for a while, I think that they can still be somewhat temperamental, and not all C++ functions are wrapped.
-
@dvader9 - I used to work on the ImageMagick project as their "windows" guy and remember how big a pain it was dealing with builds including libraries from a variety of other projects. It was a constant pain and NO fun at all. On that project we wanted to support both static and dynamic (DLL) builds and each library would do things differently. I imagine that ios builds are painful especially when the platform upgrades occur.
@jup310 - I can't answer whether you can add something like OpenCV-IOS into the Pythonista XCode build. Maybe Ole will weigh in on that. I don't own a Mac desktop or laptop so I can't even try it.
-
Wow, what a coincidence. Just today I learned about OpenCV and I tried to install it on my PC (failed so far). So I go login to the Pythonista forums, let's search opencv, maybe someone already suggested it? And there you are. At the very same day.
TL;DR:
Yes, I would like to have this integrated, even though I have no idea if/how easily it is to do for @omz -
@wradcliffe, I found old forum post Python Objective-C Bridge. Pythonsita xcode project runtime can call native code module like usual CPython.
-
@jup310 - it's not all that old. Great reference.
There is another approach that is the one being used by Kivy called Cython. You can read about it here: http://cython.org The big difference between the traditional approach and the Cython approach is that the "types" passed between the C/C++ and the Python code are specially designed CTypes rather then Python types. The big advantage seems to be that you can easily convert a C/C++ API over to Cython by simply preprocessing the header files. The traditional approach is more hand crafted coding.
I have no idea what the history on all this is. It seems like Pythonista predates Cython (maybe just Cython for ios) so it was not an option for Ole at the time he was making his design decisions. I guess we could ask...
Hey Ole - if you were just starting on Pythonista today would you try and use Cython as the bridge solution?
-
@wradcliffe, Cython is very interesting. I'm checking that....
-
@jup310 - there are quite a few ways to try and generalize the way bridging to native code written in C/C++/assembly from "managed code". Since debuggers need to do this it makes sense that native code build tools can be used as part of the solution.
So what about the XCode development environment? I ran into this cool project that implements a debugger that you link right into you project. It exposes a server that can access the debugger from a webbrowser.
http://www.artandlogic.com/blog/2013/02/inspecting-ios-apps-with-ponydebugger/
This makes me wonder whether anyone has extended the Python introspection tools by allowing them to inspect native code. I think the answer is yes and someone may have already mentioned it in the forum at sometime. Could Ole do a build of Pythonista that included all the "debug" info needed to access any or all native code API's? The fact that PonyDebugger exists seems to suggest it is possible.
-
It seem this is the official OpenCV repository, of course with iOS support. https://github.com/itseez/opencv