简体   繁体   English

使用Qt和opencv交叉编译到Raspberry Pi

[英]Cross-compiling to Raspberry Pi, using Qt and opencv

There are various ways to cross-compile to Raspberry Pi, and there are also solutions posted for cross-compiling Qt or opencv . 有各种方法可以交叉编译到Raspberry Pi,并且还有针对交叉编译Qtopencv的解决方案。

However, I couldn't find any solution to cross-compile a program with Qt which also uses opencv. 但是,我找不到任何与Qt交叉编译程序的解决方案,Qt也使用opencv。

I tried the following, using debian on a 64-bit PC: 我在64位PC上使用debian尝试了以下操作:

  • I compiled and set up Qt as a cross-compiler to ARM7, using this tutorial . 我使用本教程编译并设置Qt作为ARM7的交叉编译器。 It didn't work without issues though, here is an answer I posted which solved it for me. 但是没有问题它没有用, 这是我发布的答案 ,它解决了我。 I can now run my Qt programs with graphical GUI on the Raspberry Pi (although only full-screen, but that's a completely different issue) 我现在可以在Raspberry Pi上使用图形GUI运行我的Qt程序(虽然只是全屏,但这是一个完全不同的问题)

  • I followed the guide on the official opencv website to build opencv. 我按照官方opencv网站上的指南来构建opencv。 It failed with No CMAKE_CXX_COMPILER could be found. 它失败了, No CMAKE_CXX_COMPILER could be found.

  • Knowing from experience (I used Qt with opencv both on Windows and Linux) that Qt and opencv work together only if both are compiled with the same compiler, I tried to use the same cross-compiler for opencv which I used successfully to compile Qt: gcc-4.7-linaro-rpi-gnueabihf 根据经验(我在Windows和Linux上使用Qt和opencv),Qt和opencv只有在使用相同的编译器编译时才能协同工作,我尝试使用相同的交叉编译器来实现我成功编译Qt的opencv: gcc-4.7-linaro-rpi-gnueabihf

  • I specified the gnueabihf I previously used to compile Qt, as the compiler: 我指定了以前用于编译Qt的gnueabihf ,作为编译器:

I created the directory ~/opt/opencv_build_arm7/ and in it, I tried: 我创建了目录~/opt/opencv_build_arm7/ ,在其中,我试过:

sudo cmake -DCMAKE_CXX_COMPILER=/home/<user>/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -DCMAKE_C_COMPILER=/home/<user>/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-gcc -DCMAKE_TOOLCHAIN_FILE=/usr/dev/opencv/platforms/linux/arm-gnueabi.toolchain.cmake /usr/dev/opencv/

(Where the downloaded opencv sources were in /usr/dev/opencv/ which I recently used successfully to compile opencv for an x64 platform, using the g++ compiler which came with my Qt installation.) Note, that <user> is the username for the current session, in case other beginners might try these methods in the future. (下载的opencv源代码位于/usr/dev/opencv/我最近成功使用x64平台编译opencv,使用我的Qt安装附带的g ++编译器。)注意, <user>是用户名本次会议,以防其他初学者将来可能尝试这些方法。

This failed with the following error (where <user> is my username) 这失败并出现以下错误(其中<user>是我的用户名)

CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCXXCompiler.cmake:54 (message): The C++ compiler /usr/share/cmake-3.0/Modules/CMakeTestCXXCompiler.cmake:54中的CMake错误(消息):C ++编译器
"/home//opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++" is not able to compile a simple test program. “/home//opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++”无法编译简单的测试程序。

It fails with the following output : 它失败并带有以下输出:

Change Dir: /home//temp/CMakeFiles/CMakeTmp 改变目录:/ home // temp / CMakeFiles / CMakeTmp

Run Build Command:"/usr/bin/make" "cmTryCompileExec117178613/fast" 运行Build命令:“/ usr / bin / make”“cmTryCompileExec117178613 / fast”

/usr/bin/make -f CMakeFiles/cmTryCompileExec117178613.dir/build.make CMakeFiles/cmTryCompileExec117178613.dir/build / usr / bin / make -f CMakeFiles / cmTryCompileExec117178613.dir / build.make CMakeFiles / cmTryCompileExec117178613.dir / build

make 1 : Entering directory '/home//temp/CMakeFiles/CMakeTmp' make 1 :输入目录'/ home // temp / CMakeFiles / CMakeTmp'

/usr/bin/cmake -E cmake_progress_report / usr / bin / cmake -E cmake_progress_report
/home//temp/CMakeFiles/CMakeTmp/CMakeFiles 1 / home // temp / CMakeFiles / CMakeTmp / CMakeFiles 1

