图像金字塔:图像不断缩放
1 import cv2
#定义金字塔函数
#传入参数分为为图像,缩放比例,最小size 2 def img_pyramid(img,scale,minsize):
#调用1次返回1次 3 yield img 4 while minsize[1] < img.shape[0] or minszie[0]<img.shape[1] : 5 image=cv2.resize(img,int(img.shape[1]*scale),int(img.shape[0]*scale)) 6 yield image 7 else: 8 print('循环完成!')
1 图像滑动窗口 2 def sliding_box(img,step_size,box_size): 3 for row in range(0,img.shape[0],stepsize): 4 for col in x range(0,img.shape[1],stepsize): 5 yield (x,y,img[y:y+windowsize[1],x:x+windowsize[0]])
def non_max_suppression()
未完待续...