Explorar el Código

some fixes about argument assert in get_similarity_transform

quarrying hace 4 años
padre
commit
9de22b38dc
Se han modificado 1 ficheros con 2 adiciones y 4 borrados
  1. 2 4
      khandy/image/align_and_crop.py

+ 2 - 4
khandy/image/align_and_crop.py

@@ -19,10 +19,8 @@ def get_similarity_transform(src_pts, dst_pts):
     """
     src_pts = np.asarray(src_pts)
     dst_pts = np.asarray(dst_pts)
-    assert src_pts.ndim == 2
-    assert dst_pts.ndim == 2
-    assert src_pts.shape[-1] == 2
-    assert dst_pts.shape[-1] == 2
+    assert src_pts.shape == dst_pts.shape
+    assert (src_pts.ndim == 2) and (src_pts.shape[-1] == 2)
     
     npts = src_pts.shape[0]
     A = np.empty((npts * 2, 4))