interpolation.py 文件源码

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

项目:CAAPR 作者: Stargrazer82301 项目源码 文件源码
def inpaint_biharmonic(frame, mask):

    """
    This function ...
    :param frame:
    :param mask:
    :return:
    """

    maximum = np.nanmax(frame)
    normalized = frame / maximum
    data = inpaint.inpaint_biharmonic(normalized, mask, multichannel=False)

    return data * maximum

# -----------------------------------------------------------------

# TODO: create a better inpainting function. OpenCV has one, but this is a terrible dependency because it's hard to
# install. Options:
#  - The below replace_nans function can be replaced by the more up to date version at:
#    https://github.com/OpenPIV/openpiv-python/blob/master/openpiv/src/lib.pyx
#    We may want to keep it in cython so that it runs faster. However, this original does not have the inverse distance
#    weighing as in the code below, but we can maybe add this ourselves in the cython code
#  - Write our own code.
# SOLUTION: SEE FUNCTION ABOVE, GENERALLY, IT IS MUCH BETTER
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号