#undef LOCAL_DEBUG
-#include "lib/lib.h"
-#include "images/images.h"
-#include "images/signature.h"
-#include "images/math.h"
+#include <ucw/lib.h>
+#include <images/images.h>
+#include <images/signature.h>
+#include <images/math.h>
#include <string.h>
DBG("Zero textured threshold.");
return;
}
-
+
uns cols = data->cols;
uns rows = data->rows;
uns cell_cols = MIN((cols + 1) / 2, MAX_CELLS_COLS);
}
DBG("Detecting textured image... cols=%u rows=%u cell_cols=%u cell_rows=%u", cols, rows, cell_cols, cell_rows);
-
+
/* Compute cells boundaries */
for (i = 1, j = 0; i < cell_cols; i++)
cell_x[i] = fast_div_u32_u8(j += cols, cell_cols);
for (uns i = 0; i < data->regions_count; i++)
for (struct image_sig_block *block = data->regions[i].blocks; block; block = block->next)
block->region = i;
-
+
/* Process cells */
double e = 0;
for (uns j = 0; j < cell_rows; j++)
}
for (uns k = 0; k < data->regions_count; k++)
{
- int a = data->blocks_count * cnt[k] - cell_area * data->regions[k].count;
+ int a = data->blocks_count * cnt[k] - cell_area * data->regions[k].count;
e += (double)a * a / ((double)isqr(data->regions[k].count) * cell_area);
}
}