process_batch_dir: Process Batch Directory

View source: R/BatchProcessing.R

process_batch_dirR Documentation

Process Batch Directory

Description

Process a list of handwriting samples saved as PNG images in a directory: (1) Load the image and convert it to black and white with readPNGBinary() (2) Thin the handwriting to one pixel in width with thinImage() (3) Run processHandwriting() to split the handwriting into parts called edges and place nodes at the ends of edges. Then combine edges into component shapes called graphs. (4) Save the processed document in an RDS file. (5) Optional. Return a list of the processed documents.

Usage

process_batch_dir(input_dir, output_dir = ".", skip_docs_on_retry = TRUE)

Arguments

input_dir

Input directory that contains images

output_dir

A directory to save the processed images

skip_docs_on_retry

Logical whether to skip documents in input_dir that caused errors on a previous run. The errors and document names are stored in output_dir > problems.txt. If this is the first run, process_batch_list will attempt to process all documents in input_dir.

Value

A list of processed documents

Examples

## Not run: 
process_batch_list("path/to/input_dir", "path/to/output_dir")
docs <- process_batch_list("path/to/input_dir", "path/to/output_dir")

## End(Not run)


CSAFE-ISU/handwriter documentation built on March 24, 2024, 6:23 p.m.