问题
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
回答1:
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);
}
回答2:
I have submitted a bug report with OpenCV. Now just wait and see ...
来源:https://stackoverflow.com/questions/18765406/opencv-2-4-6-sift-keypoints-detection-using-a-lot-of-memory