简体   繁体   English

在Raspberry PI上运行OpenCV

[英]Running OpenCV on Raspberry PI

I am trying to test a simple example program on Raspberry PI, to start test OpenCV function on Raspberry PI. 我正在尝试在Raspberry PI上测试一个简单的示例程序,以在Raspberry PI上开始测试OpenCV功能。

After successful compilation, I get an empty window. 成功编译后,我得到一个空窗口。

The code is an example code when could be found on the OpenCV website, however the only part I change is name of the picture. 该代码是一个示例代码,可以在OpenCV网站上找到,但是我更改的唯一部分是图片的名称。

IplImage* img = cvLoadImage("pic1.jpg", 3);

All I get in an empty window. 我所得到的都是一个空窗口。 The pic.jpg is saved in the home directory (home/pi) . pic.jpg保存在主目录(home/pi)

Anyone came across this before? 有人遇到过吗?

Regards 问候

Make sure object file and jpg that you're trying to load is in the same directory. 确保您要加载的目标文件和jpg位于同一目录中。 (home) (家)

Or just use complete path like this. 或者只是使用完整的路径,像这样。

IplImage* img = cvLoadImage("/home/pi/pic1.jpg", 3); IplImage * img = cvLoadImage(“ / home / pi / pic1.jpg”,3);

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM