Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Overview

Data Image collection is done on any computer running Linux on the drone. Data Image collection accesses sensors the camera in the same manner as the airside system.

Repository:

...

https://github.com/UWARG/model-training

Software

Usage

Collection:

image-collection

Software

Setup - USB Camera

Follow the instructions to clone the repository and activate the environment: Autonomy Workflow Software

Install packages:

Code Block
pip install -r requirements.txt

Usage - USB Camera

Note

Prerequisites:

Update the repository by running:

Code Block
git checkout main
git pull
git submodule update --remote --merge

Copy the contents of rc.local.copyme to /etc/rc.local .

  • Modifying /etc/rc.local requires superuser access (e.g. sudo )

Collecting images:

  1. Connect the camera to the computer

  2. Power on the computer:

    1. If sensors are camera is not connected, data image collection fails to start and . Power off the computer needs to be restartedData and go to step 1

    2. Image collection is automatically run on startup through the /etc/rc.local file

...

  1. Collect images by pointing the camera towards the object(s) of interest

  2. Power off the computer

Accessing images:

  1. Disconnect all sensors and power

  2. Power on the computer

  3. Move or copy the data images to be saved

  4. Delete the data images to free space for future collection

Setup

...

Code

Open the terminal and navigate to the home directory:

  • cd ~/

Follow the instructions: Python Repository

Install packages: pip install imaging/requirements.txt

  • Do not use the other requirements files

Startup

The contents of imaging/rc.local.copyme assume the username is warg .

OpenCV Python:

...

- Raspberry Pi Camera Module 3

clone the repository or update it as normal (same as USB Camera)

Note

DO NOT activate a virtual environment: you actually want to deactivate it before you run this script.

The picamera2 library is pre-installed on PiOS, and it is not encouraged to install it using pip: https://datasheets.raspberrypi.com/camera/picamera2-manual.pdf. Hence, we will use the pre-installed library instead.

Those libraries cannot be easily installed using pip and require additional steps, so we just use the provided library in global space. There are some missing dependencies when installing through pip, which causes build fail.

Usage - Raspberry Pi Camera Module 3

Option A: Run the script manually

Code Block
python picam.py

Option B: Run the script from startup using /etc/rc.local.

Add the following line to /etc/rc.local

...

FFmpeg video:

...

Install FFmpeg: sudo apt-get install ffmpeg

...

(starts the image capturing in the background):

  • Make sure you don’t activate any virtual environments beforehand!

Code Block
cd /home/warg/image-collection
python picam.py &