Building CXX object 构建CXX对象
CMakeFiles/cmTryCompileExec117178613.dir/testCXXCompiler.cxx.o CMakeFiles / cmTryCompileExec117178613.dir / testCXXCompiler.cxx.o

/home//opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -mthumb -fdata-sections -Wa,--noexecstack -fsigned-char -Wno-psabi -mthumb -fdata-sections -Wa,--noexecstack -fsigned-char -Wno-psabi -o CMakeFiles/cmTryCompileExec117178613.dir/testCXXCompiler.cxx.o -c /home//temp/CMakeFiles/CMakeTmp/testCXXCompiler.cxx /home//opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -mthumb -fdata-sections -Wa, - noexecstack -fsigned-char -Wno-psabi -mthumb -fdata-部分-Wa, - noexecstack -fsigned-char -Wno-psabi -o CMakeFiles / cmTryCompileExec117178613.dir / testCXXCompiler.cxx.o -c /home//temp/CMakeFiles/CMakeTmp/testCXXCompiler.cxx

/home//temp/CMakeFiles/CMakeTmp/testCXXCompiler.cxx: In function 'int main()': /home//temp/CMakeFiles/CMakeTmp/testCXXCompiler.cxx:在函数'int main()'中:

/home//temp/CMakeFiles/CMakeTmp/testCXXCompiler.cxx:4:10: sorry, unimplemented: Thumb-1 hard-float VFP ABI /home//temp/CMakeFiles/CMakeTmp/testCXXCompiler.cxx:4:10:对不起,未实现:Thumb-1 hard-float VFP ABI

CMakeFiles/cmTryCompileExec117178613.dir/build.make:57: recipe for target CMakeFiles / cmTryCompileExec117178613.dir / build.make:57:目标配方
'CMakeFiles/cmTryCompileExec117178613.dir/testCXXCompiler.cxx.o' failed 'CMakeFiles / cmTryCompileExec117178613.dir / testCXXCompiler.cxx.o'失败

make 1 : *** 制作1 :***
[CMakeFiles/cmTryCompileExec117178613.dir/testCXXCompiler.cxx.o] Error 1 [CMakeFiles / cmTryCompileExec117178613.dir / testCXXCompiler.cxx.o]错误1

make 1 : Leaving directory '/home//temp/CMakeFiles/CMakeTmp' make 1 :离开目录'/ home // temp / CMakeFiles / CMakeTmp'

Makefile:118: recipe for target 'cmTryCompileExec117178613/fast' failed Makefile:118:目标'cmTryCompileExec117178613 / fast'的配方失败

make: *** [cmTryCompileExec117178613/fast] Error 2 make:*** [cmTryCompileExec117178613 / fast]错误2

I specified an absolute path for the compiler, but even if I don't specify it, and just add it to my $PATH, it still has the same problem. 我为编译器指定了一个绝对路径,但即使我没有指定它,只是将它添加到我的$ PATH,它仍然有同样的问题。

export PATH=$PATH:/home/<user>/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/

sudo cmake -DCMAKE_TOOLCHAIN_FILE=/usr/dev/opencv/platforms/linux/arm-gnueabi.toolchain.cmake /usr/dev/opencv/

The compiler itself is found correctly, if I type 如果我键入,则可以正确找到编译器本身

arm-linux-gnueabihf-g++ -v

it is found successfully: 成功找到:

