filter.py 文件源码

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

项目:guided-filter 作者: lisabug 项目源码 文件源码
def filter(self, p):
        """

        Parameters
        ----------
        p: NDArray
            Filtering input which is 2D or 3D with format
            HW or HWC

        Returns
        -------
        ret: NDArray
            Filtering output whose shape is same with input
        """
        p = to_32F(p)
        if len(p.shape) == 2:
            return self._Filter.filter(p)
        elif len(p.shape) == 3:
            channels = p.shape[2]
            ret = np.zeros_like(p, dtype=np.float32)
            for c in range(channels):
                ret[:, :, c] = self._Filter.filter(p[:, :, c])
            return ret
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号