fixed distrans.py sample (distanceTransform -> distanceTransformWithLabels)

This commit is contained in:
Alexander Mordvintsev 2012-03-06 13:22:55 +00:00
parent 63b5cf6dea
commit 2727a425e4

View File

@ -26,7 +26,7 @@ if __name__ == '__main__':
need_update = False
thrs = cv2.getTrackbarPos('threshold', 'distrans')
mark = cv2.Canny(img, thrs, 3*thrs)
dist, labels = cv2.distanceTransform(~mark, cv.CV_DIST_L2, 5)
dist, labels = cv2.distanceTransformWithLabels(~mark, cv.CV_DIST_L2, 5)
if voronoi:
vis = cm[np.uint8(labels)]
else: