edger_extract: Extract Edge Pixels

View source: R/edger_extract.R

edger_extractR Documentation

Extract Edge Pixels

Description

Find pixel coordinates of edges in defined regions of a reference image.

Usage

edger_extract(
  imagepath,
  roi = NULL,
  th = 0.1,
  regions = 1,
  shift = c(0, 0),
  rotate = 0,
  color = "red",
  show_image = TRUE
)

Arguments

imagepath

The file path to the image to be analyzed.

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 a 4-column data frame with a number of rows equal to regions. 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 0-1 for the lowest threshold value you want to recolor in each image(a low threshold value captures weaker contrasts). Default is 0.1.

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. Only needs to be set if show_image == TRUE.

show_image

Logical. Plot the image with the extracted pixels recolored. Default is TRUE.

Value

A data frame containing the x and y coordinates and the unique pixel identifiers for each edge pixel.


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