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.
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. IfFALSE
, 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.
Examples
if (FALSE) { # \dontrun{
result <- cog_contour(img_A)
draw_contour(result, show_cog = TRUE)
} # }