ECC patch by the author (G. Evangelidis); fixed some OCL Farneback optical flow test failures on Mac

This commit is contained in:
Vadim Pisarevsky
2014-08-08 22:33:40 +04:00
parent 99eed2d885
commit 0224a20ff6
2 changed files with 16 additions and 7 deletions

View File

@@ -297,7 +297,12 @@ static void update_warping_matrix_ECC (Mat& map_matrix, const Mat& update, const
mapPtr[5] += updatePtr[7];
}
if (motionType == MOTION_EUCLIDEAN) {
double new_theta = acos(mapPtr[0]) + updatePtr[0];
double new_theta = updatePtr[0];
if (mapPtr[3]>0)
new_theta += acos(mapPtr[0]);
if (mapPtr[3]<0)
new_theta -= acos(mapPtr[0]);
mapPtr[2] += updatePtr[1];
mapPtr[5] += updatePtr[2];