annotate {annotator}R Documentation

Create an annotation widget

Description

This function creates an annotation using htmlwidgets. The widget can be rendered on HTML pages generated from Shiny or other applications.

Usage

annotate(
  im,
  resultId = "annot_id",
  brushWidth = 4,
  brushColor = "red",
  opacity = 0.5,
  fill = "grey"
)

Arguments

im

the input image. If missing, a transparent 800x600 png is used.

resultId

the id of the div in the UI where the annotation (the drawn polygon) is stored. Only relevant when the widget is used in shiny. Defaults to "annot_id".

brushWidth

default to 3 pixels.

brushColor

Any valid CSS color. For example "red", "rgba(255,93,0,1)", or "#1c4564".

opacity

default to 0.5.

fill

default to 'gray'

Value

An object generated by htmlwidgets::createWidget().

Examples

if (interactive()) {
  require(annotator)
  im = system.file("sample_images", "aves", "5.png", package = "annotator")
  annotate(im)
}


[Package annotator version 0.0.3.1 Index]