【问题标题】:Gobot OpenCV failsGobot OpenCV 失败
【发布时间】:2023-03-13 20:09:01
【问题描述】:

我正在尝试从 GoBot Go Lang OpenCV 运行 OpenCV 测试应用程序。我尝试运行该页面中给出的示例代码,但得到的只是一个错误:

2016/06/10 20:15:26 Initializing Robot cameraBot ...
2016/06/10 20:15:26 Initializing devices...
2016/06/10 20:15:26 Initializing device window ...
2016/06/10 20:15:26 Initializing device camera ...
2016/06/10 20:15:26 Starting Robot cameraBot ...
2016/06/10 20:15:26 Starting connections...
2016/06/10 20:15:26 Starting devices...
2016/06/10 20:15:26 Starting device window...
/usr/share/themes/Yuyo-Dark/gtk-2.0/Apps/libreoffice.rc:40: Unable to    locate image file in pixmap_path: "Entry/entry-border-bg-solid.png"
/usr/share/themes/Yuyo-Dark/gtk-2.0/Apps/libreoffice.rc:43: Background     image options specified without filename
/usr/share/themes/Yuyo-Dark/gtk-2.0/Apps/libreoffice.rc:49: Unable to   locate image file in pixmap_path: "Entry/entry-border-active-bg-solid.png"
/usr/share/themes/Yuyo-Dark/gtk-2.0/Apps/libreoffice.rc:52: Background   image options specified without filename
init done 
opengl support available 
2016/06/10 20:15:26 Starting device camera...
HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP
2016/06/10 20:15:26 Starting work...

我做错了什么?我之前已经安装并运行过 C++ OpenCV

【问题讨论】:

  • 除了缺少图像文件警告之外,我在这里看到的唯一问题是您的 HIGHGUI ERROR 日志。你在this见过吗?
  • 谢谢,我修好了那部分,你能告诉我那些图片缺少什么吗??
  • 很难说,看起来像是一个影响多个用户的 gtk 错误。你在什么操作系统上?我将尝试运行您的示例。
  • 似乎比您模棱两可的警告更多。 gobot/platforms/opencv 给了我一个 404。但是在使用 brew 安装 opencv 后,hellocv.go here 在 OSX 上为我工作。他们显然没有更新文档,如果您对 gobot 没有特定用途,请查看 hybridgroup/go-opencv。

标签: opencv go gobot.io


【解决方案1】:

跟进cmets;我给了 gobot 另一个样本opencv_face_detect,它对我有用。尽管您发布的示例链接似乎有问题/已过时。

这是在 OS X 10.11.5 和 go1.6.2 darwin/amd64 上。

这是我做的步骤;

  • 安装opencv;

    brew tap homebrew/science && brew install opencv

  • 安装gobot和go-opencv;

    获取 github.com/hybridgroup/gobot && 获取 github.com/lazywei/go-opencv

  • 运行位于“github.com/hybridgroup/gobot/examples”的 face_detect 示例,不要忘记微笑!

    去运行 opencv_face_detect.go

【讨论】:

  • 谢谢,我使用的是 Ubuntu,但这是我得到的输出 /usr/share/themes/Yuyo-Dark/gtk-2.0/Apps/libreoffice.rc:40: Unable to locate image file在 pixmap_path 中:“Entry/entry-border-bg-solid.png”/usr/share/themes/Yuyo-Dark/gtk-2.0/Apps/libreoffice.rc:43:没有文件名/usr/share/ 指定的背景图像选项主题/Yuyo-Dark/gtk-2.0/Apps/libreoffice.rc:49:无法在 pixmap_path 中找到图像文件:“Entry/entry-border-active-bg-solid.png”/usr/share/themes/Yuyo- Dark/gtk-2.0/Apps/libreoffice.rc:52: 指定的背景图片选项没有文件名
  • 您可以尝试使用sudo apt-get remove --purge yuyo-gtk-theme && sudo apt-get install yuyo-gtk-theme 删除并重新安装“yuyo-gtk-theme 包”吗?
  • 具有相同日志的来源:askubuntu.com/a/694793/200350 我想应该这样做。
  • 试过所有重装mate-env-core的包,还是一样的错误。
  • 很明显你的包有问题,但为什么不在另一台机器上试试呢,也许是朋友的电脑?如果 go 已经设置好了,它实际上需要一些命令来运行该示例。我无法将您的问题与 gobot 或 opencv 联系起来。也许作为最后的手段,尝试安装 gimp,因为有人报告它有助于解决问题,可能是因为它在安装期间修复了 gtk。
猜你喜欢
  • 1970-01-01
  • 2014-05-23
  • 2014-02-10
  • 1970-01-01
  • 2014-06-01
  • 2021-09-14
  • 2012-11-26
  • 2014-11-24
  • 2014-05-28
相关资源
最近更新 更多