本文整理汇总了Python中menpo.image.MaskedImage.as_unmasked方法的典型用法代码示例。如果您正苦于以下问题:Python MaskedImage.as_unmasked方法的具体用法?Python MaskedImage.as_unmasked怎么用?Python MaskedImage.as_unmasked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类menpo.image.MaskedImage
的用法示例。
在下文中一共展示了MaskedImage.as_unmasked方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_masked_image_as_unmasked_fill_tuple
# 需要导入模块: from menpo.image import MaskedImage [as 别名]
# 或者: from menpo.image.MaskedImage import as_unmasked [as 别名]
def test_masked_image_as_unmasked_fill_tuple():
m_img = MaskedImage(np.random.rand(3, 3, 3), copy=False)
m_img.mask.pixels[0, 0, 0] = False
img = m_img.as_unmasked(fill=(1, 2, 3))
assert(type(img) == Image)
assert_allclose(m_img.pixels[0, 1:, 1:], img.pixels[0, 1:, 1:])
assert_allclose(img.pixels[:, 0, 0], (1, 2, 3))
示例2: test_masked_image_as_unmasked_fill
# 需要导入模块: from menpo.image import MaskedImage [as 别名]
# 或者: from menpo.image.MaskedImage import as_unmasked [as 别名]
def test_masked_image_as_unmasked_fill():
m_img = MaskedImage(np.random.rand(1, 3, 3), copy=False)
m_img.mask.pixels[0, 0, 0] = False
img = m_img.as_unmasked(fill=8)
assert type(img) == Image
assert_allclose(m_img.pixels[0, 1:, 1:], img.pixels[0, 1:, 1:])
assert_allclose(img.pixels[0, 0, 0], 8.0)
示例3: test_masked_image_as_unmasked
# 需要导入模块: from menpo.image import MaskedImage [as 别名]
# 或者: from menpo.image.MaskedImage import as_unmasked [as 别名]
def test_masked_image_as_unmasked():
m_img = MaskedImage(np.random.rand(1, 3, 3), copy=False)
img = m_img.as_unmasked()
assert(type(img) == Image)
assert_allclose(m_img.pixels, img.pixels)
示例4: test_masked_image_as_unmasked
# 需要导入模块: from menpo.image import MaskedImage [as 别名]
# 或者: from menpo.image.MaskedImage import as_unmasked [as 别名]
def test_masked_image_as_unmasked():
m_img = MaskedImage(np.random.rand(3, 3, 1), copy=False)
img = m_img.as_unmasked()
assert(type(img) == Image)
assert(np.all(m_img.pixels == img.pixels))