Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

your result from resize() is entirely correct.

to resize from 4 elements to 2 vertically, linear interpolation is applied (INTER_LINEAR is the default flag), so,

 10 = ( 0 + 20) / 2
 50 = (40 + 60) / 2

your result from resize() is entirely correct.

to resize from 4 elements to 2 vertically, linear interpolation is applied (INTER_LINEAR is the default flag), so,

 10 = (  0 + 20) (20 -  0) / 2
 50 = (40 40 + 60) (60 - 40) / 2

your result from resize() is entirely correct.

to resize from 4 elements to 2 vertically, linear interpolation is applied (INTER_LINEAR is the default flag), so,

 10 =  0 + (20 -  0) / 2
 50 = 40 + (60 - 40) / 2

can it be, you wanted to reshape it from 4x1 to 2x2 ?

z = z.reshape(1,2);
[0, 20;
 40, 60]