Learn R Programming

camtrapR (version 0.97.1)

checkSpeciesFolders: Consistency check on species image identification

Description

This function assesses possible misidentification of species or mistakes in moving images to species directories. Within each station, it assesses whether there are images of a species taken within a given time interval in other species directories. Often, it is unlikely that different species are encountered within a very short time intervals at the same location. This type of misidentification can arise easily if some images belonging to a sequence of images were moved into different species directories.

Usage

checkSpeciesFolders(inDir, 
  maxDeltaTime, 
  exclude,
  writecsv = FALSE
)

Arguments

inDir
chraracter. Directory containing station subdirectories, which in turn contain renamed and identified images in species subdirectories (e.g. inDir/StationA/Species1)
maxDeltaTime
numeric. Maximum time interval between images to be returned (in seconds)
exclude
character. vector of species directories to exclude from check
writecsv
logial. Should the resulting data.frame be saved as a .csv?

Value

  • A data.frame listing all images with their file names, directory and time stamp that were taken within a certain time of another species image at a particular station.

Details

Images may accidentally be moved into wrong directories when identifying species by moving images into directories. Imagine your camera takes 3 shots every time it is triggered, and you move those three images into different species directories. The time difference will be very small (e.g. a few seconds). This function will return all these images for you to check if they were identified correctly. Directories like "blank" or "team" can be ignored using exclude.

Examples

Run this code
wd_images_ID <- system.file("pictures/sample_images", package = "camtrapR")

maxTimeDiff <- 120   # = 2 minutes

 if (Sys.which("exiftool") != ""){        # only run this example if Exiftool is available
check.folders <- checkSpeciesFolders(inDir = wd_images_ID,
  maxDeltaTime = maxTimeDiff,
  writecsv = FALSE)
                                     
check.folders   
# In this example, these are really 2 different species photographed within 2 minutes. 
}

Run the code above in your browser using DataLab