1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Removed redundant calculations

Operations inside for loops are unnecessary. They are repeated anyway just below for loops
This commit is contained in:
Kotrix
2016-12-04 20:28:56 +01:00
committed by GitHub
parent c48d7f86ba
commit 10ccd0328c
+1 -11
View File
@@ -1265,8 +1265,6 @@ getRTMatrix( const Point2f* a, const Point2f* b,
sa[1][1] += a[i].y*a[i].y;
sa[1][2] += a[i].y;
sa[2][2] += 1;
sb[0] += a[i].x*b[i].x;
sb[1] += a[i].y*b[i].x;
sb[2] += b[i].x;
@@ -1281,7 +1279,7 @@ getRTMatrix( const Point2f* a, const Point2f* b,
sa[3][3] = sa[0][0];
sa[4][4] = sa[1][1];
sa[5][5] = sa[2][2];
sa[5][5] = sa[2][2] = count;
solve( A, B, MM, DECOMP_EIG );
}
@@ -1297,14 +1295,6 @@ getRTMatrix( const Point2f* a, const Point2f* b,
sa[0][2] += a[i].x;
sa[0][3] += a[i].y;
sa[2][1] += -a[i].y;
sa[2][2] += 1;
sa[3][0] += a[i].y;
sa[3][1] += a[i].x;
sa[3][3] += 1;
sb[0] += a[i].x*b[i].x + a[i].y*b[i].y;
sb[1] += a[i].x*b[i].y - a[i].y*b[i].x;
sb[2] += b[i].x;