knitr::opts_chunk$set(echo = TRUE)

library(rbenchmark)
library(webmorphR)
library(webmorphR.stim)

Test set

Test on a set of 100 large images.

stimuli <- load_stim_london()[1:100]

list(
  n = length(stimuli),
  w = width(stimuli) |> unique(),
  h = height(stimuli) |> unique()
) |> str()

Basic image/tem manip functions

manip <- benchmark(
  crop = { stim_crop <- crop(stimuli, 0.6, 0.8) },
  pad = { stim_pad <- pad(stimuli, 0.01) },
  #rotate = { stim_pad <- rotate(stimuli, 45) },
  replications = 1,
  columns = c("test", "replications", "elapsed",
              "relative", "user.self", "sys.self")
)

manip


debruine/webmorphR documentation built on Aug. 15, 2022, 3:51 p.m.