process_batch_list: Process Batch List

View source: R/BatchProcessing.R

process_batch_listR Documentation

Process Batch List

Description

Process a list of handwriting samples saved as PNG images: (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_list(images, output_dir, return_result = TRUE)

Arguments

images

A vector of image file paths

output_dir

A directory to save the processed images

return_result

TRUE/FALSE whether to return the result. If TRUE, the processed documents with be saved and a list of the processed documents will be returned. If FALSE, the processed documents will be saved, but nothing will be returned.

Value

A list of processed documents

Examples

## Not run: 
images <- c('path/to/image1.png', 'path/to/image2.png', 'path/to/image3.png')
process_batch_list(images, "path/to/output_dir", FALSE)
docs <- process_batch_list(images, "path/to/output_dir", TRUE)

## End(Not run)


handwriter documentation built on Oct. 13, 2023, 5:10 p.m.