Skip to contents

Visualizes the normalized potential field and center of gravity (COG) computed by cog_potential. Each pixel's potential is shown as grayscale intensity, where darker pixels indicate higher potential. Optionally overlays crosshair lines at the computed COG to indicate its position.

Usage

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

Arguments

lst

A list returned by cog_potential, containing a data frame of normalized potentials and computed statistics.

show_cog

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

plot_image

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

Value

An object of class cimg representing the potential field image, optionally overlaid with COG crosshair lines.

See also

Examples

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