add_visual_image() stores a visual image and map-to-image alignment metadata
on an OpenSpecy or Specs object. visual_image() retrieves that
attribute. detect_image_origin() detects red Thermo Fisher iN10 map boxes
in visual images and returns the image coordinates needed for overlays and
feature color extraction.
Usage
add_visual_image(
x,
image,
bottom_left = NULL,
top_right = NULL,
source = NULL,
detection_method = NULL,
diagnostics = NULL,
transform = NULL,
...
)
visual_image(x, require = FALSE, ...)
detect_image_origin(
image,
red_threshold = 50,
red_ratio = 2,
min_pixels = 1,
diagnostics = TRUE,
...
)Arguments
- x
an
OpenSpecyorSpecsobject.- image
image path, raster, matrix, array, raw BMP bytes, or an existing visual-image list.
- bottom_left, top_right
numeric length-2 vectors giving the lower-left and upper-right corners of the spectral map in image pixel coordinates. Image x values are left-to-right and image y values are top-to-bottom.
- source
optional image source label or file path.
- detection_method
optional description of how the origin was detected.
- diagnostics
optional diagnostic data to store with the image.
- transform
optional list describing a custom transform.
- require
logical; should
visual_image()error when no image is attached?- red_threshold
minimum red-channel value on the 0-255 scale.
- red_ratio
minimum red-to-green and red-to-blue ratio for red-box detection.
- min_pixels
minimum number of red pixels required for origin detection.
- ...
reserved for future methods.