Package 'ZooID'

Title: Load, Segment and Classify Zooplankton Images
Description: This tool provides functions to load, segment and classify zooplankton images. The image processing algorithms and the machine learning classifiers in this package are (will be, since these have not been added yet) direct ports of an early 'python' implementation that can be found at <https://github.com/arickGrootveld/ZooID>. The model weights and datasets (also not added yet) that are a part of this package can also be found at Arick Grootveld, Eva R. Kozak, Carmen Franco-Gordo (2023) <doi:10.5281/zenodo.7979996>.
Authors: Arick Grootveld [cre, aut], Eva Kozak [aut]
Maintainer: Arick Grootveld <[email protected]>
License: GPL (>= 3)
Version: 0.2.0
Built: 2025-02-24 02:46:05 UTC
Source: https://github.com/arickgrootveld/zooid_rpackage

Help Index


batchPreProcessing

Description

Preprocessing a directory of zooplankton images

Usage

batchPreProcessing(
  zpFileDir,
  zpSaveDir,
  minPixels = 5000,
  imageExtension = ".jpg",
  noRepeats = TRUE,
  verbose = TRUE
)

Arguments

zpFileDir

Directory full of zooplankton images to extract

zpSaveDir

Directory to save the extracted images to

minPixels

Integer specifying the minimum number of pixels allowed in an extracted image Any extracted image with fewer pixels will not be saved [Default: 5000 (~70 by 70 pixels)]

imageExtension

String specifying the extension the images will have (must include ".") [Default: ".jpg"]

noRepeats

Boolean variable to decide whether to ignore images that are already present in the save dir, or not [Default: TRUE]

verbose

Boolean variable indicating whether the script should print info to console [Default: TRUE]

Examples

## Not run: 
zpFileDir <- 'Users/$(whoami)/Images/ZooplanktonImages/ostracod'
zpSaveDir <- 'Users/$(whoami)/Images/ExtractedImages/ostracod'
batchPreProcessing(zpFileDir, zpSaveDir)

## End(Not run)

datasetPreProcessing

Description

Preprocessing a directory structure of zooplankton images, and saving the resultant images to another directory structure

Usage

datasetPreProcessing(
  zpFileDir,
  zpSaveDir,
  minPixels = 5000,
  imageExtension = ".jpg",
  verbose = TRUE
)

Arguments

zpFileDir

Directory of subdirectories containing zooplankton images

zpSaveDir

Directory to setup the subdirectory structure for the extracted images

minPixels

Integer specifying the minimum number of pixels allowed in an extracted image See "batch_imagePreProcessing" for details [Default: 5000]

imageExtension

String specifying the extension the images will have (must include ".") [Default: ".jpg"]

verbose

Boolean variable indicating whether the script should print info to console [Default: TRUE]

Examples

## Not run: 
zpFileDir <- 'Users/$(whoami)/Images/ZooplanktonImages'
zpSaveDir <- 'Users/$(whoami)/Images/ExtractedImages'
batchPreProcessing(zpImgDir, zpSaveDir)

## End(Not run)

imagePreProcessing

Description

Preprocessing the passed image

Usage

imagePreProcessing(zpFilepath)

Arguments

zpFilepath

Filepath to the zooplankton image to be processed

Value

extractedImage The section of the image extracted by the algorithm, or NULL if the image was corrupted

Examples

## Not run: 
zpFilepath <- 'Users/$(whoami)/Images/ZooplanktonImages/ostracod1.png'
ostracod1Image <- imagePreProcessing(zpFilepath)

## End(Not run)

unpack_processedDataset

Description

Unpacking the processed zooplankton dataset to a specific directory. The result will be a directory named "processedDataset" being put the specified save directory, containing all the image files from the processed dataset that comes with this package

Usage

unpack_processedDataset(saveDir)

Arguments

saveDir

(String) Directory to save the processed dataset to

Examples

## Not run: 
saveDir <- 'Users/$(whoami)/Images/ZooplanktonImages/'
unpack_processedDataset(saveDir)

## End(Not run)

unpack_unprocessedDataset

Description

Unpacking the unprocessed zooplankton dataset to a specific directory The result will be a directory named "unprocessedDataset" being put in the specified save directory, containing all the image files from the dataset that comes with this package, but before processing was applied

Usage

unpack_unprocessedDataset(saveDir)

Arguments

saveDir

(String) Directory to save the unprocessed dataset to

Examples

## Not run: 
saveDir <- 'Users/$(whoami)/Images/ZooplanktonImages/'
unpack_unprocessedDataset(saveDir)

## End(Not run)