可以使用Python和OpenCV在Arduino板上进行图像识别,而无需使用个人电脑。

huangapple go评论159阅读模式
英文:

Can i use python image recognition with opencv in a ardiuno board without pc?

问题

我想创建一台能够检测瓶子与其他物体的机器,最好能够识别瓶子的类型。我正在考虑在这个项目中使用Arduino Nano,但我不确定它是否能够完成这个任务并发送数据。另外,像Arduino Nano这样的微控制器能够独立运行Python代码吗?

我理解使用个人电脑可能会更容易完成这个任务,但由于我无法负担昂贵的控制器,我需要这个系统能够独立运行。对于如何在Arduino Nano上实现这一点的任何建议或指导将不胜感激!谢谢!

英文:

I want to create a machine that can detect bottles from other objects, preferably with the capability to identify the type of bottle as well. I am considering using an Arduino Nano for this project, but I'm not sure if it's capable of doing so. Can the Arduino Nano handle this task and send the data? Also, can a microcontroller like Arduino Nano run Python code on its own?

I understand that using a PC would make this task easier, but I need the system to be standalone as I cannot afford pricey controllers. Any suggestions or guidance on how to achieve this with Arduino Nano would be greatly appreciated! Thank you!

答案1

得分: 2

以下是翻译好的部分:

"你在Arduino Nano上很可能无法运行任何计算机视觉。由于其资源极为有限,通常要在小型系统上执行此类操作,有两种选择。第一,您可以使用树莓派或类似的单板计算机,可能还需要某种 PPU。第二种选择是让Arduino处理图像捕获以及基于图像是否为瓶子的逻辑,但识别本身由远程服务器执行,然后向Arduino发送消息。

另一个选择是不使用依赖机器学习的计算机视觉库,如OpenCV,而是采用更简单的方法。您可以通过检测颜色或亮度的变化来使用图像来确定相机前是否放置了瓶子。不过,这可能无法区分瓶子和橡皮鸭之间的差异。您可以设计设备以限制其能够识别的可能性(例如,交通灯通常使用摄像头来检测交叉路口的等待车辆,通过在特定预定义位置看到图像的变化,因为该位置位于交叉路口,所以必定是汽车)。虽然不太准确,但这是可能在Arduino上运行的一种方法。

至于您的第二个问题,您可以在Arduino上运行Python,您可以在这里找到文档。"

英文:

You most likely cannot run any kind of computer vision on an Arduino nano given the absolutely tiny resources available on it. Generally to do something like that on a small system you have two option, you either use a Raspberry Pi or similar single-board computer and likely also some kind of PPU. The second option is for the Arduino to handle capturing the image and preforming whatever logic you want based on if something is a bottle or not, but the recognition itself is preformed by a remote server that then sends a message back to the Arduino.

Another option is to not use a computer vision library that relies on ML like opencv and instead so something far simpler. You could do something like using an image to determine if a bottle is placed in front of the camera by detecting a change in color or brightness. This likely won't be able to tell the difference between a bottle and a rubber duck though. You can design your devise to limit the possibilities for what it can see (for example traffic lights often use cameras to detect waiting cars by seeing a change in the image in a certain pre-defined location, because that location is in an intersection it must be a car). While not nearly as accurate it is something you could conceivably run on an Arduino.

As for your second question, you can run python on an Arduino, you can find the documentation here.

huangapple
  • 本文由 发表于 2023年4月10日 23:34:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/75978472.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定