Skip to contents

This function plots the length and width lines given an object computed with analyze_objects(). The function does not call plot.new, so it must be called after an image is plotted. This can be done either using, e.g., plot(img), or analyze_objects(..., plot = TRUE).

Usage

plot_lw(
  object,
  col_length = "red",
  col_width = "green",
  lwd_length = 2,
  lwd_width = 2
)

Arguments

object

An object computed with analyze_objects().

col_length

The color of the length line. Default is "red".

col_width

The color of the width line. Default is "green".

lwd_length

The line width of the length line. Default is 2.

lwd_width

The line width of the width line. Default is 2.

Details

This function takes an object computed with analyze_objects() and plots the length and width lines of each object onto an image. The length and width lines are calculated based on the position and orientation of the object, and are plotted using the specified colors and line widths.

Examples

img <- image_pliman("flax_leaves.jpg")
res <- analyze_objects(img, watershed = FALSE, show_contour = FALSE)
plot_lw(res)