test(blob_detector): blob_detector détecte un blob

This commit is contained in:
vohorgeez committed 2026-11-14 16:36:39 +01:00
1 parent 75911c8a49
commit 8f8518320b
1 file changed
+8 -8
+8 -8
View File
@@ -19,11 +19,11 @@ def test_file_does_not_exists(tmp_path):
with pytest.raises(FileNotFoundError): with pytest.raises(FileNotFoundError):
star_detector.reading_picture(tmp_path/"do_I_exist.txt") star_detector.reading_picture(tmp_path/"do_I_exist.txt")
@pytest.mark.skip(reason="A corriger : égalité stricte sur flottants, canall couleur incohérent, détour disque inutile") def test_blob_detector_actually_detects_a_blob():
def test_blob_detector_actually_detects_a_blob(tmp_path): tableau_image = np.zeros((64,64), dtype=np.uint8)
file = tmp_path / "image.jpg" cv2.circle(tableau_image, center=(23, 31), radius = 5, color= 255, thickness=-1)
tableau_image = np.full((64,64), 0, dtype=np.uint8) assertion = (star_detector.blob_detector(tableau_image) != [])
cv2.imwrite(str(file), tableau_image) for star in star_detector.blob_detector(tableau_image):
src = cv2.imread(file) if abs(star[0] - 23) > 0.001 or abs(star[1] - 31) > 0.001:
cv2.circle(src, center=(23, 31), radius = 5, color= (255, 255, 255), thickness=-1) assertion = False
assert star_detector.blob_detector(src) == [(23, 31)] assert assertion == True