在emgucv 3.1中绘制轮廓

时间:2016-12-28 12:08:39

标签: c# opencv emgucv

我也希望在EmguCV 3.1.0.2504中绘制一个轮廓,但是我得到错误:“OpenCV:i< 0。无法评估.Children。”

IInputArrayOfArrays biggestCnt = GetBiggestCountour(BinaryImage);
Image<Gray, byte> justCountor = new Image<Gray, byte>(384, 284, new Gray(255));
CvInvoke.DrawContours(justCountor, biggestCnt, -1, new MCvScalar(255, 0, 0));

enter image description here

1 个答案:

答案 0 :(得分:1)

我更改了一行:

CvInvoke.DrawContours(justCountor, biggestCnt, -1, new MCvScalar(255, 0, 0));

 justCountor.Draw(biggestCnt.ToArray(), new Gray(0), 1);

问题解决了。