require(plotrix)
filename <- system.file("sample_img/dots.jpg", package = "videoplayR")
img <- readImg(filename)
bw <- thresholding(img, 200, "inverted")
blobs <- blobDetector(bw)
imshow(img)
points(y ~ x, data = blob, col = "red", pch = 20)
draw.ellipse(blob$x, blob$y, blob$major / 2, blob$minor / 2, blob$alpha, border = "red")
Run the code above in your browser using DataLab