alg.py 文件源码

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

项目:image-segmentation 作者: alexlouden 项目源码 文件源码
def scale(self):

        self.original_image = self.image.copy()

        self.image_height, self.image_width = self.image.shape[:2]

        if max(self.image_width, self.image_height) > MAX_DIMENSION:
            # Need to shrink

            if self.image_width > self.image_height:
                new_width = MAX_DIMENSION
                new_height = int(self.image_height * new_width / self.image_width)
            else:
                new_height = MAX_DIMENSION
                new_width = int(self.image_width * new_height / self.image_height)

            print 'Resizing to {}x{}'.format(new_width, new_height)

            self.image = cv2.resize(self.image, (new_width, new_height), interpolation=cv2.INTER_AREA)
            self.image_height, self.image_width = self.image.shape[:2]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号