hsv-tuner.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:RunescapeBots 作者: lukegarbutt 项目源码 文件源码
def resize_image(self,img,*args):
        # unpacks width, height
        height, width,_ = img.shape
        print("Original size: {} {}".format(width, height))
        count_times_resized = 0
        while width > 500 or height > 500:
        #if width > 300 or height > 300:
            # divides images WxH by half
            width = width / 2
            height = height /2
            count_times_resized += 1
        # prints x times resized to console
        if count_times_resized != 0:
            print("Resized {}x smaller, to: {} {}".format(count_times_resized*2,width, height))
        # makes sures image is not TOO small
        if width < 300 and height < 300:
            width = width * 2
            height = height * 2

        img = cv2.resize(img,(int(width),int(height)))

        return img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号