fig_clean: fig_clean Removes color values close to white, also possible...

View source: R/fig_clean.R

fig_cleanR Documentation

fig_clean Removes color values close to white, also possible to remove text on plot, useful for gridlines on KM curves

Description

fig_clean Removes color values close to white, also possible to remove text on plot, useful for gridlines on KM curves

Usage

fig_clean(fig.hsl, bg_lightness = 0.1, attempt_OCR = F, word_sensitivity = 30)

Arguments

fig.hsl

array of pixels in HSL format (hue/saturation/lightness)

bg_lightness

a lightness threshold value between 0 and 1; every pixel with lightness > bg_lightness is considered background and removed (default: 0.1).

attempt_OCR

a logical indicating whether to attempt text recognition (default: False)

word_sensitivity

A sensitivity percentage value for word recognition, potential pixel patterns are considered words if confidence > word_sensitivity (default: 30)

Value

fig.df: a dataframe with x,y and h,s,l values for each remaining pixel

Examples

# fig_clean(fig.hsl = figure, bg_lightness = 0.1, attempt_OCR = T, word_sensitivity = 30)


Pechli-Lab/SurvdigitizeR documentation built on July 17, 2024, 8:01 a.m.