def draw(self, image):
if len(self.tilesByOrder) == 0:
cv2.imshow("image", image)
for tile in self.tilesByOrder:
cv2.rectangle(image, (tile.wx, tile.wy), (tile.wx + tile.w, tile.wy + tile.h),
(0, 255, 0), 1)
#Left bezel
cv2.rectangle(image, (tile.wx - tile.l, tile.wy), (tile.wx, tile.wy + tile.h),
(40, 255, 40), -1)
#Top bezel
cv2.rectangle(image, (tile.wx - tile.l, tile.wy - tile.t), (tile.wx + tile.w, tile.wy),
(40, 255, 40), -1)
#Right bezel
cv2.rectangle(image, (tile.wx + tile.w, tile.wy - tile.t), (tile.wx + tile.w + tile.r, tile.wy + tile.h),
(40, 255, 40), -1)
#Bottom bezel
cv2.rectangle(image, (tile.wx - tile.l, tile.wy + tile.h), (tile.wx + tile.w + tile.r, tile.wy + tile.h + tile.b),
(40, 255, 40), -1)
cv2.imshow("image", image)
评论列表
文章目录