Best way to use OpenCV and Nu together for iOS vs OSX?

84 views
Skip to first unread message

Tom Warfel

unread,
Jan 19, 2014, 12:39:04 AM1/19/14
to program...@googlegroups.com
I'm in the early stages of writing several image processing applications, some of which will run on an iPhone, and some of which will run on a Mac.

I've experimented with SBCL(Steel Bank Common Lisp) and OpenCV (using either the cl-opencv or common-cv cffi wrappers for OpenCV) on a Mac, but am looking at having to re-implement the algorithms in Objective-C for the iOS devices.

Given that there is an OpenCV framework for iOS, is there a general process for creating some kind of binding between Nu and OpenCV that could work similarly both in an iOS app as well as a Mac OSX app?  (Something like common-cv / cl-opencv do for SBCL?) 

It would be nice have to the power of a lisp-ish scripting language for the  image processing backed by the compelled OpenCV libraries that would run more-or-less the same on both iOS and OSX devices.  Being new to Nu, I'm not sure how reasonable this proposition would be.

Suggestions welcome, thanks in advance.
 -Tom

Tim Burks

unread,
Jan 19, 2014, 11:50:21 AM1/19/14
to program...@googlegroups.com
Hi Tom,

I think you'll find Nu is much easier to integrate on iOS and lighter weight than any other Lisp, but without any lisp-level code optimization, it's basically a scripting layer on Objective-C. 

I think the best way to integrate OpenCV with Nu is to wrap the functions that you want to call with Objective-C class or instance methods. There's also been libffi support in Nu since the beginning, but recently I've been experimenting with a version that removes the libffi dependency by compromising some runtime flexibility. The result is a two-file Lisp that can be dropped into any Objective-C program. It's running inside an app that we wrote for a conference coming later this month: https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=588226808&mt=8

I haven't looked at the OpenCV APIs but generally have found it easier to wrap C functions with Objective-C code than to use any other kind of glue-code-generating mechanism.

Tim




--
You received this message because you are subscribed to the Google Groups "Programming Nu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to programming-n...@googlegroups.com.
To post to this group, send email to program...@googlegroups.com.
Visit this group at http://groups.google.com/group/programming-nu.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages