def finalize(self): if len(self._pred) > 0: pred = MyMorph((self._grd.w, self._grd.h), 2).run(self._pred) cc = MyCC(self._cls.labels) cc.run(pred) self._bb = cc.get_bounding_box()
def get_bounding_box(self): cc = MyCC([0, 1]) cc.run(self._coarse) bb = cc.get_bounding_box() self._bb = bb return bb