uns image_sig_postquant_min_steps;
uns image_sig_postquant_max_steps;
uns image_sig_postquant_threshold;
+double image_sig_border_size;
+int image_sig_border_bonus;
double image_sig_textured_threshold;
uns image_sig_compare_method;
uns image_sig_cmp_features_weights[IMAGE_VEC_F + IMAGE_REG_H];
CF_UNS("PostQuantMinSteps", &image_sig_postquant_min_steps),
CF_UNS("PostQuantMaxSteps", &image_sig_postquant_max_steps),
CF_UNS("PostQuantThreshold", &image_sig_postquant_threshold),
+ CF_DOUBLE("BorderSize", &image_sig_border_size),
+ CF_INT("BorderBonus", &image_sig_border_bonus),
CF_DOUBLE("TexturedThreshold", &image_sig_textured_threshold),
CF_UNS("CompareMethod", &image_sig_compare_method),
CF_UNS_ARY("CompareFeaturesWeights", image_sig_cmp_features_weights, IMAGE_VEC_F + IMAGE_REG_H),
/* For each region */
u64 w_total = 0;
- uns w_border = (MIN(data->cols, data->rows) + 3) / 4;
- uns w_mul = 127 * 256 / w_border;
+ uns w_border = MIN(data->cols, data->rows) * image_sig_border_size;
+ int w_mul = image_sig_border_bonus * 256 / w_border;
for (uns i = 0; i < sig->len; i++)
{
struct image_sig_region *r = data->regions + i;
if (d >= w_border)
w_sum += 128;
else
- w_sum += 128 + (d - w_border) * w_mul / 256;
+ w_sum += 128 + (int)(w_border - d) * w_mul / 256;
}
w_total += w_sum;
r->w_sum = w_sum;
extern uns image_sig_min_width, image_sig_min_height;
extern uns *image_sig_prequant_thresholds;
extern uns image_sig_postquant_min_steps, image_sig_postquant_max_steps, image_sig_postquant_threshold;
+extern double image_sig_border_size;
+extern int image_sig_border_bonus;
extern double image_sig_textured_threshold;
extern uns image_sig_compare_method, image_sig_cmp_features_weights[];