--- /dev/null
+# Configuration of the image library (included by cf/sherlock)
+
+######## General parameters #####################################################
+
+Images {
+}
+
+######## Image signatures #######################################################
+
+ImageSig {
+
+MinWidth 16
+MinHeight 16
+
+}
+
+######## Duplicates finder ######################################################
+
+ImageDup {
+}
+
PROGS+=$(addprefix $(o)/images/,image-tool image-dup-test image-sim-test)
-LIBIMAGES_MODS=image scale color alpha io-main dup-init dup-cmp sig-dump sig-init sig-cmp object
+LIBIMAGES_MODS=config image scale color alpha io-main dup-init dup-cmp sig-dump sig-init sig-cmp object
LIBIMAGES_LIBS=-lm
--- /dev/null
+/*
+ * Image Library -- Configuration
+ *
+ * (c) 2006 Pavel Charvat <pchar@ucw.cz>
+ */
+
+#undef LOCAL_DEBUG
+
+#include "lib/lib.h"
+#include "lib/conf.h"
+#include "images/images.h"
+#include "images/signature.h"
+
+#include <string.h>
+
+uns image_sig_min_width;
+uns image_sig_min_height;
+
+static struct cf_section sig_config = {
+ CF_ITEMS{
+ CF_UNS("MinWidth", &image_sig_min_width),
+ CF_UNS("MinHeight", &image_sig_min_height),
+ CF_END
+ }
+};
+
+static void CONSTRUCTOR
+images_init_config(void)
+{
+ cf_declare_section("ImageSig", &sig_config, 0);
+}
int
compute_image_signature(struct image_thread *thread, struct image_signature *sig, struct image *image)
{
+ bzero(sig, sizeof(*sig));
uns cols = image->cols;
uns rows = image->rows;
sig->vec.f[4] = hl_sum / blocks_count;
sig->vec.f[5] = hh_sum / blocks_count;
+ if (cols < image_sig_min_width || rows < image_sig_min_height)
+ return 1;
+
/* Quantize blocks to image regions */
struct region regions[IMAGE_REG_MAX];
sig->len = compute_k_means(blocks, blocks_count, regions, MIN(blocks_count, IMAGE_REG_MAX));
#ifndef _IMAGES_SIGNATURE_H
#define _IMAGES_SIGNATURE_H
+/* Configuration */
+extern uns image_sig_min_width, image_sig_min_height;
+
#define IMAGE_VEC_F 6
#define IMAGE_REG_F IMAGE_VEC_F
#define IMAGE_REG_H 3