Using built-in specs. 使用内置规格。 COLLECT_GCC=./arm-linux-gnueabihf-c++ COLLECT_LTO_WRAPPER=/home/vszabi/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/4.7.2/lto-wrapper Target: arm-linux-gnueabihf Configured with: /opt/dev/src/crosstool-ng/crosstool-ng-linaro-1.13.1-2012.07-20120720/builds/arm-linux-gnueabihf-linux/.build/src/gcc-linaro-4.7-2012.07/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf --prefix=/opt/dev/src/crosstool-ng/crosstool-ng-linaro-1.13.1-2012.07-20120720/builds/arm-linux-gnueabihf-linux/install --with-sysroot=/opt/dev/src/crosstool-ng/crosstool-ng-linaro-1.13.1-2012.07-20120720/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran --enable-multilib --with-arch=armv6zk --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-pkgversion='crosstool-NG linaro-1.13.1-2012.07-20120720 - Linaro GCC 2012.07' --with-bugurl= https://bugs.launchpad.net/gcc-linaro --enable-__cxa_at COLLECT_GCC =。/ arm-linux-gnueabihf-c ++ COLLECT_LTO_WRAPPER = / home / vszabi / opt / gcc-4.7-linaro-rpi-gnueabihf / bin /../ libexec / gcc / arm-linux-gnueabihf / 4.7.2 / lto -wrapper目标:arm-linux-gnueabihf配置:/opt/dev/src/crosstool-ng/crosstool-ng-linaro-1.13.1-2012.07-20120720/builds/arm-linux-gnueabihf-linux/.build/ src / gcc-linaro-4.7-2012.07 / configure --build = i686-build_pc-linux-gnu --host = i686-build_pc-linux-gnu --target = arm-linux-gnueabihf --prefix = / opt / dev /src/crosstool-ng/crosstool-ng-linaro-1.13.1-2012.07-20120720/builds/arm-linux-gnueabihf-linux/install --with-sysroot = / opt / dev / src / crosstool-ng / crosstool -ng-linaro-1.13.1-2012.07-20120720 / builds / arm-linux-gnueabihf-linux / install / arm-linux-gnueabihf / libc --enable-languages = c,c ++,fortran --enable-multilib - with-arch = armv6zk --with-tune = arm1176jzf -s --with-fpu = vfp --with-float = hard --with-pkgversion ='crosstool-NG linaro-1.13.1-2012.07-20120720 - Linaro GCC 2012.07'--with-bugurl = https://bugs.launchpad.net/gcc-linaro --enable -__ cxa_at exit --enable-libmudflap --enable-libgomp --enable-libssp --with-gmp=/opt/dev/src/crosstool-ng/crosstool-ng-linaro-1.13.1-2012.07-20120720/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpfr=/opt/dev/src/crosstool-ng/crosstool-ng-linaro-1.13.1-2012.07-20120720/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpc=/opt/dev/src/crosstool-ng/crosstool-ng-linaro-1.13.1-2012.07-20120720/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-ppl=/opt/dev/src/crosstool-ng/crosstool-ng-linaro-1.13.1-2012.07-20120720/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-cloog=/opt/dev/src/crosstool-ng/crosstool-ng-linaro-1.13.1-2012.07-20120720/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-libelf=/opt/dev/src/crosstool-ng/crosstool-ng-linaro-1.13.1-2012.07-20120720/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-host- exit --enable-libmudflap --enable-libgomp --enable-libssp --with-gmp = / opt / dev / src / crosstool -ng / crosstool-ng-linaro-1.13.1-2012.07-20120720 / builds / arm -linux-gnueabihf-linux / .build / arm-linux-gnueabihf / build / static --with-mpfr = / opt / dev / src / crosstool -ng / crosstool-ng-linaro-1.13.1-2012.07-20120720 / builds / arm-linux-gnueabihf-linux / .build / arm-linux-gnueabihf / build / static --with-mpc = / opt / dev / src / crosstool -ng / crosstool-ng-linaro-1.13.1-2012.07 -20120720 / builds / arm-linux-gnueabihf-linux / .build / arm-linux-gnueabihf / build / static --with-ppl = / opt / dev / src / crosstool -ng / crosstool-ng-linaro-1.13。 1-2012.07-20120720 / builds / arm-linux-gnueabihf-linux / .build / arm-linux-gnueabihf / build / static --with-cloog = / opt / dev / src / crosstool-ng / crosstool-ng-linaro -1.13.1-2012.07-20120720 / builds / arm-linux-gnueabihf-linux / .build / arm-linux-gnueabihf / build / static --with-libelf = / opt / dev / src / crosstool-ng / crosstool- ng-linaro-1.13.1-2012.07-20120720 / builds / arm-linux-gnueabihf-linux / .build / arm-linux-gnueabihf / build / static --with-host- libstdcxx='-L/opt/dev/src/crosstool-ng/crosstool-ng-linaro-1.13.1-2012.07-20120720/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static/lib -lpwl' --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --enable-gold --with-local-prefix=/opt/dev/src/crosstool-ng/crosstool-ng-linaro-1.13.1-2012.07-20120720/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-c99 --enable-long-long Thread model: posix gcc version 4.7.2 20120701 (prerelease) (crosstool-NG linaro-1.13.1-2012.07-20120720 - Linaro GCC 2012.07) libstdcxx =' - L /选择的/ dev / SRC /的crosstool-纳克/的crosstool-NG-Linaro的-1.13.1-2012.07-20120720 /建立/臂-Linux的gnueabihf-LINUX / .build /臂-Linux的gnueabihf /构建/ static / lib -lpwl' - enable-threads = posix --disable-libstdcxx-pch --enable-linker-build-id --enable-gold --with-local-prefix = / opt / dev / src / crosstool-ng / crosstool-ng-linaro-1.13.1-2012.07-20120720 / builds / arm-linux-gnueabihf-linux / install / arm-linux-gnueabihf / libc --enable-c99 --enable-long-long Thread型号:posix gcc版本4.7.2 20120701(预发布)(crosstool-NG linaro-1.13.1-2012.07-20120720 - Linaro GCC 2012.07)

