【问题标题】:OpenCV based Labyrinth Maze solver基于 OpenCV 的迷宫迷宫求解器
【发布时间】:2011-09-22 04:20:58
【问题描述】:

我正在构建一个自动迷宫求解器,灵感如下:

http://www.youtube.com/watch?v=Prq78ctJ2Rk&feature=related 我已经用步进器构建了迷宫控制,并且正在使用以下步进电机控制板:

http://www.sparkfun.com/products/10025

我正在使用视觉系统来控制迷宫求解器。我还找到了解决这个问题的链接:

http://cse.logicol.org/?p=52

他们使用模板匹配来识别球。上面链接中提到的团队还上传了一个视频,看起来他们有精巧的边缘检测来寻找路径和执行 PID 算法。

http://www.youtube.com/watch?v=8b5ARjT22bg&feature=player_embedded

现在,我也在opencv中建立了模板匹配和边缘检测。我还通过 USB 串行端口建立了对步进器的控制。如何实现导航算法?如何实现 PID 控制?我在理论上知道 PID 控制的概念,但我只是不知道使用来自相机的信息来实现它。我只是对让球顺着线一无所知。

请找到我目前获得的结果的附件图片。

【问题讨论】:

  • 由于新的用户限制,我无法附加图像..

标签: opencv robotics


【解决方案1】:

我不太明白你的问题,但如果你问什么命令给了球给定它的位置,这是我的猜测:

1. you find the location of the ball.
2. you have the line of the desired path drown on the board and detected
using canny.
3. Find the closest point to the ball which is on the path line.  If
it was a straight line then the calculation is simple geometrical
formulae dist(point,line). Let us call the result D.
4. The resulting point on the line is where the ball should be. 
5. Advance distance D along the path line. This would give you your
destination point.
6. Subtract ball coordinates from destination point, and then, using atan2()
method to calculate in which direction to move the ball.
7. Activate motores to tilt board in that direction.

澄清第 5 步。为什么我说要沿路径前进距离 D?因为因此您将球引导至最多 45 度的路径线。这为您提供了相对平稳的电机运动。

如果我不明白你的问题,请告诉我,我会更正我的答案

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-03
    • 1970-01-01
    • 2020-06-14
    • 2013-04-16
    • 2014-09-25
    • 1970-01-01
    相关资源
    最近更新 更多