def pyramid(image, minSize):
yield image
if image.shape[0] < minSize[0] and image.shape[1] < minSize[1]:
# image too small - upscaling until we hit window level
image = cv2.pyrUp(image)
while (image.shape[0] <= minSize[0] or image.shape[1] <= minSize[1]):
yield image
image = cv2.pyrUp(image)
else:
# image too big - downscaling until we hit window level
image = cv2.pyrDown(image)
while (image.shape[0] >= minSize[0] or image.shape[1] >= minSize[1]):
yield image
image = cv2.pyrDown(image)
# Malisiewicz et al.
评论列表
文章目录