Image manipulation in Python (compute graph edge distance between nodes (region centroids)

766 Views Asked by At

I need to binarize image and compute selected microvessels (black-brown ), then to split image array into 100 equal parts and set centroids in these image regions (with max and min numbers of black pixels) and compute graph edge distance between the nodes lying in these centers. Does anybody has experience and know what functions to use in Python?

Here is the starting code:

 import numpy as np
 import scipy
 import pylab
 #import pymorph
 import mahotas
 from scipy import ndimage

 img = mahotas.imread('imagetest.tif')


 T = mahotas.thresholding.otsu(img)
 pylab.imshow(img > T)
 pylab.show()

Thank you much

1

There are 1 best solutions below

0
On

Try with this:

import numpy as np
import scipy
import pylab
#import pymorph
import mahotas
from scipy import ndimage

img = mahotas.imread('imagetest.tif')

img = rgb2gray(img)        
img = img_as_ubyte(img)    #Binarize image

T = mahotas.thresholding.otsu(img)
pylab.imshow(img > T)
pylab.show()