polygon2contour: fix 698f38e4 (deprecated dtype)

This commit is contained in:
Robert Sachunsky 2025-08-29 17:21:08 +02:00
parent 741aa7867c
commit d3566e55ef

View file

@ -353,7 +353,7 @@ def contour2polygon(contour: Union[np.ndarray, Sequence[Sequence[Sequence[Number
return make_valid(polygon)
def polygon2contour(polygon: Polygon) -> np.ndarray:
polygon = np.array(polygon.exterior.coords[:-1], dtype=np.int)
polygon = np.array(polygon.exterior.coords[:-1], dtype=int)
return np.maximum(0, polygon).astype(np.uint)[:, np.newaxis]
def make_valid(polygon: Polygon) -> Polygon: