我想通过编码为某些图像制作分割蒙版。有一个工具可以生成大约有边界点坐标的xml文件。可以通过获取标签值来获得这些坐标。图像大小为800x600像素。
例如,从此工具中提取以下几点。如何填充用虚线标记的轮廓内的区域,例如:白色?感谢。
points = [(737,255),(736,265),(735,270),(739,273),(746,264), (755,268),(765,272),(767,276),(769,278),(776,275),(776,264), (767,260),(753,257),(738,256),(738,256),(479,247),(455,244), (446,245),(440,243),(430,244),(423,241),(419,238),(412,232), (406,225),(403,202),(404,185),(410,170),(414,166),(424,160), (439,157),(456,166),(469,177),(472,197),(480,199),(492,214), (494,207),(488,201),(492,193),(497,194),(502,196),(510,196), (518,197),(523,202),(521,209)]
import Image
import numpy as np
a = Image.new('RGB',(800,600),0)
for p in points:
a.putpixel(p,(255,255,255))
a.show()
a.save('./Original_mask.png')