OpenCV 2.4.6 SIFT KeyPoints Detection using a lot

2019-03-31 11:11发布

We were using SIFT in openCV 2.4.3 and we decided to upgrade to openCV 2.4.6. After the upgrade, the memory usage jumped from about (150MB) to 1.2GB in openCV 2.4.6.

Does someone knows if is this a bug or something that we need to configure now?

Our image has 1.4MB. This behavior was observed on iOS. The problem seems to be happening also in Linux (CentOs).

Tks

2条回答
Animai°情兽
2楼-- · 2019-03-31 11:42

I remember there was a bug in one of those versions regarding keypoint extraction. I saw it with ORB, so I don't know if it is the same problem here, but I tell you in case it can be of any help.

The problem was that the keypoint extractor didn't clear the output vectors before extracting new keypoints:

vector<cv::KeyPoint> keys;
cv::Mat descs;
cv::ORB orb;

for(...)
{
  orb(image, mask, keys, descs); // bug: keypoints were accumulated in "keys"
}

I had to patch it like this:

for(...)
{
  keys.clear();
  descs.release();
  orb(image, mask, keys, descs);
}
查看更多
3楼-- · 2019-03-31 11:50

I have submitted a bug report with OpenCV. Now just wait and see ...

查看更多
登录 后发表回答