image_stitch() merges multiple overlapping planar images (e.g. root scanner tiles,
oversized plant leaves, bench scans, or drone orthomosaic patches) into a single
seamless composite without requiring OpenCV, Python, or external software.
The native pipeline performs:
Multi-Scale Normalized Cross-Correlation (NCC): Coarse-to-fine registration finding the exact sub-pixel horizontal and vertical shifts between adjacent tiles.
Cosine-Smooth Seam Feathering: Eliminates visible seam lines and exposure steps by applying non-linear cosine weighted transitions across the overlap zone.
Dynamic Canvas Expansion: Recursively chains two or more images into a single composite image array.
Usage
image_stitch(
images,
direction = c("horizontal", "vertical", "auto"),
blend = TRUE,
overlap_hint = 0.2,
plot = FALSE,
return_details = FALSE,
verbose = TRUE
)Arguments
- images
A list of
Imageobjects or a character vector of file paths.- direction
Stitching direction:
"horizontal"(left-to-right),"vertical"(top-to-bottom), or"auto"(automatically chosen based on best correlation peak).- blend
Logical. If
TRUE(default), applies smooth seam feathering across overlapping image bands. IfFALSE, places images directly with a sharp cut.- overlap_hint
Expected fractional overlap between adjacent images (default: 0.2 = 20%).
- plot
Logical. If
TRUE, plots the stitched result.- return_details
Logical. If
TRUE, returns a named list with the stitchedimageand registration diagnostics (shifts, NCC scores, overlap dimensions). IfFALSE(default), returns the stitchedImagedirectly.- verbose
Logical. If
TRUE(default), displays progress messages.
Author
Tiago Olivoto tiagoolivoto@gmail.com
