开发环境
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。
宽高限定为512
除生成的区域数量外,全部用halcon样例的默认值。
似乎没效果,内存还是增加了900M。