3

I am starting my final year project using image processing and was hoping to accomplish something like this. It's a combination of Human and Object detection.

I really wanted to do it in Java because I have very little experience in C++.

I found JavaCV which is a wrapper to OpenCV. However, it has very little support and virtually no documentation. So I was going to fall back and try to start using the native OpenCV when I stumbled across this JavaDoc on the OpenCV homepage for Java OpenCV.

My question is, how do I install / use this Java version of OpenCV? Has anybody had experience doing this? Does anybody have a better suggestion as to how I should approach this project?

Any advice would be appreciated as this has been hanging over me for a while now.

TomSelleck
  • 6,706
  • 22
  • 82
  • 151
  • You can learn about open cv from some books which you can get from http://www.filtrlink.com and search for opencv in the search box –  Sep 05 '16 at 15:59

4 Answers4

3

Just now i installed opencv-2.4.4 with java support it comes out to be easy however for documentation opencv c++ documentations can be used. Similiar documentation can be used for javacv as well.

http://docs.opencv.org/2.4.4-beta/doc/tutorials/introduction/desktop_java/java_dev_intro.html

follow the steps given on the page it works fine. Although it supports only for desktop Java if you want for other platform supports use javacv.

aalbatross
  • 117
  • 7
2

You can find instructions to install and use Javacv in link below. http://opencvlover.blogspot.in/2012/04/javacv-setup-with-eclipse-on-windows-7.html

You will be able to use java to use all the algorithms available in opencv using javacv.

nikhil
  • 408
  • 4
  • 11
  • I have JavaCV installed and sample working but there is no clear way to directly port the c/++ methods over to Java. I tried following the OpenCV tutorials but the methods and types do not match up. – TomSelleck Nov 08 '12 at 20:50
  • I would suggest you to spend some time to go through source code of Javacv and understand the structure. Have a look at desired c function in javacv source code, it will give you a feel about how to use it in java. Javacv functions resemble more to c functions than c++ functions. – nikhil Nov 08 '12 at 20:59
0

Do you have a precise reason for using Java?

If your main aim is to create a prototype, I'd advise to go for PyOpenCV which is more broadly supported and easier to handle . If your programming skills are limited (for now), I would advise for Python instead of Java. OpenCV supports both. The main reason for choosing Python is that you can do the same in 3 lines of code where 20 lines or so would be needed in Java. The Python bindings for OpenCV are actually easier to get started with, as they are included into the main source.

Here is the doc

And if you are on linux and don't need the very laster version you can start working in less than 5 minutes as there are packages ready for you. :) Simply run

sudo apt-get install libopencv-*
sudo apt-get install python-opencv
sudo apt-get install python-numpy

If you want the last version, there is a bit more work, but also a nice guide

jlengrand
  • 12,152
  • 14
  • 57
  • 87
  • The answer is not out of scope because the main reason seem that he doesn't want to use C nor C++. Better give him the info than nothing. . . I love downvotes without motivation – jlengrand Nov 08 '12 at 13:22
  • BTW, here is another answer saying exactly the same as me . . . So I am not alone ! http://stackoverflow.com/questions/11494546/learning-javacv-in-pure-java – jlengrand Nov 08 '12 at 13:24
  • Thanks for the reply.. The reason I wanted to avoid C++ is because I am really comfortable working with Java (I just finished a 6 month internship using Java). A working prototype is something I will need to have completed. Aside from that, I would like to enjoy working on it and learning C++ seems a bit intimidating.. – TomSelleck Nov 08 '12 at 14:48
  • My message is about python :). If you know about Java, you 'll be up and running in Python in less than an hour. No kidding. You'll get more and more skilled with time I don't really think C++ is the best way to design a prototype :) – jlengrand Nov 08 '12 at 15:23
  • I think people are actually struggling with your claim that python is more verbose than Java. I got lost at that point. – Lawrence Jones Oct 23 '14 at 16:11
  • Yes, you re totally right. Two year later, I realize that my answer doesn´t make sense. I'll correct it thanks! I could remove it, but since java doesn't seem to be a requirement in this answer I still think newcomers should go for Python for an easier start. – jlengrand Oct 24 '14 at 05:07
  • 2
    I've been using Python for about 8 months now in work, I can honestly say that I should have taken your advice @jlengrand . – TomSelleck Nov 13 '14 at 17:47
  • 1
    My god, after all those -1, I knew I was right not to remove my answer! Thanks for coming back, you have no idea how glad I am :) – jlengrand Nov 13 '14 at 22:17
0

dear community! Below describe process of installation OpenCV in Linux and eclipse configuration.

CentOS Linux release 7.3.1611

$ yum install opencv-core.x86_64 opencv-devel.x86_64

After install look in /opt/OpenCV/java

$ ls -l /usr/share/OpenCV/java/
итого 1040
-rwxr-xr-x 1 user user 739248 фев  5  2017 libopencv_java310.so*
-rw-r--r-- 1 user user 322277 фев  5  2017 opencv-310.jar

In Eclepse you should create "User library" and

  • Add JAR-file to this library Modify "Native library location" and set path to driver (*.so)

enter image description here

If you need build library from sources - visit http://www.giuseppeurso.eu/en/how-to-compile-opencv-on-centos-with-java-support/ or another sites.

Mikro Koder
  • 1,056
  • 10
  • 13