2  Image Processing With Python Scripts

2.1 Introduction

We use several different python scripts in order to process our game camera images. In this chapter, we will take a top-level view of all of the scripts and their capabilities. Later chapters will go over how to use each script

2.2 Scripts

Our current list of scripts in this repository (North-Country-Wild/PythonScripts) are the following:

Table 2.1: Current list of python scripts

You can see that some of the scripts in the repository are used for working with some of our acoustic data (Audiomoth data) and others are related to a relational database we are building. In this and the next several chapters, we will only cover here those that relate to our game camera image processing.

The historical process by which we created these scripts reflects different stages of the development of this repository.

  • First, we wrote scripts to process all new, incoming game camera images to improve our workflow.

  • Next, we wrote scripts to allow backup of images to AWS S3.

  • Our most recent development has been to write scripts that let us go back to already existing folders and images that were created on our hard drive early in our process, before we had certain conventions in place, to allow us to rename and back up those older images.

Modify for your use!

We are providing access to this repository in case others find our work helpful for their own workflows. Feel free to review, copy, and modify these scripts for your own use. With the advent of powerful AI tools, even someone without much background in python may be able to take these scripts and modify them to fit your own data organization structure.

2.3 Choosing the correct script

2.3.1 Working with new game camera images

Assuming that we deploy a game camera now that we have all of our processes in place, and we bring a SD card back to the lab ready to process, we can completely process all of those images, copy them to S3, and resize them, etc.

  • The script upload_and_process_images.py is the main script for processing newly collected images.

  • Further explanation on how to use this script will be provided in Chapter 3.

2.3.2 Working with older, existing game camera images

In our lab, because we started working with game camera images before we shaped all of these steps to our workflow, we have old folders that need to be processed.

For example, until recently, we did not rename images when the were copied from the SD card to the appropriate folder in the “Raw” directory. As a result, within a folder for any particular deployment, all of the Raw images were named IMG_001.JPG, IMG_002.JPG, etc. As a result, they could be easily confused between camera deployments (since every camera begins numbering on every deployment with IMG_001.JPG…).

  • The script called rename_raw_files_and_upload_to_s3.py enables us to go back to old folders in the “Raw” directories and rename those files.
  • Further information on how to use this script will be covered in Chapter 4.
  • Information on how to check which deployments have been uploaded to s3 is covered in Chapter 5.

Likewise, our process for pushing copies of our Raw files to AWS S3 is fairly recent. Thus, if we want to go back and move older files to AWS S3, we can do so.

  • The script called upload_existing_files_to_s3.py allows us to go back and move images that have not yet been copied up to AWS S3.
  • Further information on how to use this script will be covered in Chapter 6.