Skip to content

Convert Single mask image to polygon #61

@sctrueew

Description

@sctrueew

Hi, Thanks for your work

How can I get polygon and points from an image? I use this but not working

Mask example:
image

import numpy as np
from imantics import Polygons, Mask
from PIL import Image
instance_path = r"test.png"
instance_image = Image.open(instance_path)
instance_array = np.array(instance_image)
polygons = Mask(instance_array).polygons()

print(polygons.points)
print(polygons.segmentation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions