# Small example of stitching two 3x4 matrices left to right together.
test <- stitchImgs(imgs = list(matrix(c(1,0,0,0,
0,1,0,0,
0,0,1,1), ncol = 4, nrow = 3,
byrow = TRUE),
matrix(c(0,0,0,0,
1,0,0,1,
0,1,1,0), ncol = 4, nrow = 3,
byrow = TRUE)),
overlap_px = 1, max_shift_px = 2)
# The stitched image also contains the overlaps used for stitching.
attributes(test)
# Example of stitching the two matrices with a fixed (in this case not
# optimal) overlap.
blendImgs(imgs = list(matrix(c(1,0,0,0,
0,1,0,0,
0,0,1,1), ncol = 4, nrow = 3, byrow = TRUE),
matrix(c(0,0,0,0,
1,0,0,1,
0,1,1,0), ncol = 4, nrow = 3, byrow = TRUE)),
overlap_px = 1, blending_mode = "over")[,,1]
Run the code above in your browser using DataLab