class IKMAP: def __init__(self, _inscope, _timeout=1.0): self.inscope = _inscope.strip() self.mw = r.ROSConnector(self.inscope) self.io = OpencvIo() self.run = True self.timeout = float(_timeout) def get_saliency_map(self): while self.run: try: i = self.mw.last_image.get(False) if i is not None: print type(i) sm = SaliencyMap(i) self.io.imshow_array([sm.map], "ROS Input Image") except Exception, e: print e time.sleep(self.timeout) self.mw.run = False print "Exiting."
def __init__(self, _inscope, _timeout=1.0): self.inscope = _inscope.strip() self.mw = r.ROSConnector(self.inscope) self.io = OpencvIo() self.run = True self.timeout = float(_timeout)