From 76d2be0fb19c756b219b9c46ba4fdbd86053e288 Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Sun, 27 Aug 2006 16:04:01 +0200 Subject: [PATCH] small fixes --- cf/images | 2 +- images/sig-init.c | 6 +++--- images/sig-txt.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cf/images b/cf/images index 9e533985..9d767e6f 100644 --- a/cf/images +++ b/cf/images @@ -12,7 +12,7 @@ ImageSig { MinWidth 16 MinHeight 16 -PreQuantThresholds 9 100 400 1000 2000 2000 4000 4000 4000 8000 8000 8000 10000 10000 10000 +PreQuantThresholds 9 100 400 1000 2000 2000 2000 4000 4000 4000 4000 8000 8000 8000 8000 PostQuantMinSteps 2 PostQuantMaxSteps 10 PostQuantThreshold 2 diff --git a/images/sig-init.c b/images/sig-init.c index 6c5e75e5..a5f738a0 100644 --- a/images/sig-init.c +++ b/images/sig-init.c @@ -158,9 +158,9 @@ image_sig_preprocess(struct image_sig_data *data) block->v[3] = fast_sqrt_u16(isqr(t[8]) + isqr(t[9]) + isqr(t[12]) + isqr(t[13])); block->v[4] = fast_sqrt_u16(isqr(t[2]) + isqr(t[3]) + isqr(t[6]) + isqr(t[7])); block->v[5] = fast_sqrt_u16(isqr(t[10]) + isqr(t[11]) + isqr(t[14]) + isqr(t[15])); - sum[3] += block->v[3] * block->area / 2; - sum[4] += block->v[4] * block->area / 2; - sum[5] += block->v[5] * block->area / 2; + sum[3] += block->v[3] * block->area; + sum[4] += block->v[4] * block->area; + sum[5] += block->v[5] * block->area; } } diff --git a/images/sig-txt.c b/images/sig-txt.c index 3673c118..4a79438d 100644 --- a/images/sig-txt.c +++ b/images/sig-txt.c @@ -24,8 +24,8 @@ image_sig_detect_textured(struct image_sig_data *data) { uns cols = data->cols; uns rows = data->rows; - uns cell_cols = MIN(cols, MAX_CELLS_COLS); - uns cell_rows = MIN(rows, MAX_CELLS_ROWS); + uns cell_cols = MIN((cols + 1) / 2, MAX_CELLS_COLS); + uns cell_rows = MIN((rows + 1) / 2, MAX_CELLS_ROWS); uns cell_x[MAX_CELLS_COLS + 1]; uns cell_y[MAX_CELLS_ROWS + 1]; uns i, j; -- 2.39.5