def plot_regions(self, fill=True, bgimage=None, alpha=0.5):
import pylab as pl
ax = pl.gca()
assert isinstance(ax, pl.Axes)
colors = i12.JET_12
self._plot_background(bgimage)
for label in self.regions:
color = colors[i12.LABELS.index(label)] / 255.
for region in self.regions[label]:
t = region['top']
l = self.facade_left + region['left']
b = region['bottom']
r = self.facade_left + region['right']
patch = pl.Rectangle((l, t), r - l, b - t, color=color, fill=fill, alpha=alpha)
ax.add_patch(patch)
评论列表
文章目录