import cv2 import copy import os def filter_srcimg(dstimg): ss=3 srcimg=copy.deepcopy(dstimg) #aa=5 imgw=srcimg.shape[0] imgh=srcimg.shape[1] border_mat=[[0]*imgw]*imgh for ddd in range(0,1): for i in range(20,imgw-20): for j in range(20,imgh-20): lo…