sphere_transforms_numpy.py 文件源码

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

项目:spherical_image_editing 作者: henryseg 项目源码 文件源码
def get_interpolated_pixel_color(pts, s_im, size):
    """given pts in floats, linear interpolate pixel values nearby to get a good colour"""
    pts = clamp(pts, size)

    s_im = np.atleast_3d(s_im)
    ys,xs = size
    ycoords, xcoords = np.arange(ys), np.arange(xs)
    out = np.empty(pts.shape[1:] + (s_im.shape[-1],),dtype=s_im.dtype)
    for i in range(s_im.shape[-1]): #loop over color channels
        map_coordinates(s_im[...,i],pts,out[...,i],mode='nearest')
    return out
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号