Above is an image that has been put through ndi.label()
and displayed with matplotlib with each coloured region representing a different feature. Plotted on top of the image are red points that represent a pair of coordinates each. All coordinates are stored and ndi.label returns the number of features. Does skimage, scipy or ndimage have a function that will test if a given set of coordinates lies within a labelled feature?
Initially I intended to use the binding box (left, right, top, bottom) of each feature but due to the regions not all being quadrilateral this won't work.
code to generate the image:
image = io.import("image path")
labelledImage, featureNumber = ndi.label(image)
plt.imshow(labelledImage)
for i in range(len(list))
y, x = list[i]
plt.scatter(y,x, c='r', s=40)