NiñoScript
NiñoScript

Reputation: 4593

Deciding on a language/framework for a modular OpenCV application

What's this about?

We have a C++ application dealing with image processing and computer vision on videos using OpenCV, we're going to rewrite it from scratch and need some help deciding what technologies to use. More specifically, I need help on how to choose the technology I'd use.

About the app

The app's functionality is divided in modules that are called in an order defined by a configuration XML file and can also be changed in runtime, but not in realtime (i.e. the application doesn't need to close, but the processing will start from scratch). These modules share data in a central datapool.

Why are we starting from scratch?

This application wasn't planned to be as dynamic as it currently strives to be, so it's grown to be a collection of buggy patches, macros and workarounds; it's now full of memory leaks, unnecessary QT dependencies, slow conversions between QT and OpenCV image formats and compilation and testing times have grown too much.


Language choice

The original code used C++, just because the guy who originally started the project only knew C++. This may be a good choice, because we need it to be as fast as possible, but there may be better choices to account for the dynamic nature of the application.

We're limited by the languages supported by OpenCV (C++, Java and Python mainly; although I've read there is also support for Ruby, Ch, C# and any JVM language)

What is needed

What would be ideal


What am I missing?

I have too many interesting options!

Here's where I need help, based on your experiences in modular app development, with this constraints, what kind of language/framework feature should I be looking for?

What question should I make myself about this project that would let me narrow my search?


Edit

I hadn't noticed that OpenCV had GPU bindings only for C++, so I'm stuck with it.

Now that the language is fixed, the search has narrowed a lot. I could use Objective-C++ to get the dynamism needed (Obj-C runtime + NSBundle from Cocoa/GnuStep/Cocotron), which sounds complicated; or C++ with a framework.

So I'll now narrow my question to:

Meta: I did my research on how to ask a question like this, I hope it's acceptable.

Upvotes: 0

Views: 356

Answers (2)

azwald
azwald

Reputation: 31

If you're looking for portability and have large memory for disposal then you can go with Java. The performance hit between C++ and Java is not that bad. For conversion between Mat and other image format I'm still not sure, coz it needs deep copy to perform that, so if your code can display the image in openCV native format then you can fasten the application

pro :

  • You can stop worrying about memory leak
  • The project is much more portable compared to C/C++(this can be wrong if you can avoid using primitive datatypes which size is non consistent and for example always use int*_t in C)

cons:

  • slower than C/C++
  • more memory and CPU clock needed

http://www.ibm.com/developerworks/java/library/j-jtp09275/index.html

Upvotes: 1

berak
berak

Reputation: 39796

"What question should I make myself about this project that would let me narrow my search?"

if you need gpu support(cuda/ocl), your only choice is c++.

you can safely discard C, as it won't be supported in the near future

have no fear of python, even if you need direct pixel access, that's all numpy arrays (running c-code again)

i'd be a bit sceptical of ruby, c# ch and the like, since those bindings are community based, and might not be up to date / maintained properly, while the java & python bindings are machine - generated from the c++ api, and are part of the official distribution.

Upvotes: 1

Related Questions