How to use Java OpenCV

时间秒杀一切 提交于 2019-12-10 18:35:44

问题


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.


回答1:


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.




回答2:


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.




回答3:


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




回答4:


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)

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.



来源:https://stackoverflow.com/questions/13288646/how-to-use-java-opencv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!