未验证 提交 aaaa175b 编写于 作者: E Erwin Junge 提交者: GitHub

[mypy] annotate `computer_vision` (#5571)

上级 00a67010
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册