Esempio n. 1
0
void add(TREE2,int x,double v){
 M;
 ++tot;
 o1[tot] = o1[_t];o2[tot] = o2[_t];sgt[tot] = sgt[_t];
 _t = tot;
 if(_l == _r) {
        sgt[_t].s[1] += v/double(x),sgt[_t].s[2] += v; 
 return;}
 if(x <= mid) add(LEFT,x,v);else add(RIGHT,x,v);
 sgt[_t] = sgt[LCH(_t)] + sgt[RCH(_t)];
}
Esempio n. 2
0
void Extraction(char *img_path, char *fv_path)
{
  CImage *cimg=NULL;
  Image *mask=NULL;
  Histogram *lch=NULL;

  cimg = ReadCImage(img_path);
  mask = CreateImage(cimg->C[0]->ncols, cimg->C[0]->nrows);

  lch = LCH(cimg, mask);

  WriteFileHistogram(lch,fv_path);
  DestroyHistogram(&lch);
  DestroyCImage(&cimg);
  DestroyImage(&mask);

}