【发布时间】:2015-05-10 02:21:39
【问题描述】:
我想像下面这样计算圆线粗细:
哪种方法可以帮助我做到这一点?
感谢您的回复大卫。我是emgucv的新手。所以我不知道从哪里开始。我可以使用精明的边缘做下面的图像。但我无法计算距离,因为我不知道我会使用什么代码。我可以使用哪个代码?
private void button1_Click(object sender, EventArgs e)
{
string strFileName = string.Empty;
OpenFileDialog ofd = new OpenFileDialog();
if (ofd.ShowDialog() == DialogResult.OK)
{
//Load image
Image<Bgr, Byte> img1 = new Image<Bgr, Byte>(ofd.FileName);
//Convert the img1 to grayscale and then filter out the noise
Image<Gray, Byte> gray1 = img1.Convert<Gray, Byte>().PyrDown().PyrUp();
//Canny Edge Detector
Image<Gray, Byte> cannyGray = gray1.Canny(120, 180);
pictureBox1.Image = cannyGray.ToBitmap();
}
}
【问题讨论】:
-
到目前为止你尝试过什么?我会尝试获取 2 个圆形轮廓的边界矩形并计算它们的宽度或高度之间的差异。有很多方法可以做到这一点,但您需要展示一些代码,以便我们可以帮助您解决问题。