0

I would like to calculate the diameter of an irregular shape, in a given input image like this sample. I'm using this algorithm.

I can’t import a real image, can you help me? I'm new on stackoverflow..

Tonechas
  • 13,398
  • 16
  • 46
  • 80
frank
  • 1
  • 1
  • Huh? The diameter is the distance across a shape and that distance varies according to where you measure it, so what do you actually want to measure please? Maybe you could add a second, marked up image? – Mark Setchell May 28 '17 at 21:05

1 Answers1

0

You can use the scipy.ndimage.imread function to import your image into an ndarray and then use the algorithm you mentioned.

img = scipy.ndimage.imread("PATH_TO_MY_IMG.jpg")
  • there is an error r, c = np.vstack(ndimage.center_of_mass(img, labels, np.arange(nlabels) + 1)).T ValueError: too many values to unpack (expected 2) – frank May 26 '17 at 15:18