我正在使用Emgucv库做一个项目,他的问题如下,
在此之后,我复制空白图像中绘制的项目,现在我想在新图像中找到轮廓,但是结果总是很糟糕,为什么呢?
提前感谢
发布于 2013-02-02 15:46:37
更多的信息将是很好的。
但是,为了能够找到轮廓,必须将新图像转换为像ff:(假设newImage是图像类型)这样的二值图像。
Image<Gray,byte> binaryImage = newImage.ThresholdBinary(new Gray(1), new Gray(255));要检测等高线并写入resultImage:
for (var contour = binaryImage.FindContours(
CHAIN_APPROX_METHOD.CV_CHAIN_APPROX_SIMPLE,
RETR_TYPE.CV_RETR_CCOMP);
contour != null;
contour = contour.HNext)
{
resultImage.Draw(contour, new Gray(255), -1);
}https://stackoverflow.com/questions/14388797
复制相似问题