I would really-really appreciate any (theoretical or/and practical) guidance how I could detect, count the number of lines (normally 2 or maybe 1) on a binary image and measure the shortest distance between them. The lines are products of previous processing (rgb->grey->canny edge->cropping->dilation). I am currently trying to use R's imager package but I can think of alternatives like Matlab or Scilab.
Many-many thanks,
What about using Hough Transform? It is a quite common algorithm for detecting straight lines in binary images. I think it is available in PET package. Alternatively, I would also suggest using OpenCV.