def set_circular_observation(self, img, col_center, row_center, radius, color=(0,0,0)):
rr,cc = circle(row_center, col_center, radius)
# make sure within bounds of img
rr[rr<0] = 0
rr[rr>img.shape[0]-1] = img.shape[0]-1
cc[cc<0] = 0
cc[cc>img.shape[1]-1] = img.shape[1]-1
img[rr,cc] = color
return img
评论列表
文章目录