# Example of finding the best overlap of two sets of two matrices.
mat_R <- matrix(c(1,1,1,1,1,
0,1,1,1,1,
0,0,1,1,1), ncol = 5, nrow = 3, byrow = TRUE)
mat_G <- matrix(c(0,0,0,0,1,
0,1,0,0,1,
0,0,1,1,1), ncol = 5, nrow = 3, byrow = TRUE)
mat_G2 <- matrix(c(0,0,0,1,0,
0,0,0,0,0,
0,0,1,1,1), ncol = 5, nrow = 3, byrow = TRUE)
mat_B <- matrix(c(0,0,0,0,1,
0,0,0,0,1,
0,0,1,1,1), ncol = 5, nrow = 3, byrow = TRUE)
mat_B2 <- matrix(c(0,0,0,0,0,
0,1,0,0,1,
0,0,1,1,1), ncol = 5, nrow = 3, byrow = TRUE)
surface <- findAvgSurface(imgs = list(
array(c(mat_R,mat_G,mat_B), dim = c(dim(mat_R),3)),
array(c(mat_R,mat_G2,mat_B), dim = c(dim(mat_R),3)),
array(c(mat_R,mat_G,mat_B2), dim = c(dim(mat_R),3))),
radius_highpoint_px = 2, top_side = "top", ppcm = 1)
Run the code above in your browser using DataLab