Monday 4 January 2021

Detecting objects in Images - with R, yolo and ImageMagick

I wanted to identify moving objects in video (or still) images - preferably using R as that's my tool of choice. I thought this might be challenging, but it proved to be relatively easy. 

The basic steps are:

  1. Import the images from the video, discard the 'empty' ones and save the interesting ones. [R, with ImageMagick]
  2. Run the interesting images through a neural net to locate and identify objects. Save the locations for some later stage of the project. [R, yolo]
  3. Stitch the results back together. [R, ImageMagick]
There's an example here, applied to video from a 'camera trap' in the garden.



The rest of the blog gives the full details on how this is done.