How do you mark isolated keypoints without connecting them?
point writes a color at every listed coordinate and leaves positions between them untouched.
Pixel experiment and interpretation
Two landmarks sit three columns apart. A connecting line would invent supervision between them. A point map encodes positions; uncertainty needs a separate rule.
from PIL import Image, ImageDraw
im=Image.new('L',(5,1))
ImageDraw.Draw(im).point([(0,0),(3,0)],fill=1)
list(im.tobytes())Result [1, 0, 0, 1, 0]
中文
如何一次把离散关键点写进热图而不连接它们?
point 为列出的每个坐标写入颜色,中间位置保持原值。
像素实验与适用边界
两枚标记相隔三列,用直线连接会凭空增加监督信号。点图只表达位置,置信范围需要额外定义。
from PIL import Image, ImageDraw
im=Image.new('L',(5,1))
ImageDraw.Draw(im).point([(0,0),(3,0)],fill=1)
list(im.tobytes())结果 [1, 0, 0, 1, 0]