Skip to content

Commit aaaa175

Browse files
authored
[mypy] annotate computer_vision (#5571)
1 parent 00a6701 commit aaaa175

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

computer_vision/harris_corner.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ def __init__(self, k: float, window_size: int):
2121
else:
2222
raise ValueError("invalid k value")
2323

24-
def __str__(self):
24+
def __str__(self) -> str:
2525

2626
return f"Harris Corner detection with k : {self.k}"
2727

28-
def detect(self, img_path: str):
28+
def detect(self, img_path: str) -> tuple[cv2.Mat, list[list[int]]]:
2929

3030
"""
3131
Returns the image with corners identified
@@ -35,7 +35,7 @@ def detect(self, img_path: str):
3535

3636
img = cv2.imread(img_path, 0)
3737
h, w = img.shape
38-
corner_list = []
38+
corner_list: list[list[int]] = []
3939
color_img = img.copy()
4040
color_img = cv2.cvtColor(color_img, cv2.COLOR_GRAY2RGB)
4141
dy, dx = np.gradient(img)

0 commit comments

Comments
 (0)