Exemplo n.º 1
0
    def compute_center(self, algorithm, params):
        """
        """
        for k, v in params.items():
            self.parameters[k] = v

        if algorithm == 'pin':
            return Algorithm.compute_center_pin(self.image_, self.parameters)
        elif algorithm == 'slit':
            return Algorithm.compute_center_slit(self.image_, self.parameters)
        elif algorithm == 'show':
            cv2.imshow("Window-1", self.original)
            cv2.waitKey(0)
        else:
            sys.stderr.write("Invalid algorithm " + algorithm)
            sys.exit(1)