| locate_ndl_in_hay | R Documentation | 
locate_image().Locate needle image  matrix position in a haystack_image matrix.
Helper function for locate_image().
locate_ndl_in_hay(ndl_mt, hay_mt, exact = TRUE, timeout = 5)
ndl_mt, hay_mt | 
 A matrix  | 
exact | 
 A logical. Check matching exactly or not.  | 
timeout | 
 A numeric for timeout seconds.  | 
A numeric pair of xy location for needle image.
haystack_image <- imager::load.example("parrots")
w <- 100
h <- 50
needle_image <- hay2needle(haystack_image, 129, 257, w, h)
hay_mt <- image2gray_matrix(haystack_image)
ndl_mt <- image2gray_matrix(needle_image)
(pos <- locate_ndl_in_hay(ndl_mt, hay_mt))
found <- hay2needle(haystack_image, pos[1], pos[2], w, h)
layout(c(1:3))
plot(haystack_image)
plot(needle_image)
plot(found)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.