dct.py 文件源码

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

项目:pyVSR 作者: georgesterpu 项目源码 文件源码
def _crop_roi(fullframe, roisz):
    xpos = roisz[0]
    ypos = roisz[1]
    xlen = roisz[2]
    ylen = roisz[3]
    # numpy array indexing: lines are the first index => y direction goes first

    chan = np.ndim(fullframe)

    if xpos == -1:
        cropped = np.zeros((36, 36))
    else:
        if chan == 2:
            cropped = fullframe[ypos:ypos+ylen, xpos:xpos+xlen]
        elif chan == 3:
            cropped = fullframe[ypos:ypos + ylen, xpos:xpos + xlen, :]
        else:
            raise Exception('unsupported nb of channels')

    return cropped
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号