from typing import List
from typing import Dict


def _get_segmentation(polygon: List[Dict], width: int, height: int) -> List[int]:
    """Convert RedBrick polygon to coco segmentation field."""
    segment = []
    for point in polygon:
        segment += [
            int(point["xnorm"] * width),
            int(point["ynorm"] * height),
        ]

    return segment