fixed distrans.py sample (distanceTransform -> distanceTransformWithLabels)
This commit is contained in:
@@ -26,7 +26,7 @@ if __name__ == '__main__':
|
|||||||
need_update = False
|
need_update = False
|
||||||
thrs = cv2.getTrackbarPos('threshold', 'distrans')
|
thrs = cv2.getTrackbarPos('threshold', 'distrans')
|
||||||
mark = cv2.Canny(img, thrs, 3*thrs)
|
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:
|
if voronoi:
|
||||||
vis = cm[np.uint8(labels)]
|
vis = cm[np.uint8(labels)]
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user