首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >基于OpenCV的迷宫解算器

基于OpenCV的迷宫解算器
EN

Stack Overflow用户
提问于 2011-06-25 00:21:57
回答 1查看 1.9K关注 0票数 2

我正在构建一个自动迷宫解算器,灵感来自于以下内容:

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控制的概念,但我只是不知道如何利用摄像机的信息来实现它。我只是不知道如何让球沿着这条线走。

请找到我到目前为止所获得的结果的附件图像。

赛斯

EN

回答 1

Stack Overflow用户

发布于 2011-06-26 02:27:47

我不太理解你的问题,但如果你问球在这里的位置有什么命令,我的猜测是:

代码语言:javascript
运行
复制
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度内。这使您可以相对平滑的运动。

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6470755

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档