cropping_browser.py 文件源码

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

项目:flickr-cropping-dataset 作者: yiling-chen 项目源码 文件源码
def browse(database):
    for item in database:
        filename = os.path.split(item['url'])[-1]
        path = image_root + filename
        img = cv2.imread(path, cv2.IMREAD_COLOR)
        crop = item['crop']
        x = crop[0]
        y = crop[1]
        w = crop[2]
        h = crop[3]

        # Error handling
        if img is None:
            puts(colored.red('ERROR: loading image failed!'))
            continue

        cv2.rectangle(img, (x,y), (x+w, y+h), (0,255,0), 2)
        cv2.imshow('Cropping', img)
        key = cv2.waitKey()

        if key == 1048603:
            print 'exit'
            break
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号