【发布时间】:2020-05-27 15:56:41
【问题描述】:
我有这张图片:
我尝试做的是检测它的轮廓。因此,通过查看网络上的文档和一些代码,我做了这个:
Image<Gray, byte> image = receivedImage.Convert<Gray, byte>().ThresholdBinary(new Gray(80), new Gray(255));
Emgu.CV.Util.VectorOfVectorOfPoint contours = new Emgu.CV.Util.VectorOfVectorOfPoint();
Mat hier = new Mat();
CvInvoke.FindContours(image, contours, hier, Emgu.CV.CvEnum.RetrType.External, Emgu.CV.CvEnum.ChainApproxMethod.ChainApproxSimple);
CvInvoke.DrawContours(receivedImage, contours, 0, new MCvScalar(255, 0, 0), 2);
然后它用蓝色检测这个轮廓:
现在我想检测不同轮廓的两个矩形。所以结果是这样的:
(用油漆制成)所以现在我想分别检测两个矩形(蓝色和红色矩形将是两个不同的轮廓)。但我不知道该怎么做!
提前感谢您的帮助! ;)
【问题讨论】:
标签: c# emgucv detection contour