ImageSlicer.py 文件源码

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

项目:Pedestrian-Recognition 作者: yugrocks 项目源码 文件源码
def __init__(self,img):

        #making two copies of the same image
        original_img = np.array(img)
        new_img = np.array(img)

        #resizing keeping the aspect ratio constant
        a_ratio = new_img.shape[0]/new_img.shape[1]
        #new_row=int(new_img.shape[0])
        new_row = 128
        new_colm = int(new_row/a_ratio)
        new_img = cv2.resize(new_img, (new_colm,new_row), interpolation = cv2.INTER_AREA)
        original_img = cv2.resize(original_img, (new_colm,new_row), interpolation = cv2.INTER_AREA)
        #convert new_one to grayscale
        new_img = cv2.cvtColor(new_img,cv2.COLOR_BGR2GRAY)


        self.original_img = original_img
        self.new_img = new_img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号