Raspberry Pi and ImageJ

Hello,
I am working on a project which involves using ImageJ to analyse pictures taken on a Raspberry Pi. I have managed to get ImageJ working on the Pi. However, I want to be able to directly take pictures on the Pi (with a webcamera) through ImageJ. I know there is a plugin (Webcam Capture) which could let me do this (it works on a normal computer), but for some reason I am unable to put the files for Webcam Capture into the ImageJ folder in the Pi. I am getting a message saying that the permission was denied.

I am looking for anyone who can help with getting the plugin working on ImageJ, or perhaps finding an alternative way of using ImageJ to take pics on the Pi. Thanks in advance!

That plugin leans on webcam-capture project which does work on Linux including maybe Raspbian, but upon cursory investigation, there may be bugs?

That sounds like an OS issue, unrelated to ImageJ… did you check the ownership and permissions of the relevant folders? How did you install ImageJ? I would strongly suggest you use the platform-independent “no JRE” distribution of Fiji. Unpack it somewhere in your user space. Since there is no launcher for the Pi, you can use this shell script to launch.

Thank you for the quick reply.

I don’t think there are any bugs, as it works on my computer.

I downloaded ImageJ with sudo apt-get install ImageJ. And it is working fine on the Pi. I have tried deleting/editing files in the ImageJ folder on the Pi (/usr/share/imagej/) and the same error (permission denied) keeps occurs, so it must be related to ownership and permissions of the file, as opposed to ImageJ specifically, as you suggested. But I have no idea how to fix this?

I suggest not doing that. It is ImageJ 1.x only—not ImageJ2—and packaged by a third party, without cooperation from the core ImageJ development team. You will continue to have permissions errors because it is a system-wide ImageJ installation.

To avoid permissions issue, download and install Fiji as I explained above.

1 Like

Okay cheers I will try that. I just wanted to ask how would I run/use the shell script to launch Fiji? (I am rather inexperienced at the Pi).

Just save the file as ImageJ.sh and give permission to be executed (using the gui or by running chmod +x ImageJ.sh on the terminal).
Finally you can run the script on the terminal by using ./ImageJ.sh. Double clicking the file will only work, if your file manager allows the execution of files. I don’t know if this is active by default on Rasbian.

For executing scripts the first line is important. #!/bin/sh tells Rasbian to use the program /bin/sh to run the script. Otherwise sh ImageJ.sh would be necessary.

2 Likes

Hello! I know this is an old thread but this is the most relevant one I could find. We have been using the instructions mentioned on this page: Raspberry Pi - ImageJ

I am having trouble getting the ImageJ.sh file to execute. Here’s the first part of the error message:

Error while executing the main() method of class ‘net.imagej.Main’:
java.lang.IllegalArgumentException: Invalid service: sc.fiji.filamentdetector.gui.GUIStatusService

Can you tell me what I’m doing wrong? Thank you!