t-oster / VisiCam

A Java application, that turns a webcam into a VisiCut compatible network camera with marker detection and perspective correction. Uses OpenCV through JavaCV
Other
36 stars 12 forks source link

Bash scripts, javacv-pi binaries #14

Closed FroChr123 closed 9 years ago

FroChr123 commented 9 years ago

In this pull request some bash scripts are added or modified for easier handling of VisiCam.

Start / Stop: Obvious Compile: Now includes asking for javacv folder to copy binaries from Service: Bash script copies template file for service to /etc/init.d and replaces folder paths accordingly

With these bash scripts it is also easier to be independant of the actual location of the VisiCam main folder, which is good for the installation instructions.

The javacv-pi binaries are removed because they do not seem to work correctly anymore. They create runtime errors, which complain about a missing library regarding JNI or something like that.

I also updated the outdated parts of the installation wiki page. Most notably, the compilation time of OpenCV could be successfully reduced to ~ 1 hour (instead of 4 hours) by using multiple jobs in the make task.

As soon as this pull request is accepted, I will update the installation routine wiki page again.

FroChr123 commented 9 years ago

Close pull request for now, to be combined with existing init-scripts.

t-oster commented 9 years ago

So you'll create another pull request? How about replacing the javacv-pi binaries with working ones instead of removing?

FroChr123 commented 9 years ago

Yep, there will be another pull request, which modifies the existing init-scripts a bit.

I can replace the binaries, but I am not sure if they will work at all in such a "portable" style. It seemed to me that the runtime error was rather related to some non-existing shared library.

It could be created during the correct installation procedure of javacv / javacpp. Or these new compiled libraries do not need that library anymore. I will try to have a closer look at this.

FroChr123 commented 9 years ago

According to the involved file names in the errors it seems to be related to both, the javaCV binaries AND the installed openCV version. So maybe this is a version mismatch.

Exception in thread "Thread-5" Exception in thread "Thread-7" java.lang.NoClassDefFoundError: Could not initialize class com.googlecode.javacv.cpp.opencv_highgui
java.lang.UnsatisfiedLinkError: /tmp/javacpp2735809660609/libjniopencv_core.so: /tmp/javacpp2735809660609/libjniopencv_core.so: cannot open shared object file: No such file or directory

Manually compiling javaCV / javaCPP probably ensured that everything matches correctly. Until yesterday the installation routine in the wiki pages did not mention any fixed versions for javaCV / javaCPP and it pointed to version 3.0 of openCV (which would probably not work at all => version change from 2.4 to 3.0).

I changed the installation routine in such a way that it refers to versions, which are still now available and close to those versions, which were used when VisiCam was developed.

So we end up with javaCV / javaCPP in version 0.7 and openCV in version 2.4.9.

It is probably the best idea to recommend installing javaCV / javaCPP yourself and to provide the new precompiled binaries for this version combination just as a fallback. So I will replace them with a pull request later I think.