Difference between revisions of "Raspberry PI"

From BoofCV
Jump to navigationJump to search
m
m
Line 8: Line 8:
# Add it to your path
# Add it to your path


# Building BoofCV
You can build BoofCV the usual way, just make sure you use Java 11 or newer to do so and install the ARM optimized JDK! On a regular desktop it takes about 1 minute to build, but on a Raspberry PI it can take 10 minutes or so.
To build and install into your local Maven repository:
cd boofcv
./gradlew install
If you are running your Raspberry PI as a Desktop you can run the demonstration apps. Might also want to plug a camera in or setup your Raspberry PI camera as discussed below.
<nowiki>
cd boofcv
./gradlew demonstrations
java -jar demonstrations/demonstrations.jar
</nowiki>
Trouble Shooting:
If the `./gradlew` command fails and complains about Java 11 that means you didn't download Java 11 yet or your path is incorrect. One way to get around that is to force Gradle to use a specific JDK.
<nowiki>
/gradlew -Dorg.gradle.java.home=/path/to/jdk-11/ demonstrations
</nowiki>


# How do I use the Raspberry PI Camera?
# How do I use the Raspberry PI Camera?
Line 27: Line 50:
</nowiki>
</nowiki>


/dev/video1 is the device associated with the Raspberry PI camera. If you have your Raspberry PI running as a Desktop and BoofCV's source code checked out you can do the following to see if it worked:
/dev/video1 is the device associated with the Raspberry PI camera. Then follow the directions above for building/running the demonstration code. A good app to test is KLT.
 
<nowiki>
cd boofcv
./gradlew demonstrations
java -jar demonstrations/demonstrations.jar
</nowiki>


Then select ASDASDASD
Then select ASDASDASD
Trouble Shooting:
If the `./gradlew` command fails and complains about Java 11 that means you didn't download Java 11 yet or your path is incorrect. One way to get around that is to force Gradle to use a specific JDK.
<nowiki>
/gradlew -Dorg.gradle.java.home=/path/to/jdk-11/ demonstrations
</nowiki>

Revision as of 12:43, 26 April 2020

  1. Replacing Default Java

The default Java installation on Raspberry PI is not optimized for running on ARM and runs much, much slower than it should. You will need to download another version and use that.

  1. Download JDK built for Raspberry PI
  2. Decompress `tar -xzf jdk.tar.gz`
  3. Move to a location you like `sudo mv jdk-11 /opt`
  4. Add it to your path
  1. Building BoofCV

You can build BoofCV the usual way, just make sure you use Java 11 or newer to do so and install the ARM optimized JDK! On a regular desktop it takes about 1 minute to build, but on a Raspberry PI it can take 10 minutes or so.

To build and install into your local Maven repository:

cd boofcv ./gradlew install

If you are running your Raspberry PI as a Desktop you can run the demonstration apps. Might also want to plug a camera in or setup your Raspberry PI camera as discussed below.

cd boofcv ./gradlew demonstrations java -jar demonstrations/demonstrations.jar

Trouble Shooting:

If the `./gradlew` command fails and complains about Java 11 that means you didn't download Java 11 yet or your path is incorrect. One way to get around that is to force Gradle to use a specific JDK. /gradlew -Dorg.gradle.java.home=/path/to/jdk-11/ demonstrations

  1. How do I use the Raspberry PI Camera?

The easiest way to access the camera is to treat it as a UVC device. This way WebcamCapture will recognize it and all the example code will work. Unfortunately, you have to tell your Raspberry PI to load the UVC driver each time you boot by doing the following (Stack Exchange):

sudo modprobe bcm2835-v4l2

It should now show up in the list of cameras if you type v4l2-ctl --list-devices. This is what I see on my system. I also have a webcam plugged in to USB that's why there are two devices:

mmal service 16.1 (platform:bcm2835-v4l2): /dev/video1 Logitech Webcam C930e (usb-3f980000.usb-1.1.3.1): /dev/video0

/dev/video1 is the device associated with the Raspberry PI camera. Then follow the directions above for building/running the demonstration code. A good app to test is KLT.

Then select ASDASDASD