chg: [style] !minor reformat

This commit is contained in:
Cédric Bonhomme 2021-11-24 13:38:04 +01:00
parent b6c8cc3d35
commit d7ea51eed7
No known key found for this signature in database
GPG key ID: A1CB94DE57B7A70D
2 changed files with 7 additions and 4 deletions

View file

@ -230,7 +230,10 @@ def LFSR(m: int) -> Iterator[int]:
def shi_tomashi( def shi_tomashi(
image_path: str, max_corners: int = 100, quality: float = 0.01, min_distance: float = 10.0 image_path: str,
max_corners: int = 100,
quality: float = 0.01,
min_distance: float = 10.0,
) -> Iterator[int]: ) -> Iterator[int]:
"""Shi-Tomachi corner generator of the given points """Shi-Tomachi corner generator of the given points
https://docs.opencv.org/4.x/d4/d8c/tutorial_py_shi_tomasi.html https://docs.opencv.org/4.x/d4/d8c/tutorial_py_shi_tomasi.html
@ -238,7 +241,8 @@ def shi_tomashi(
image = cv2.imread(image_path) image = cv2.imread(image_path)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
corners: np.signedinteger[Any] = cv2.goodFeaturesToTrack( corners: np.signedinteger[Any] = cv2.goodFeaturesToTrack(
gray, max_corners, quality, min_distance) gray, max_corners, quality, min_distance
)
corners = np.int0(corners) corners = np.int0(corners)
i = 0 i = 0
while True: while True:

View file

@ -177,8 +177,7 @@ class TestGenerators(unittest.TestCase):
int(test_file.shape[0]), int(test_file.shape[1]) int(test_file.shape[0]), int(test_file.shape[1])
) )
self.assertIsNone( self.assertIsNone(
np.testing.assert_allclose( np.testing.assert_allclose(corners, test_file_reshaped, rtol=1e-0, atol=0)
corners, test_file_reshaped, verbose=True, rtol=1e-0, atol=0)
) )
@staticmethod @staticmethod