我正在尝试从视频的帧中制作训练数据集。
对于每个新帧,我都会找到特征向量(大小为3300X1
)并与旧特征向量连接以制作训练数据集。但是在阅读了 2000 帧之后,我得到了低于指定的错误。
我在第二行的下面提到的代码中遇到错误,即
cv::Mat frameFV = getFeatureVectorFromGivenImage(curFrame, width, height);
cv::hconcat(trainingDataPerEmotion, frameFV, trainingDataPerEmotion);
在出现错误时,大小cv::Mat trainingDataPerEmotion
为3300X2000(nearly)
我正在使用发布旧视频
cvReleaseCapture(&capture);
在处理新视频之前。错误是
OpenCV Error: Insufficient memory (Failed to allocate 3686404 bytes) in OutOfMemoryError, file /home/naresh/OpenCV-2.4.0/modules/core/src/alloc.cpp, line 52
terminate called after throwing an instance of 'cv::Exception'
what(): /home/mario/OpenCV-2.4.0/modules/core/src/alloc.cpp:52: error: (-4) Failed to allocate 3686404 bytes in function OutOfMemoryError
任何人都可以建议我如何解决这个问题,我必须保存大量的训练数据来训练我的系统。
谢谢你。