A polygon is not rasterized into the binary mask in the same way if using within the toolkit or just by using OpenCV. It looks like the OpenCV fillConvexPoly works differently if some coordinates are out of image. For more details see code example.
import cv2
import numpy as np
from vot.region.shapes import RegionType, Polygon
p = [660, 570, 635, 527, 723, 476, 748, 519]
img_sz = [960, 540] # [width, height]
m = np.zeros((img_sz[1], img_sz[0]), dtype=np.uint8)
cv2.fillConvexPoly(m, np.reshape(p, (-1, 1, 2)), 1)
poly = Polygon([(p1, p2) for p1, p2 in zip(p[::2], p[1::2])])
toolkit_m = poly.convert(RegionType.MASK).get_array(img_sz)
diff = np.sum(np.abs(toolkit_m - m))
print('Number of total pixels which are different:', diff)
cv2.namedWindow('m', cv2.WINDOW_NORMAL)
cv2.imshow('m', (255 * m).astype(np.uint8))
cv2.waitKey(10)
cv2.namedWindow('toolkit_m', cv2.WINDOW_NORMAL)
cv2.imshow('toolkit_m', (255 * toolkit_m).astype(np.uint8))
cv2.waitKey(10)
cv2.namedWindow('diff', cv2.WINDOW_NORMAL)
cv2.imshow('diff', (255 * np.abs(toolkit_m - m)).astype(np.uint8))
cv2.waitKey(0)
A polygon is not rasterized into the binary mask in the same way if using within the toolkit or just by using OpenCV. It looks like the OpenCV fillConvexPoly works differently if some coordinates are out of image. For more details see code example.