From 8fac08e29e5d7452238784c70aa429dc5041848c Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Fri, 10 Jun 2016 00:14:41 +0200 Subject: [PATCH] Fix integral_image_sq bug in calculating first row. --- src/omv/img/integral.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/omv/img/integral.c b/src/omv/img/integral.c index 1ecc275dd..124af09c7 100644 --- a/src/omv/img/integral.c +++ b/src/omv/img/integral.c @@ -84,8 +84,8 @@ void imlib_integral_image_sq(image_t *src, i_image_t *sum) // Compute first column to avoid branching for (int s=0, x=0; xw; x++) { /* sum of the current row (integer) */ - s += img_data[src->w+x] * img_data[src->w+x]; - sum_data[src->w+x] = s; + s += img_data[x] * img_data[x]; + sum_data[x] = s; } for (int y=1; yh; y++) {