Inspired by this thread How do I find Waldo with Mathematica?
I have never done image processing in R but maybe other people who have want to share...
thanks!
Inspired by this thread How do I find Waldo with Mathematica?
I have never done image processing in R but maybe other people who have want to share...
thanks!
Here is a start, using the raster
package. I don't know if I will have the time to work on the cross-correlation method used in the Mathematica version of the question, but a local standard deviation on the red parts of the image seems to spot Waldo in this case...
library(raster)
waldo = stack("/Users/Benjamin/Desktop/DepartmentStore.jpg")
r = waldo[[1]] - waldo[[2]] - waldo[[3]]
r[is.na(r)] = 0
r_mask = Which(r > 0)
r_masked = r * r_mask
focalsd = focal(r_masked, w=3, fun=sd)
plot(focalsd)
© 2022 - 2024 — McMap. All rights reserved.
EBImage
package has counterparts of at least some of the functions used in the Mathematica answer. bioconductor.org/packages/release/bioc/html/EBImage.html – Kakemonoadimpro
may also be useful. cran.r-project.org/web/packages/adimpro/index.html – Kakemono