The Image array
[[2, 2, 2, 2],
[2, 3, 3, 3],
[2, 4, 4, 4],
[5, 5, 5, 5]]
h = 4, w = 4
use cv2.resize(img,(h//2,w//2))
, the result is
[[2, 3],
[4, 5]]
The reduction factor is 2, when I calculate manually,
newImage(0,0) -> oldImage(2*0,2*0) = oldImage(0,0) = 2
newImage(0,1) -> oldImage(2*0,2*1) = oldImage(0,2) = 2
newImage(1,0) -> oldImage(2*1,2*0) = oldImage(2,0) = 2
newImage(1,1) -> oldImage(2*1,2*1) = oldImage(2,2) = 4
The result of my manual calculation should be:
[[2, 2],
[2, 4]]
I think my logic is not wrong ah, why would there be a difference with the opencv calculation it