-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
def gen_trimap(alpha):
k_size = random.choice(range(5, 10)) # 随机选择核大小
iterations = np.random.randint(1, 20)
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (k_size, k_size))
dilated = cv2.dilate(alpha, kernel, iterations)
eroded = cv2.erode(alpha, kernel, iterations)
trimap = np.zeros(alpha.shape)
trimap.fill(128)
trimap[eroded >= 254] = 255
trimap[dilated <= 0] = 0
return trimap
I use this code to get trimap from alpha, and use this trimap for OTVM model, but the predict result is wrong, and even the trimap_gt generated (only red,green,no blue) is different from the the input, it is amazing
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels