Back to Ccv

lib/ccv_dpm.c

site/0.6/lib/ccv-dpm/index.html

latest4.0 KB
Original Source

lib/ccv_dpm.c

ccv_dpm_mixture_model_new

void ccv_dpm_mixture_model_new(char **posfiles, ccv_rect_t* bboxes, int posnum, char** bgfiles, int bgnum, int negnum, const char* dir, ccv_dpm_new_param_t params)

Create a new DPM mixture model from given positive examples and background images. This function has hard dependencies on GSL and LibLinear.

  • posfiles : an array of positive images.
  • bboxes : an array of bounding boxes for positive images.
  • posnum : number of positive examples.
  • bgfiles : an array of background images.
  • bgnum : number of background images.
  • negnum : number of negative examples that is harvested from background images.
  • dir : the working directory to store/retrieve intermediate data.
  • params : a ccv_dpm_new_param_t structure that defines various aspects of the training function.

ccv_dpm_new_param_t

  • components : the number of root filters in the mixture model.
  • parts : the number of part filters for each root filter.
  • grayscale : whether to exploit color in a given image.
  • symmetric : whether to exploit symmetric property of the object.
  • min_area : the minimum area that one part classifier can occupy.
  • max_area : the maximum area that one part classifier can occupy.
  • iterations : how many iterations needed for stochastic gradient descent.
  • data_minings : how many data mining procedures are needed for discovering hard examples.
  • relabels : how many relabel procedures are needed.
  • negative_cache_size : the cache size for negative examples.
  • include_overlap : the percentage of overlap between expected bounding box and the bounding box from detection. Beyond this threshold, it is ensured to be the same object.
  • alpha : the step size for stochastic gradient descent.
  • alpha_ratio : decrease the step size for each iteration.
  • balance : to balance the weight of positive examples and negative examples.
  • C : C in SVM.
  • percentile_breakdown : the percentile use for breakdown threshold.
  • detector : a ccv_dpm_params_t structure that will be used to search positive examples and negative examples from background images.

ccv_dpm_detect_objects

ccv_array_t* ccv_dpm_detect_objects(ccv_dense_matrix_t* a, ccv_dpm_mixture_model_t** _model, int count, ccv_dpm_param_t params)

Using a DPM mixture model to detect objects in a given image. If you have several DPM mixture models, it is better to use them in one method call. In this way, ccv will try to optimize the overall performance.

  • a : the input image.
  • model : an array of mixture models.
  • count : how many mixture models you’ve passed in.
  • params : a ccv_dpm_param_t structure that defines various aspects of the detector.

ccv_dpm_param_t

  • interval : interval images between the full size image and the half size one. e.g. 2 will generate 2 images in between full size image and half size one: image with full size, image with 5/6 size, image with 2/3 size, image with 1/2 size.
  • min_neighbors : 0: no grouping afterwards. 1: group objects that intersects each other. > 1: group objects that intersects each other, and only passes these that have at least min_neighbors intersected objects.
  • flags : CCV_DPM_NO_NESTED, if one class of object is inside another class of object, this flag will reject the first object.
  • threshold : the threshold the determines the acceptance of an object.

ccv_dpm_read_mixture_model

ccv_dpm_mixture_model_t* ccv_dpm_read_mixture_model(const char* directory)

Read DPM mixture model from a model file.

  • directory : the model file for DPM mixture model.

ccv_dpm_mixture_model_free

void ccv_dpm_mixture_model_free(ccv_dpm_mixture_model_t* model)

Free up the memory of DPM mixture model.

  • model : the DPM mixture model.

‹ back

comments powered by Disqus