#乳房胸肌分割
path = './file_path/'
files = os.listdir(path)
for file in files:
if "DS_Store" in file:
continue
s1 = cv2.imread(path+file+"/img.png")#原始乳房图像
s2 = cv2.imread(path+file+"/1.jpeg")#胸肌部分图像
img_and = cv2.bitwise_and(s1, s2, dst=None, mask=None)#和运算
img_sub = cv2.subtract(s1, img_and)#差运算
cv2.imwrite(os.path.join("new_file_path", file[:-5]+".jpeg"), img_sub)
图像逻辑运算
猜你喜欢
转载自blog.csdn.net/w144215160044/article/details/104915247
今日推荐
周排行