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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With