Closed peteruithoven closed 10 years ago
After building (ant jar) I also moved the .jar's from javacv-pi to dist/lib, but this also doesn't seem to help. Precise commands:
sudo cp lib/javacv-pi/javacv.jar dist/lib/
sudo cp lib/javacv-pi/javacv-linux-arm.jar dist/lib/
What I don't understand is that OpenCVFrameGrabber.start is called... And because of the error it can't save the settings, so it will never try the Custom CaptureCommand.
Could not save settings to /home/pi/VisiCam/visicam.conf
Settings will be reset after restart
I'm going to try the webcam capture branch
It might be a permissions thing, I'm noticing I always have to use sudo, even for a "git pull" for example.
Alright, I think the error was caused by the master branch it's openCV image capture. It didn't get to using my customcommand because openCV capture was probably the default. Next to that I had a access issue, so after changing the owner and group to pi I could finally save settings. Now it's actually taking pictures, but it can't find them afterwards... I used:
CaptureCommand: raspistill -o image.jpg
CaptureResult: image.jpg
and
CaptureCommand: raspistill -o ~/image.jpg
CaptureResult: ~/image.jpg
and
CaptureCommand: raspistill -o ~/VisiCam/image.jpg
CaptureResult: ~/VisiCam/image.jpg
Can't really explain it, but now it can...
#VisiCam Configuration
#Fri Nov 08 00:40:02 UTC 2013
markerSearchfields[3][y]=0.8
markerSearchfields[2][x]=0
markerSearchfields[1][height]=0.2
markerSearchfields[2][width]=0.2
captureCommand=raspistill -o visicam-capture.jpg
markerSearchfields[1][width]=0.2
markerSearchfields[0][y]=0
markerSearchfields[2][y]=0.8
markerSearchfields[1][x]=0.8
markerSearchfields[2][height]=0.2
inputHeight=1050
markerSearchfields[3][width]=0.2
markerSearchfields[0][height]=0.2
markerSearchfields[0][width]=0.2
cameraIndex=0
markerSearchfields[3][x]=0.8
outputHeight=1050
captureResult=visicam-capture.jpg
markerSearchfields[1][y]=0
markerSearchfields[0][x]=0
inputWidth=1680
markerSearchfields[3][height]=0.2
outputWidth=1680
Conclusion: When you want to use a custom capture command you can ignore the error. When you save your custom command settings the error should disappear.
I'm now getting the same error when it's looking for the markers:
Taking Snapshot...
Finding markers...
Exception in thread "Thread-33" java.lang.UnsatisfiedLinkError: /tmp/javacpp395248136172/libjniopencv_core.so: /tmp/javacpp395248136172/libjniopencv_core.so: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1953)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1878)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1839)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1061)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:422)
at com.googlecode.javacpp.Loader.load(Loader.java:372)
at com.googlecode.javacpp.Loader.load(Loader.java:319)
at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:131)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at com.googlecode.javacpp.Loader.load(Loader.java:338)
at com.googlecode.javacpp.Loader.load(Loader.java:319)
at com.googlecode.javacv.cpp.opencv_core$CvArr.<clinit>(opencv_core.java:158)
at com.t_oster.visicam.CameraController.findMarker(CameraController.java:103)
at com.t_oster.visicam.VisiCamServer.serveTransformedImage(VisiCamServer.java:175)
at com.t_oster.visicam.VisiCamServer.serve(VisiCamServer.java:141)
at gr.ktogias.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:443)
at java.lang.Thread.run(Thread.java:724)
So I guess copying the Raspberry Pi specific javacv.jar and javacv-linux-arm.jar wasn't enough. I'll look into installing opencv some more.
I followed the following tutorial to install opencv and I can compile and run the sample application. http://thinkrpi.wordpress.com/2013/04/05/step-3-install-softwares-for-webcam-and-computer-vision/
If I understand the following, javacpp.jar contains paths to opencv. https://code.google.com/p/javacv/source/browse/src/main/java/com/googlecode/javacv/cpp/opencv_core.java#131 No clue how to figure out what the opencv path is of the javacpp.jar I'm using.
I also understand people have bin using javacv on Arch Linux (like mentioned in the readme) and they've compiled it themselves. I also read that you shouldn't use the debian repository installation when you want to compile it yourself, because it's very hard to remove the links it sets.
I tried following the following tutorial to compile opencv, but no luck, also it... takes... ages... http://salaboy.com/2013/06/14/using-javacv-in-the-raspberry-pi-linux-arm/ So I've installed Arch linux and I'm trying my luck with that.
I'm now pretty sure it failed because it ran out of space. (of course it didn't display this, it gave some vague compiler error. I used a 4GB memory, with the standard Raspbian. So now I'm trying with a 8GB card.
This helped, opencv finally compiled.
YES! Working on the Raspberry Pi, running Raspbian.
After compiling and installing opencv I could compile javacp (this didn't work and didn't give useful feedback on Arch Linux), I then copied the created files to VisiCam using the following commands. cp ~/javacv/target/javacv-linux-arm.jar ~/VisiCam/dist/lib/ cp ~/javacv/target/javacv.jar ~/VisiCam/dist/lib/ cp ~/javacv/target/javacpp.jar ~/VisiCam/dist/lib/
After trying the following installation method
And press save I have the following in the terminal:
I'm probably missing something around opencv... I'll also be looking into this myself some more.