【发布时间】:2016-03-21 20:12:36
【问题描述】:
您好,我正在使用 HoughLines 方法 来检测来自相机的线条,我已经使用 ROI 过滤了我的图像“imgProcessed”,这意味着只获取黑色物体来制作跟踪简单,然后当我打算使用 HoughLines 方法时,它给了我一个错误,我的“CannyEdges”有一些 invalid arguments,这是我的代码:
Image<Gray, Byte> gray = imgProcessed.Convert<Gray, Byte>().PyrDown().PyrUp();
Gray cannyThreshold = new Gray(180);
Gray cannyThresholdLinking = new Gray(120);
Gray circleAccumulatorThreshold = new Gray(120);
Image<Gray, Byte> cannyEdges = gray.Canny(cannyThreshold, cannyThresholdLinking);
LineSegment2D[] lines = imgProcessed.cannyEdges.HoughLines(
cannyThreshold,
cannyThresholdLinking,
1, //Distance resolution in pixel-related units
Math.PI / 45.0, //Angle resolution measured in radians.
50, //threshold
100, //min Line width
1 //gap between lines
)[0]; //Get the lines from the first channel
【问题讨论】: