26

I am trying to learn JavaCV. As you all know, the lack of educational materials on this subject is a very big problem. In JavCV home page, they have provided lot of examples for the C++ examples in book "OpenCV CookBook". But the case is, they are not Java, they are in SCALA!!!! Now I have already gone crazy! I know lot of examples are in web, but I want to learn it from beginning to advance, then only I can do it properly. "OpenCV CookBook" is a very good book but it is all about OpenCV in C++, not anything about Java.

Someone please help me to find a better place to learn JavaCV. Provide me whatever, URL, Book, etc. But it must be about learning JavaCV in 100% Java, not in Scala, C++, C or whatever other language! Please help!

PeakGen
  • 21,894
  • 86
  • 261
  • 463
  • 12
    This is the case when I first started to learn OpenCV in Python. There was no tutorial in Python, all were in C++. But i had to learn it somehow and started to read C++ book and converting it to python myself. And it took a lot of time. Finally I came up with my own tutorial : opencvpython.blogspot.com, which is focussed on beginners. So this is what i have to tell you. Learn it yourself from the very basic examples, and once ready with that code, write your own tutorials for future learners. Somehow one person has to take an initiative. Let it be you !!! – Abid Rahman K Jul 15 '12 at 18:48

1 Answers1

21

< update >

Times change - and so does OpenCV. Right now, a pure Java wrapper (not Android) is growing fast, allowing anyone to use OpenCV functions directly in desktop Java apps/

< /update >

You can find some tutorials in Java in the OpenCV samples directory: samples/android.

You can also find some more info here.

Now, I am pretty sure you will say you want Java, but not Android :). But this requires an explanation.

For various reasons - the main one being efficiency and the second one portability to embedded platforms, computer vision is done almost entirely in C/C++. It is the de facto standard. Everybody uses it, with good reasons, and good results.

There are different adapters to the C++ code base, like Python and Java, but they exist to fill some specific gaps: Python is used for fast prototyping, and Java for interfacing the Android main language. But in all scenarios, the 'real' algorithm development is done with C/C++. This is why nobody cares about tutorials/books/examples in other languages.

Conclusion: If you want to learn image processing, learn C++ or Python. If you want to build some app, learn the OpenCV java interface from docs/android tutorials. But do not expect flexibility or control over performance.

Updated note

There are two more things to specify here.

First, as Android gets on its wheels, and Python proves more and more popular, the content available in the two languages (and others) are increasing dramatically. But for the years to come, the core development group - and the best docs - will be in the C++ area.

Last, but not least, you should keep in mind that in any work or programming area, if you stick to one language, you're dead. Principles matter, and you should be able to implement them in a variety of languages, and you should be able to read and understand from a variety of sources. What about a programmer that says he is not able to translate pseudo-code into Java? It's quite the same with other languages.

You can read the great blog post Don't call yourself a programmer to understand why you should forget about programming in one language.

Sam
  • 19,708
  • 4
  • 59
  • 82
  • Thanks for the reply, I really appreciate it :) Anyway, at least, is there a way to convert scala to java without learning scala? I mean, online tool or something? – PeakGen Jul 15 '12 at 20:07
  • @Yohan :) please read my updated post. I hope you get the idea. You may find some online tools, or (most probably) not, but you should understand you can do it. – Sam Jul 16 '12 at 06:32
  • I didn't tell I know only one language. I know C#.Net and VB.Net, JavaFX, some C++ and of course some android. But that doesn't mean one person has to learn all the languages available in the world just because he has to use a single API. Instead of that, finding another way to do it, in this case Xuggler API, is the best thing. – PeakGen Jul 16 '12 at 13:29
  • Ok, if all you want to do is to open/apply effects/save media files using OpenCV would be a mistake in any language :). Good you found that API. OpenCV has a different target. Sorry for the wrong assumption. Most people ask about OpenCV wanting to learn computer vision (face detection, dancing robots, etc). In this case, it is good to stay with the ol' good C++. – Sam Jul 16 '12 at 13:36
  • Anyway, it seems like Scala people also has thought about Scala to Java converter http://www.scala-lang.org/node/5240 – PeakGen Jul 16 '12 at 13:43
  • I really want to learn those you mentioned. That's why I selected JavaCV – PeakGen Jul 16 '12 at 16:26
  • OK, I started learning from the available resources. Please be kind enough to give me a hand on this http://stackoverflow.com/questions/11511405/javacv-recording-video-from-web-cam – PeakGen Jul 16 '12 at 20:02
  • Heh, did'n you figure out that I hate Java? No, I won't help you :P – Sam Jul 16 '12 at 20:13
  • 1
    You know what, Scala wasn't hard anyway! I am not learning it, but understanding it is not an issue!! – PeakGen Jul 18 '12 at 05:05
  • See? Now you can also turn to C++ ;) – Sam Jul 18 '12 at 07:54
  • 2
    yes, C++ is better. I learnt it – PeakGen Dec 17 '12 at 16:11
  • It seems Packt will realease a book on the subject https://www.packtpub.com/application-development/opencv-java-javacv# – dannyxyz22 Jan 22 '15 at 00:23