Ask Your Question

opencv for desktop java

asked 2012-08-03 13:07:57 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

Are there any plans to provide a wrapper for desktop Java? Java classes for Android, header files and native implementations are already there, so I guess it will be fairly easy to bind to desktop Java.

It would be really great to be able to run same code on both Android and desktop Java (Except for GUI and some other minor parts for sure)

Android is great but developing this kind of applications on desktop Java is much easier. For example you can open several windows at the same time.

I'm aware of JavaCV but it doesn't help this purpose:

  • It lacks C++ bindings (No Mat class for instance)
  • It has a totally different package structure than OpenCV4Android

r a f t

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2012-09-12 11:51:59 -0500

emchristiansen gravatar image

I'm working on this. See this question.

edit flag offensive delete link more

answered 2012-08-03 15:40:22 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

OpenCV4Android team at Itseez (primary authors of the Java port) are not going to work on this in the near future. But some people at Willow are ready to work on this, so we will probably see the Java API enabled on desktop.

To make it happen please vote for this question and participate in the discussion here.

Edit: Samuel says that he doesn't agree with the OpenCV team, but we have never discussed the design. So, currently we're going to support desktop in the same way as it is done for Android. But we will try to understand if his approach has some advantages. If so, we'll try to reuse some of his ideas. But again, this is very low priority for us at the moment, since Android is our major target platform.

edit flag offensive delete link more


I can't vote on my own question. I agree with Samuel on some points. Android port should be split into parts and developers should be able to embed only the necessary parts into their applications. I've found that OpenCV manager idea frustrating for a regular Android user.

raft gravatar imageraft ( 2012-08-03 17:28:26 -0500 )edit

Please don't mix things. OpenCV Manager is aimed to help you make your applications cross-platform and fast. You simply will not be able to achieve the same level of performance and power efficiency without it. Yes it takes 2 downloads (manager + package) before the first OpenCV application is run, but we hope to see the OpenCV Manager on every consumer device someday. It is even possible that it will be preinstalled by vendors. If you have any suggestions on how to make OpenCV Manager better, please let us know at OpenCV4Android google group.

And finally Java is not the best approach to build CV apps. You should prefer C++ for professional development. It allows you to develop/debug on desktop, and you can later reuse your code for other mobile platforms.

Kirill Kornyakov gravatar imageKirill Kornyakov ( 2012-08-04 01:23:19 -0500 )edit

Please explain me, because I don't see how OpenCV manager makes applications fast and cross platform. The alternative is embedding OpenCV natives into the app, that way the app still uses same OpenCV libraries and hence performs the same. I agree size matters here, embedding almost 20M to each app is not acceptable, here comes splitting into the scene. Of course there are other issues, like updating all the apps vs updatind a single manager, but again for a regular user updating his app instead of updating a 'god knows what' manager makes more sense. Just my two cents.. Seeing OpenCV manager pre-installed by vendors should be great of course. But it won't happen tomorrow, right? Even then there will be non-confirming vendors, and we end up in the same place and should handle that too.

raft gravatar imageraft ( 2012-08-04 15:56:24 -0500 )edit

Today there are devices on armv5, armv7, armv7+NEON, x86, MIPS is coming, and more to come. If you're going to support all of them, 20M is probably not enough. OpenCV Manager gives you prebuilt OpenCV binary best suitable for your hardware. It will use NEON and SSE where available (3x on average), it will use some advanced optimizations on Tegra 3 platform (coming soon). Of course you can support all this zoo by yourself, but you can delegate it to the Manager. I really think that there is no way for us without it, so we should better discuss how can we make it better.

Kirill Kornyakov gravatar imageKirill Kornyakov ( 2012-08-05 01:23:37 -0500 )edit

Question Tools


Asked: 2012-08-03 13:07:57 -0500

Seen: 928 times

Last updated: Dec 14 '12