Skip to contents

Visualizes the character region enclosed by the convex polygon computed using cog_contour. Optionally overlays crosshair lines at the computed center of gravity (COG) to aid interpretation.

Usage

draw_contour(lst, show_cog = TRUE, plot_image = TRUE)

Arguments

lst

A list returned by cog_contour, containing a data frame of polygon points and computed statistics.

show_cog

Logical. If TRUE (default), draws horizontal and vertical red lines through the COG to indicate its location.

plot_image

Logical. If TRUE (default), plots the reconstructed image. If FALSE, returns the image object without displaying it.

Value

An object of class cimg representing the polygon-filled image (with or without COG lines), which can be further used or saved.

See also

Examples

if (FALSE) { # \dontrun{
  result <- cog_contour(img_A)
  draw_contour(result, show_cog = TRUE)
} # }