ifcb_summarize_png_data.RdThis function summarizes the number of images per class for each sample and timestamps, and optionally retrieves GPS positions, and IFCB information using `ifcb_read_hdr_data` and `ifcb_convert_filenames` functions.
ifcb_summarize_png_data(
png_folder,
hdr_folder = NULL,
sum_level = "sample",
verbose = TRUE
)A character string specifying the path to the main directory containing subfolders (classes) with .png images.
A character string specifying the path to the directory containing the .hdr files. Default is NULL.
A character string specifying the level of summarization. Options: "sample" (default) or "class".
A logical indicating whether to print progress messages. Default is TRUE.
If sum_level is "sample", returns a data frame with columns: sample, ifcb_number, class_name, n_images, gpsLatitude, gpsLongitude, timestamp, year, month, day, time, roi_numbers. If sum_level is "class", returns a data frame with columns: class_name, n_images.
if (FALSE) {
# Example usage:
# Assuming the following directory structure:
# png_folder/
# ├── class1/
# │ ├── sample1_00001.png
# │ ├── sample1_00002.png
# │ ├── sample2_00001.png
# ├── class2/
# │ ├── sample1_00003.png
# │ ├── sample3_00001.png
png_folder <- "path/to/png_folder"
hdr_folder <- "path/to/hdr_folder" # This folder should contain corresponding .hdr files
# Summarize by sample
summary_sample <- ifcb_summarize_png_data(png_folder,
hdr_folder,
sum_level = "sample",
verbose = TRUE)
print(summary_sample)
# Summarize by class
summary_class <- ifcb_summarize_png_data(png_folder,
hdr_folder,
sum_level = "class",
verbose = TRUE)
print(summary_class)
}