Code for interactive identification of points and calculation of distance between points in a jpeg in R