Skip to content

Commit

Permalink
in void line_fit, fixed sumx2 by correctly removing 1*1 +2*2 etc unti…
Browse files Browse the repository at this point in the history
…l and including (border-1)*(border-1)
  • Loading branch information
TitusBraber committed Mar 23, 2017
1 parent a75b2e8 commit db6548e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sw/airborne/modules/computer_vision/lib/vision/edge_flow.c
Expand Up @@ -268,7 +268,7 @@ void line_fit(int32_t *displacement, int32_t *divergence, int32_t *flow, uint32_
// compute fixed sums
int32_t xend = size_int - border_int - 1;
sumX = xend * (xend + 1) / 2 - border_int * (border_int + 1) / 2 + border_int;
sumX2 = xend * (xend + 1) * (2 * xend + 1) / 6;
sumX2 = xend * (xend + 1) * (2 * xend + 1) / 6 - border_int * (border_int + 1) * (2 * border_int + 1) / 6 + border_int*border_int;
xMean = (size_int - 1) / 2;
count = size_int - 2 * border_int;

Expand Down

0 comments on commit db6548e

Please sign in to comment.