1

I'm trying to do some image processing and I have a script written in python that works off the NAO. I need to transfer the code to choreographe so that it can run on the robot.

How do I import opencv for the NAO using python?

Thanks for your help!

Sample code would be really helpful too with using opencv if it is different than using it outside of the NAO

4

5 回答 5

1

自从我上次回答以来,我写了一个小教程,将 python 和 opencv 与 NAO 一起使用。

这里是:

http://www.mangedisque.com/Alma/NaoStuffs/using_python_to_develop_your_vision_algorithm_on_your_robot__-_final.odp

于 2015-01-30T12:07:16.330 回答
1

取决于您的版本:

import cv
or
import cv2

那么您可以例如使用以下方法编写图像:

cv.saveImage( ...
or
cv2.imWrite(...
于 2014-04-16T09:56:15.517 回答
1

我从未尝试过 Choreographe 中的 opencv 导入,但我猜你必须创建一个空块(脚本模板)并使用import cv.

无论如何,如果您尝试在机器人中进行图像处理,可能会发现性能问题,尝试使用 SDK 在另一台计算机上进行

在这里您可以找到从机器人获取图像的示例:https ://community.aldebaran-robotics.com/doc/1-14/dev/python/examples/vision/index.html

于 2014-03-24T10:13:34.433 回答
1

Aldebaran 网站上的这个视频有一些关于一起使用 Python/OpenCV/Nao 的信息。

我从未将 Choreographe 与 OpenCV 一起使用,但是当仅使用普通 Python 将 Nao 相机的图像转换为可以使用 OpenCV 处理的图像时,可以使用以下行:

img = (numpy.reshape(numpy.frombuffer(nao_image[6], dtype = '%iuint8' % nao_image[2]), (nao_image[1], nao_image[0], nao_image[2])))

img现在对 OpenCV 友好。希望这可以帮助!

于 2015-07-02T13:28:21.523 回答
1

我刚刚遇到了同样的问题,首先,你需要在你的机器上安装 NumPy 1.9。(我使用的是Windows 10)只需正常运行.exe,然后,您需要下载打开的简历。之后您可以观看此视频:https ://www.youtube.com/watch?v=3xAslL8htuQ它对我有很大帮助。我认为这会比我对你有更多的帮助希望你能做到。我也有一个 NAO 机器人,祝你好运哈哈(抱歉英语不好,不是我的母语)

于 2016-08-11T14:59:01.143 回答