开发环境
VS2022 win7 halcon12 halcon18
随机生成100个园
不释放
private void butTemp_Click(object sender, EventArgs e)
{
butTemp.Enabled = false;
HOperatorSet.SetSystem("clip_region", "false");
{
HObject ho_regions;
HOperatorSet.GenRandomRegions(out ho_regions, "circle", 10, 20, 10, 30, -0.7854, 0.7854, 1000*1000, 5210, 5210);
int iObjNum = WHCSHalCon.Base.CountObj(ho_regions);
// regions.Dispose();
}
butTemp.Enabled = true;
}
内存大约增加900M。
释放
private void butTemp_Click(object sender, EventArgs e)
{
butTemp.Enabled = false;
HOperatorSet.SetSystem("clip_region", "false");
{
HObject ho_regions;
HOperatorSet.GenRandomRegions(out ho_regions, "circle", 10, 20, 10, 30, -0.7854, 0.7854, 1000*1000, 5210, 5210);
ho_regions.Dispose();
}
butTemp.Enabled = true;
}
似乎没效果,内存还是增加了900M。
不裁剪,宽高限定为521
private void butTemp_Click(object sender, EventArgs e)
{
butTemp.Enabled = false;
//HOperatorSet.SetSystem("clip_region", "false");
{
HObject ho_regions;
HOperatorSet.GenRandomRegions(out ho_regions, "circle", 10, 20, 10, 30, -0.7854, 0.7854, 1000*1000, 521, 521);
ho_regions.Dispose();
}
butTemp.Enabled = true;
}
似乎没效果,内存还是增加了900M。文章来源:https://www.toymoban.com/news/detail-690047.html
宽高限定为512
除生成的区域数量外,全部用halcon样例的默认值。
似乎没效果,内存还是增加了900M。文章来源地址https://www.toymoban.com/news/detail-690047.html
到了这里,关于HOperatorSet.GenRandomRegions 有内存泄漏或缓存,释放不掉的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!