What could I try next? 我接下来可以尝试什么? Opening the gui version of cmake with opencv/platforms/linux/arm-gnueabi.toolchain.cmake shows very few options (only ARM_LINUX_SYSROOT, CMAKE_BUILD_TYPE, CMAKE_CONFIGURATION_TYPES, CMAKE_INSTALL_PREFIX, GCC_COMPILER_VERSION and LIBRARY_OUTPUT_PATH_ROOT, but none of the BUILD_opencv_xyz with which I can disable individual packages), much fewer than the case when I built opencv for an x86 or x64 platform. opencv/platforms/linux/arm-gnueabi.toolchain.cmake的gui版本显示了很少的选项(只有ARM_LINUX_SYSROOT,CMAKE_BUILD_TYPE,CMAKE_CONFIGURATION_TYPES,CMAKE_INSTALL_PREFIX,GCC_COMPILER_VERSION和LIBRARY_OUTPUT_PATH_ROOT,但没有一个BUILD_opencv_xyz用于禁用单独的包),比我为x86或x64平台构建opencv的情况要少得多。

I'm afraid that searching for a different compiler might cause issues with Qt, because as far as I know, for opencv to work within Qt, it has to be compiled with the same compiler as what is used both to build the Qt libraries and build my program. 我担心搜索不同的编译器可能会导致Qt出现问题,因为据我所知,要使opencv在Qt中工作,必须使用与构建Qt库所用的编译器相同的编译器进行编译。建立我的计划。 Whenever I tried it in the past without being careful that these 3 things (Qt libs, opencv, my program) need to be compiled with the same compiler, I always experienced weird crashes either as soon as I included any opencv header, or whenever I called any function from opencv. 每当我在过去尝试它而不小心这三件事(Qt libs,opencv,我的程序)需要使用相同的编译器进行编译时,我总是遇到奇怪的崩溃,只要我包含任何opencv标头,或者每当我从opencv调用任何函数。

The tutorial at http://docs.opencv.org/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html seems to be either wrong or out of date. http://docs.opencv.org/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html上的教程似乎是错误的或过时的。

Downloading the source of opencv 3.0, the opencv/platforms/linux/arm-gnueabi.toolchain.cmake seems to be insufficiently configured for the Raspberry Pi. 下载opencv 3.0的源代码, opencv/platforms/linux/arm-gnueabi.toolchain.cmake似乎没有为Raspberry Pi配置不足。

Configure 配置

Visiting the workgroup page of the creators of the arm-linux-gnueabihf toolchain, it seems that for the ARM7 in the Raspberry Pi to be supported, the following options have to be passed to the compiler: -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=vfpv4 访问arm-linux-gnueabihf工具链的创建者的工作组页面 ,似乎支持Raspberry Pi中的ARM7,必须将以下选项传递给编译器: -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=vfpv4

So, we have to edit the opencv/platforms/linux/arm-gnueabi.toolchain.cmake file and change 所以,我们必须编辑opencv/platforms/linux/arm-gnueabi.toolchain.cmake文件并进行更改

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthumb -fdata-sections -Wa,--noexecstack -fsigned-char -Wno-psabi")
set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -mthumb -fdata-sections -Wa,--noexecstack -fsigned-char -Wno-psabi")

to

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthumb -fdata-sections -Wa,--noexecstack -fsigned-char -Wno-psabi -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=vfpv4")
set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -mthumb -fdata-sections -Wa,--noexecstack -fsigned-char -Wno-psabi -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=vfpv4")

running cmake again, the configuration was successfully completed! 再次运行cmake,配置成功完成!

Make 使

During the building process, if the following error appears 在构建过程中,如果出现以下错误

CMakeFiles/opencv_core.dir/src/rand.cpp.o: relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; 制作共享对象时,不能使用CMakeFiles / opencv_core.dir / src / rand.cpp.o:对“本地符号”重定位R_ARM_THM_MOVW_ABS_NC; recompile with -fPIC CMakeFiles/opencv_core.dir/src/rand.cpp.o: could not read symbols: Bad value 使用-fPIC重新编译CMakeFiles / opencv_core.dir / src / rand.cpp.o:无法读取符号:值不正确

