c# - Emgu CV Ram问题
问题描述
我有大约 100 张图像,所以我开始将它们一张一张地发送到ProcessImage
函数中。它一直使用如此多的 Ram,直到达到 5 GB 左右,然后我的程序崩溃如前所述:.SmoothGaussian
在当前图像中执行高斯平滑并返回结果。
请注意:我开始删除部分代码,直到达到 100% 的程度,我的 Ram 问题是由突出显示的代码行引起的!我也在使用 Emgu CV 3.4.3 版
我尝试输入两者:temp.Dispose();
并temp=null();
在声明后但没有工作!
using Emgu.CV;
using Emgu.CV.Structure;
using Emgu.CV.Util;
private void OpenFolder_Click(object sender, EventArgs e)
{
OpenFileDialog open = new OpenFileDialog();
open.Multiselect = true;
if (open.ShowDialog() == DialogResult.OK)
{
for (int i = 0; i < open.FileNames.Count(); i++)
{
using (Image<Bgr, byte> ToProcess = new Image<Bgr,byte> (open.FileNames[i]))
{
ProcessImage(ToProcess, i);
}
}
}
}
处理图像功能:
private void ProcessImage (Image<Bgr, byte> imgInput, int counter)
{
//This line of code causes the problem!
var temp = imgInput.SmoothGaussian(5);
}
解决方案
推荐阅读
- shiny-reactivity - 根据闪亮的输入更新表列中的值
- css - 当我在 Chrome 和 IE 上打印时如何修复和重复每个页面底部的内容
- javascript - axios.post 未从服务器返回数据:“无法解构‘(中间值)’的属性‘数据’,因为它未定义”
- ubuntu - 代理密钥 RSA SHA256:返回的签名类型不正确
- kubernetes - 设置 gitlab 初始 root 密码 - Gitlab Helm 图表
- c++ - 从 a_func(A a_in) 转换为 b_func(B b_in) (c++) 的函数
- mysql - 使用 mysqldump 进行一致的 InnoDB 转储
- python - iterrows() 循环只读取最后一个值,只修改第一行
- javascript - 为什么 JavaScript "window.postMessage" 会创建重复的消息?
- python - cv2.imshow() 函数在 BGR 模型中如何工作?