def drawDBSCAN(src, maps, labels):
    colors = []
    for lb in set(labels):
        mask = np.where((maps == lb), 255, 0).astype(np.uint8)
        color = list(map(int, list(cv2.mean(src, mask)[:src.shape[2]])))
        colors.append(np.array(color, dtype=np.uint8))
    colors = np.asarray(colors)
    dst = colors[labels].astype(np.uint8).reshape(src.shape)
    return dst
def drawDBSCAN(src, maps, labels):
    colors = []
    for lb in set(labels):
        mask = np.where((maps == lb), 255, 0).astype(np.uint8)
        color = list(map(int, list(cv2.mean(src, mask)[:src.shape[2]])))
        colors.append(np.array(color, dtype=np.uint8))
    colors = np.asarray(colors)
    dst = colors[labels].astype(np.uint8).reshape(src.shape)
    return dst