just add the -fPIC flag to the CMAKE_C_FLAGS and CMAKE_CXX_FLAGS in the cmake file and run make again. 只需将-fPIC标志添加到cmake文件中的CMAKE_C_FLAGSCMAKE_CXX_FLAGS ,然后再次运行make。

Deployement Deployement

Using Qt Creator to deploy, just set up the headers and libraries in your .pro file, for example: 使用Qt Creator进行部署,只需在.pro文件中设置标头和库,例如:

INCLUDEPATH += <your build dir>/install/include/opencv2/
INCLUDEPATH += <your build dir>/install/include/
LIBS += -L  "<your build dir>/install/lib/"
LIBS += -lopencv_calib3d
LIBS += -lopencv_core
#... and so on

You also have to copy the compiled libraries (found in <your build dir>/install/lib/ ) to the Raspberry Pi. 您还必须将已编译的库(在<your build dir>/install/lib/ )复制到Raspberry Pi。 Using a USB stick might mess up the symlinks, so I would recommend using scp to copy the files. 使用USB记忆棒可能会弄乱符号链接,所以我建议使用scp来复制文件。

If you are relatively new to Linux (just as myself), don't forget that executables don't automatically look into their own folders for dynamic libraries as they did in Windows. 如果您对Linux相对较新(就像我一样),请不要忘记,可执行文件不会像在Windows中那样自动查看动态库的自己的文件夹。

Therefore you should either copy the libraries to a place which is usually searched for them (like /usr/local/bin ) or update your LD_LIBRARY_PATH accordingly. 因此,您应该将库复制到通常搜索它们的位置(例如/usr/local/bin ),或者相应地更新LD_LIBRARY_PATH

For a quick and dirty test, to see if everything works, you might copy the libraries into the same folder where your executable is deployed, and run it by using 对于快速而肮脏的测试,要查看是否一切正常,您可以将库复制到部署可执行文件的同一文件夹中,然后使用它运行它

$ LD_LIBRARY_PATH=. ./your_program

Testing 测试

Opencv should work now in your Qt program on the Raspberry Pi. Opencv现在应该在Raspberry Pi的Qt程序中运行。

Unless my google-fu is very weak, this might be the first documented case of running a Qt GUI application on a Raspberry Pi with opencv working in it. 除非我的google-fu非常弱,否则这可能是第一个在使用opencv工作的Raspberry Pi上运行Qt GUI应用程序的案例。 :) :)

However, note that there might still be some issues with window management. 但请注意,窗口管理可能仍存在一些问题。 Trying to open an opencv window, for example, cv::namedWindow("image"); 试图打开一个opencv窗口,例如, cv::namedWindow("image"); might fail with the following error: 可能会失败并出现以下错误:

OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvNamedWindow, file /usr/dev/opencv/modules/highgui/src/window.cpp, line 516 terminate called after throwing an instance of 'cv::Exception' what(): /usr/dev/opencv/modules/highgui/src/window.cpp:516: error: (-2) The function is not implemented. OpenCV错误:未指定错误(该功能未实现。使用Windows,GTK + 2.x或Carbon支持重建库。如果您使用的是Ubuntu或Debian,请安装libgtk2.0-dev和pkg-config,然后重新运行cmake或者在cvNamedWindow中配置脚本),文件/usr/dev/opencv/modules/highgui/src/window.cpp,第516行终止在抛出'cv :: Exception'的实例后调用what():/ usr / dev / opencv /modules/highgui/src/window.cpp:516:错误:( - 2)该函数未实现。 Rebuild the library with Windows, GTK+ 2.x or Carbon support. 使用Windows,GTK + 2.x或Carbon支持重建库。 If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvNamedWindow 如果您使用的是Ubuntu或Debian,请安装libgtk2.0-dev和pkg-config,然后在cvNamedWindow函数中重新运行cmake或configure脚本

I guess we should do as it says, but cvNamedWindow is not very useful in a Qt GUI application, as it's usually only required for debugging. 我想我们应该这样做,但是cvNamedWindow在Qt GUI应用程序中不是很有用,因为它通常只需要调试。 Therefore if the image has to be shown in your application, converting it to QImage might be better anyway than opening up an independent window. 因此,如果必须在应用程序中显示图像,则将其转换为QImage可能比打开独立窗口更好。

However, everything else seems to work, I managed to successfully run complicated image matching algorithms on the Raspberry Pi. 然而,其他一切似乎都有效,我成功地在Raspberry Pi上运行了复杂的图像匹配算法。

(... will update if I find a good solution for running the Qt application in a window and using cvNamedWindow ) (...如果我找到一个在窗口中运行Qt应用程序并使用cvNamedWindow的良好解决方案,将会更新)

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

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