[SubImage]

- handle different image shapes
This commit is contained in:
2026-01-11 11:21:42 +01:00
parent 3f4cdc277f
commit 92afc16137
2 changed files with 11 additions and 8 deletions
+4 -5
View File
@@ -7,13 +7,12 @@ if __name__ == "__main__":
c = 3
w = 8
h = 8
img = np.reshape(np.linspace(1, n*c*w*h, num=n*c*w*h, dtype=np.float64), (n, c, w, h))
# print(img)
img_rbb = np.reshape(np.linspace(1, n*c*w*h, num=n*c*w*h, dtype=np.float64), (n, c, w, h))
sub = SubImage(4, 4, 1, 1)
sub(img_rbb, 3)
images = sub(img)
print(images)
img_gray = np.reshape(np.linspace(1, n*w*h, num=n*w*h, dtype=np.float64), (n, w, h))
sub(img_gray, 1)
print("Test: [passed]")