make perspecive transform arguments order more common

This commit is contained in:
homm 2016-06-02 23:47:45 +03:00
parent 2b77b1cec7
commit 3d622d60cf
2 changed files with 3 additions and 5 deletions

View File

@ -1881,9 +1881,7 @@ class Image(object):
elif method == PERSPECTIVE:
# change argument order to match implementation
data = (data[2], data[0], data[1],
data[5], data[3], data[4],
data[6], data[7])
data = data[0:8]
elif method == QUAD:
# quadrilateral warp. data specifies the four corners

View File

@ -264,8 +264,8 @@ perspective_transform(double* xin, double* yin, int x, int y, void* data)
double a3 = a[3]; double a4 = a[4]; double a5 = a[5];
double a6 = a[6]; double a7 = a[7];
xin[0] = (a0 + a1*x + a2*y) / (a6*x + a7*y + 1);
yin[0] = (a3 + a4*x + a5*y) / (a6*x + a7*y + 1);
xin[0] = (a0*x + a1*y + a2) / (a6*x + a7*y + 1);
yin[0] = (a3*x + a4*y + a5) / (a6*x + a7*y + 1);
return 1;
}