mask.py 文件源码

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

项目:CAAPR 作者: Stargrazer82301 项目源码 文件源码
def eroded(self, structure=None, connectivity=2, iterations=100):

        """
        This function ...
        :param structure:
        :param connectivity:
        :param iterations:
        :return:
        """

        # Define the structure for the expansion
        if structure is None: structure = ndimage.generate_binary_structure(2, connectivity=connectivity)

        try:
            # Make the new mask, made from 100 iterations with the structure array
            data = ndimage.binary_erosion(self, structure, iterations)
        except:
            #print(self)
            #print(structure)
            data = np.zeros((self.ysize,self.xsize), dtype=bool)

        # Reassign this object
        #data, name=None, description=None
        return Mask(data, name=self.name, description=self.description)

    # -----------------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号