cv.CvtColor(orig, grey, cv.CV_RGB2GRAY)
cv.Threshold(grey, grey, 200, 255, cv.CV_THRESH_BINARY_INV)
elem = cv.CreateStructuringElementEx(3, 3, 1, 1, cv.CV_SHAPE_CROSS)
while True:
    cv.MorphologyEx(grey, temp, None, elem, cv.CV_MOP_OPEN)
cv.Not(temp, temp)
cv.And(grey, temp, temp)
cv.Or(skel, temp, skel)
cv.Erode(grey, grey, elem)
minVal, maxVal, minLoc, maxLoc = cv.MinMaxLoc(grey)
if maxVal == 0:
    break
cv.ShowImage('orig', orig)
cv.ShowImage('skel', skel)
cv.WaitKey(-1)
How do I sample a line across a blob at a perpendicular angle? (in Python/OpenCV unless you suggest switching to something else)