edger_multi: Apply Edges to Images

View source: R/edger_multi.R

edger_multiR Documentation

Apply Edges to Images

Description

Find pixel coordinates of edges in defined regions of a reference image. Then, find and recolor the same pixels in new images.

Usage

edger_multi(
  images,
  ref_images = 1,
  roi = NULL,
  th = 20,
  regions = 1,
  shift = c(0, 0),
  rotate = 0,
  color = "red",
  show_image = TRUE,
  process = "sequential",
  cores = 1
)

Arguments

images

A vector containing file paths of images to be analyzed. The first image will be the reference image, and edges from the first image will be superimposed onto the other images.

ref_images

A numeric indicating in how many reference images you want to search for edges. Default is 1. When greater than 1, the first n images will be used.

roi

An argument for delineating the region(s) of interest outside of the main function. Default is NULL and will launch a user interface so the user can draw a region(s) of interest on the image. If "roi" is not NULL, input should be a list containing 4-column data frames with a number of rows equal to regions, with one data frame per ref_images. The data frame needs to contain coordinates to the region(s) of interest in the following order: top-left x, top-left y, bottom-right x, bottom-right y. Note that plotting of images by "imager" starts in the top-left corner.

th

A vector of numeric values between 1-100 for the lowest threshold value you want to recolor in each image(a low threshold value captures weaker contrasts). Default is 20.

regions

A numeric indicating how many regions to draw. Default is 1.

shift

A vector of length 2 containing numerics indicating the amount of shift along the x axis first and the y axis second. Positive values indicate shifts right or up, while negative values indicate shifts left or down. Default is c(0,0).

rotate

A numeric indicating the number of degrees to rotate the recolored pixels. Pixels are rotated around the center of the edge pixels. Default is 0.

color

A character string for the color of the superimposed object. Default is red.

show_image

Logical. Plot images as they are recolored. Default is TRUE.

process

One of "sequential" or "parallel" to indicate how images should be processed. Default is sequential. If "parallel", cores will also have to be set.

cores

A numeric indicating how many cores to use in parallel processing. Safest is availableCores() - 1. Default is 1.

Value

Recolored images. Saves recolored images to working directory with "_edger" appended to the original name.


kaitlynstrickfaden/edger documentation built on Nov. 22, 2022, 5:55 a.m.