Skip to content

Commit 26b41e4

Browse files
author
Kristof Denolf
committed
fix pyrUp test
1 parent 825af12 commit 26b41e4

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

applicationCode/unitTests/testPython/testXfPyrUp.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,24 @@
5252

5353
print("Loading image ../images/bigBunny_1080.png")
5454
img = cv2.imread('../images/bigBunny_1080.png')
55-
imgY = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
55+
imgYtmp = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
5656

57+
# downscale before pyrUp
58+
height, width, channels = img.shape
59+
imgY = cv2.resize(imgYtmp, (width//2,height//2))
60+
61+
height, width = imgY.shape
5762
print("Size of imgY is ",imgY.shape);
58-
height, width, channels = img.shape
5963

6064
numberOfIterations=10
6165
print("Number of loop iterations: "+str(numberOfIterations))
6266

63-
height_2 = (height*2)
64-
width_2 = (width*2)
65-
66-
dstSW = np.ones((height_2,width_2),np.uint8);
67+
dstSW = np.ones((height*2,width*2),np.uint8);
6768

6869
xFimgY = mem_manager.cma_array((height,width),np.uint8) #allocated physically contiguous numpy array
6970
xFimgY[:] = imgY[:] # copy source data
7071

71-
xFdst = mem_manager.cma_array((height_2,width_2),np.uint8) #allocated physically contiguous numpy array
72+
xFdst = mem_manager.cma_array((height*2,width*2),np.uint8) #allocated physically contiguous numpy array
7273

7374
print("Start SW loop")
7475
startSW=time.time()

0 commit comments

Comments
 (0)