19 lines
389 B
Python
19 lines
389 B
Python
from image.sub_image import SubImage
|
|
from rbm.matrix import np
|
|
|
|
|
|
if __name__ == "__main__":
|
|
n = 2
|
|
c = 3
|
|
w = 8
|
|
h = 8
|
|
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)
|
|
|
|
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]")
|