def __call__(self, inputs, context): template = context.memory[self.roi] (spotted, topleft, precision) = templatesearch(inputs.data, template) if precision < self.precision: print precision raise failure() return percept(spotted, topleft, inputs)
def main(): image = bayer('keyboard_seen.png') template = bayer('2.png') print templatesearch(image, template)