Saturday, January 7, 2017

Draw a contour in emgucv 3.1

Leave a Comment

I want too draw a contour in EmguCV 3.1.0.2504 but I get error: "OpenCV: i<0 .Children could not be evaluated."

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 Answers

Answers 1

I change the line :

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

to

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

and problem solved.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment