From aaaa175b66f2b335023433a3c40635388b98c489 Mon Sep 17 00:00:00 2001 From: Erwin Junge Date: Sat, 23 Oct 2021 23:26:21 +0200 Subject: [PATCH] [mypy] annotate `computer_vision` (#5571) --- computer_vision/harris_corner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/computer_vision/harris_corner.py b/computer_vision/harris_corner.py index fb7f560f7..02deb5408 100644 --- a/computer_vision/harris_corner.py +++ b/computer_vision/harris_corner.py @@ -21,11 +21,11 @@ class Harris_Corner: else: raise ValueError("invalid k value") - def __str__(self): + def __str__(self) -> str: return f"Harris Corner detection with k : {self.k}" - def detect(self, img_path: str): + def detect(self, img_path: str) -> tuple[cv2.Mat, list[list[int]]]: """ Returns the image with corners identified @@ -35,7 +35,7 @@ class Harris_Corner: img = cv2.imread(img_path, 0) h, w = img.shape - corner_list = [] + corner_list: list[list[int]] = [] color_img = img.copy() color_img = cv2.cvtColor(color_img, cv2.COLOR_GRAY2RGB) dy, dx = np.gradient(img)