【问题标题】:Emgucv Houghlines length of lineEmgucv Houghlines 线的长度
【发布时间】:2015-01-02 11:28:51
【问题描述】:

我正在使用带有边缘检测器应用程序的 EmguCV houghines 来检测消融棒(带有红色和白色条纹的木棒),我需要知道如何获得以像素为单位的线条长度,例如:第一行是 50 像素长

代码示例

class HoughTransform
{
    private Image<Gray, Byte> _sourceImage;
    private Image<Gray, Byte> _linesImage;
    private Image<Gray, Byte> _resultImage;

    public HoughTransform()
    {

    }

    public void applyTransform()
    {
        try
        {
            _linesImage = _sourceImage.CopyBlank();
            LineSegment2D [] lines = _sourceImage.HoughLinesBinary(1, Math.PI/ 0.0, 50, 100, 1)[0];
            foreach(LineSegment2D line in lines)
            {
                _linesImage.Draw(line,new Gray(200), 5);
            }
            _resultImage = _linesImage;
        }
        catch(Exception e)
        {
            MessageBox.Show(e.ToString());
        }
    }

【问题讨论】:

    标签: c# opencv emgucv hough-transform


    【解决方案1】:

    根据LineSegment2D 的文档,行的长度可通过 Length 属性获得。

    line.Length
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多