Ejemplo n.º 1
0
double Distance(char *fv1_path, char *fv2_path)
{
  Histogram *lch1=NULL;
  Histogram *lch2=NULL;
  double distance;

  lch1 = ReadFileHistogram(fv1_path);
  lch2 = ReadFileHistogram(fv2_path);

  distance= (double) L1Distance(lch1, lch2);

  DestroyHistogram(&lch1);
  DestroyHistogram(&lch2);

  return distance;
}
Ejemplo n.º 2
0
double Distance(char *fv1_path, char *fv2_path)
{
  Histogram *bic1=NULL;
  Histogram *bic2=NULL;
  double distance;

  bic1 = ReadFileHistogram(fv1_path);
  bic2 = ReadFileHistogram(fv2_path);

  distance = (double) L1Distance(bic1, bic2);

  DestroyHistogram(&bic1);
  DestroyHistogram(&bic2);

  return distance;
}
Ejemplo n.º 3
0
int main(int argc, char** argv)
{
  Histogram *acc1=NULL;
  Histogram *acc2=NULL;
  ulong distance;

  if (argc != 3) {
    fprintf(stderr,"usage: acc_distance <fv1_path> <fv2_path>\n");
    exit(-1);
  }

  acc1 = ReadFileHistogram(argv[1]);
  acc2 = ReadFileHistogram(argv[2]);

  distance=L1Distance(acc1, acc2);
  printf("%ld\n",distance);

  DestroyHistogram(&acc1);
  DestroyHistogram(&acc2);

  return(0);
}
Ejemplo n.º 4
0
int main(int argc, char** argv)
{
  Histogram *ccv1=NULL;
  Histogram *ccv2=NULL;
  double distance;

  if (argc != 3) {
    fprintf(stderr,"usage: ccv_distance fv1_path fv2_path\n");
    exit(-1);
  }

  ccv1 = ReadFileHistogram(argv[1]);
  ccv2 = ReadFileHistogram(argv[2]);

  distance=(double)L1Distance(ccv1, ccv2);
  printf("%lf\n",distance);

  DestroyHistogram(&ccv1);
  DestroyHistogram(&ccv2);

  return(0);
}
Ejemplo n.º 5
0
void* LoadFV(char* fv_path) {
    return (void*) ReadFileHistogram(fv_path);
}