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…
1 深拷贝浅拷贝 1.1 a==b与a is b的区别 a == b 比较两个对象的内容是否相等(可以是不同内存空间) a is b 比较a与b是否指向同一个内存地址,也就是a与b的id是否相同 >>> a = 1 >>> b = 1 >>> a == b True >>> a is b True >>> a = 257 >>> b = 257 >>> a is b Fal…
import UIKit /* class Person { let name: String //强引用 init(name: String) { self.name = name print("\(name) is being initialized") } //引用计数销毁时 deinit { print("\(name) is being deinitialized") } } */ class Person { let name: String init(…