Reputation: 574
I just started to learn Emgu and OpenCV. So it might be a stupid question. When I look at Emgu documentation (see link http://www.emgu.com/wiki/files/3.1.0/document/html/cb24a129-d9ce-57f3-19ad-0eaa27a77317.htm ), I cannot find an example. But I suppose you used it in the form of
CvInvoke.FindContours(...)
But when I searched stackoverflow, I found this person just used the following form in the middle-bottom section of his code enter link description here
grayImage.FindContours()
However, when I tried the later, Visual studio simply doesn't accept it. (ie, when I typed in grayImage.F the pop up simply doesn't have FindContours function).
I am using the latest opencv and emgu. Any ideas?
Upvotes: 1
Views: 6471
Reputation: 215
You are using the latest version.
If you have a quick look in the docs of the versions 2.4 , 3.1 you can see, that the function FindContours() has been removed from the Image Class but is still part of the CvInvoke Class.
If you insist on having the seen syntax you can add your own Extension:
public static class Extension
{
public static VectorOfVectorOfPointF FindContour(this UMat img,Mat hierarchy = null, Emgu.CV.CvEnum.RetrType type = Emgu.CV.CvEnum.RetrType.List,Emgu.CV.CvEnum.ChainApproxMethod method = Emgu.CV.CvEnum.ChainApproxMethod.ChainApproxSimple )
{
VectorOfVectorOfPointF contours = new VectorOfVectorOfPointF();
CvInvoke.FindContours(img, contours, hierarchy, type, method);
return contours;
}
}
this is just a sample extension in c# ..
Upvotes: 3