def edge_pixel_image(image,bv_image):
edge_result = image.copy()
edge_result = cv2.Canny(edge_result,30,100)
i = 0
j = 0
while i < image.shape[0]:
j = 0
while j < image.shape[1]:
if edge_result[i,j] == 255 and bv_image[i,j] == 255:
edge_result[i,j] = 0
j = j+1
i = i+1
newfin = cv2.dilate(edge_result, cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(3,3)), iterations=1)
return newfin
评论列表
文章目录