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 |
Preprocessing a directory of zooplankton images
batchPreProcessing( zpFileDir, zpSaveDir, minPixels = 5000, imageExtension = ".jpg", noRepeats = TRUE, verbose = TRUE )
batchPreProcessing( zpFileDir, zpSaveDir, minPixels = 5000, imageExtension = ".jpg", noRepeats = TRUE, verbose = TRUE )
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] |
## Not run: zpFileDir <- 'Users/$(whoami)/Images/ZooplanktonImages/ostracod' zpSaveDir <- 'Users/$(whoami)/Images/ExtractedImages/ostracod' batchPreProcessing(zpFileDir, zpSaveDir) ## End(Not run)
## Not run: zpFileDir <- 'Users/$(whoami)/Images/ZooplanktonImages/ostracod' zpSaveDir <- 'Users/$(whoami)/Images/ExtractedImages/ostracod' batchPreProcessing(zpFileDir, zpSaveDir) ## End(Not run)
Preprocessing a directory structure of zooplankton images, and saving the resultant images to another directory structure
datasetPreProcessing( zpFileDir, zpSaveDir, minPixels = 5000, imageExtension = ".jpg", verbose = TRUE )
datasetPreProcessing( zpFileDir, zpSaveDir, minPixels = 5000, imageExtension = ".jpg", verbose = TRUE )
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] |
## Not run: zpFileDir <- 'Users/$(whoami)/Images/ZooplanktonImages' zpSaveDir <- 'Users/$(whoami)/Images/ExtractedImages' batchPreProcessing(zpImgDir, zpSaveDir) ## End(Not run)
## Not run: zpFileDir <- 'Users/$(whoami)/Images/ZooplanktonImages' zpSaveDir <- 'Users/$(whoami)/Images/ExtractedImages' batchPreProcessing(zpImgDir, zpSaveDir) ## End(Not run)
Preprocessing the passed image
imagePreProcessing(zpFilepath)
imagePreProcessing(zpFilepath)
zpFilepath |
Filepath to the zooplankton image to be processed |
extractedImage The section of the image extracted by the algorithm, or NULL if the image was corrupted
## Not run: zpFilepath <- 'Users/$(whoami)/Images/ZooplanktonImages/ostracod1.png' ostracod1Image <- imagePreProcessing(zpFilepath) ## End(Not run)
## Not run: zpFilepath <- 'Users/$(whoami)/Images/ZooplanktonImages/ostracod1.png' ostracod1Image <- imagePreProcessing(zpFilepath) ## End(Not run)
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
unpack_processedDataset(saveDir)
unpack_processedDataset(saveDir)
saveDir |
(String) Directory to save the processed dataset to |
## Not run: saveDir <- 'Users/$(whoami)/Images/ZooplanktonImages/' unpack_processedDataset(saveDir) ## End(Not run)
## Not run: saveDir <- 'Users/$(whoami)/Images/ZooplanktonImages/' unpack_processedDataset(saveDir) ## End(Not run)
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
unpack_unprocessedDataset(saveDir)
unpack_unprocessedDataset(saveDir)
saveDir |
(String) Directory to save the unprocessed dataset to |
## Not run: saveDir <- 'Users/$(whoami)/Images/ZooplanktonImages/' unpack_unprocessedDataset(saveDir) ## End(Not run)
## Not run: saveDir <- 'Users/$(whoami)/Images/ZooplanktonImages/' unpack_unprocessedDataset(saveDir) ## End(Not run)