예제 #1
0
파일: blink.cpp 프로젝트: chungbwc/PSmile
double MPBlink::findBlinks(const RImage<float> &pixels, VisualObject &faces,
                           float WINSHIFT, combine_mode mode){
  // First, find the faces
  static int lastimgWidth = 0, lastimgHeight = 0;
  if (pixels.width != lastimgWidth || pixels.height != lastimgHeight) {
    eyefinder.resetStream(pixels.width, pixels.height);
    lastimgWidth = pixels.width;
    lastimgHeight = pixels.height;
  }

  eyefinder.findEyes(pixels, faces, WINSHIFT, mode);
  if(!faces.size())
    return 0;
  get_eyes(pixels, faces);

  return 1;
}
예제 #2
0
int		init_scene(t_data *data, char *config_name)
{
  FILE		*fd;

  data->list = NULL;
  data->spot = NULL;
  data->option.first_aa = FIRST_ANTI_ALIASING;
  data->option.final_aa = ANTI_ALIASING;
  if ((fd = fopen(config_name, "r")) == NULL)
    return (error("Sorry, can't open the config\n"));
  if (get_eyes(&(data->scene.eyes), fd) == FAIL)
    return (error("Sorry, can't init eyes\n"));
  if (get_obj(fd, data) == FAIL)
    return (error("Sorry, can't init obj_list\n"));
  fclose(fd);
  if (check_list(data) == FAIL)
    return (FAIL);
  return (SUCCES);
}