我怎样才能释放cvHaarDetectObjects的内存?

时间:2013-05-19 03:07:01

标签: c++ opencv

CvSeq* objects = cvHaarDetectObjects(
      &image,
      this->cascade,
      this->storage,
      scale,  // scale : Scale 1.3 means the next round scan will scale 30% bigger.
      2,      // neigbors : If objects less than 2-1, then the whole detection is invalid.
      0,      // flags : The only valid flag is 0 for now, means don't check the edges.
      cvSize(20, 20)  // min_size : The minium size of object.
    );

我使用OpenCV进行对象检测,但我找不到任何界面来释放对象'存储器中。

1 个答案:

答案 0 :(得分:1)

发布级联:

cvReleaseHaarClassifierCascade( &cascade );

发布memstorage:

cvReleaseMemStorage( &storage );

(所有这些都是使用c ++ api的一个很好的理由,不是吗?)