bilinear-interpolation

OpenCV resize() result is wrong?

OpenCV resize() result is wrong? Question: Sample program that upscales 2×2 matrix to 5×5 using bilinear interpolation. Result that OpenCV produces has artifacts at the borders for such simple case. gy, gx = np.mgrid[0:2, 0:2] gx = np.float32(gx) print(gx) res = cv2.resize(gx,(5,5), fx=0, fy=0, interpolation=cv2.INTER_LINEAR) print(res) Output: [[ 0. 1.] [ 0. 1.]] [[ 0. …

Total answers: 3