基于OpenCV的迷宫求解器

基于OpenCV的迷宫求解器,opencv,robotics,Opencv,Robotics,我正在构建一个自动迷宫解算器,灵感来自以下方面: 我已经用步进机构建了迷宫控制,我正在使用以下步进电机控制板: 我使用视觉系统来控制迷宫解算器。我还发现了一个解决此问题的链接: 他们使用模板匹配来识别球。上面链接中提到的团队还上传了一个视频,看起来他们有精明的边缘检测来找到路径并执行PID算法 现在,我还在opencv中建立了模板匹配和边缘检测。我还通过USB串行端口建立了步进机的控制。如何实现导航算法?如何实现PID控制?我在理论上知道PID控制的概念,但我不知道如何利用摄像机的信息来

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

我已经用步进机构建了迷宫控制,我正在使用以下步进电机控制板:

我使用视觉系统来控制迷宫解算器。我还发现了一个解决此问题的链接:

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

现在,我还在opencv中建立了模板匹配和边缘检测。我还通过USB串行端口建立了步进机的控制。如何实现导航算法?如何实现PID控制?我在理论上知道PID控制的概念,但我不知道如何利用摄像机的信息来实现它。我只是不知道如何让球沿着直线移动

请找到我迄今为止获得的结果的附件图像


Sai

我不太明白你的问题,但如果你问球的位置如何,我猜:

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度的路线上。这使你的运动相对平稳


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

我不太明白你的问题,但如果你问球的位置如何,我猜:

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度的路线上。这使你的运动相对平稳


如果我不理解您的问题,请告诉我,我将更正我的答案

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