pcduino里,Qt无法打开摄像头(调用了opencv调用usb摄像头)

扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
Linux下使用QT调用opencv读取摄像头视频 调试心得
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口Qt结合OpenCV和VC++实现调用摄像头拍照并保存捕捉到的图像文件 - 下载频道
- CSDN.NET
&&&&Qt结合OpenCV和VC++实现调用摄像头拍照并保存捕捉到的图像文件
Qt结合OpenCV和VC++实现调用摄像头拍照并保存捕捉到的图像文件
这个基于C++的Qt应用程序实现的是调用摄像头拍照的功能,它运用OpenCV里关于图像捕捉拍照的代码来进行的编写。同时实现将拍摄的照片以不同的格式进行保存,非常实用
若举报审核通过,可奖励20下载分
被举报人:
kaikaigoon
举报的资源分:
请选择类型
资源无法下载
资源无法使用
标题与实际内容不符
含有危害国家安全内容
含有反动色情等内容
含广告内容
版权问题,侵犯个人或公司的版权
*详细原因:
您可能还需要
开发技术下载排行今天看啥 热点:
移植opencv到开发板,摄像头在开发板6410上的采集使用(1),opencv6410
最近在搞人眼检测 人脸识别移植opencv qt 到开发板tiny6410的时候在虚拟机跑得程序可以用,但是一直到开发板一堆错误。
移植qt我简单写一下很简单
然后安装QT4.7
拷贝压缩包到主机/opt目录下
#mkdir –p /opt/mini6410
#cd /opt/mini6410
#tar zxvf /opt/qt-everywhere-opensource-src-4.7.0.tar.gz
执行以下命令执行Qt4.7.0编译前的配置
#cd /opt/mini6410/qt-everywhere-opensource-src-4.7.0
#echo yes | ./configure -prefix /opt/Qt4.7 -opensource -embedded arm -xplatform qws/linux-arm-g++ -no-webkit -qt-libtiff -qt-libmng -qt-mouse-tslib -qt-mouse-pc -no-mouse-linuxtp -no-neon(一定要注意,不能错一个空格,执行需要一段时间,如果瞬间通过则说明有误)
&#make &&make install(执行完成后,查看/OPT下是否多出Qt4.7文件夹)
最后,在mini6410上部署Qt4.7
#tar zcvf& qt4.7.tgz& Qt4.7&&&& 在PC上将上述编译好的Qt4.7打包
将压缩文件放到开发板/opt目录下
#rm& /usr/local/Trolltech/QtEmbedded-4.7.0-arm/& -rf
#tar& zxvf& /sdcard/qt4.7.tgz
其中步骤④为了保证有足够的空间存放我们自己编译的Qt4.7,将友善之臂提供的Qt4.7删除掉.
移植opencv的时候一对问题我也总结了,一般按照网上的教程也有不少错误在这里我把全部修改的列出来你按照这个肯定可以通过,没通过联系我
总结一下修改的地方:
&&&&&&&& 去掉WITH_TIFF& WITH_CUDA
&&&&&&&& 修改CMAKE_BUILD_TYPE为Release
&&&&&&&& 修改CMAKE_INSTALL_PREFIX& 路径可以参考我的想法,而且千万不要跟pc的库重叠
&&&&&&&& 到opencv-arm/CMakeCache.txt下找到CMAKE_EXE_LINKER_FLAGS:STRING=''
&&&&&&&& 替换成:CMAKE_EXE_LINKER_FLAGS:STRING=-lpthread-ldl -lrt&
到这里基本上移植成功了但是要到开发板使用,你要把你的库拷贝到开发板/usr/lib里。要自启动才能使得触摸屏能用,自启动和字库的移植在我的别的博客里。你可以去看看。
这篇就到这下一篇写摄像头的使用。很多问题的
应该是依赖库没有装全,
这个要看做什么产品了。现在网上关于6410开发板的宣传资料满天飞,从一开始的友坚科技独霸天下,到目前各类S3C6410开发板纷纷而出,价格也是参差不齐。不过鄙人认为,既然做产品,第一是考虑的稳定性,其次是售后;经典的6410开发板是经过客户检验出来的,稳定性是没的说。所以选S3C6410开发板,尤其是企业或者做像项目,一定要慎重,不能一时贪小便宜买错6410板子。个人推荐友坚科技,国内最早做6410开发板的公司之一,一直坚持益求精的设计理念,品质可靠,始终保持业界最新配置,在ARM方面已经非常成熟。友坚6410开发板客户仅凭序列号就可免费升级,并获取三星第一手资料!推荐!
相关搜索:
相关阅读:
相关频道:
Android教程最近更新我OpenCV进行实时视频处理。
作为一个前端我的QT
在我的GUI,我有一个输入图像窗口(映射到一个Label)和输出图像窗口(映射到另一个Label)和3个按钮.a开始输入的视频捕捉,第二处理视频(代码尚未编写),第三则退出。
我目前能流我的视频并在前端显示。但这个锁我的GUI,但无法退出。
我(利用这一点,并在QT论坛的建议),但我的GUI仍保持锁定状态。
将不胜感激,如果能在正确的方向指向我。
下面是代码:
mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include &QMainWindow&
#include &opencv2/highgui/highgui.hpp&
#include &opencv2/core/core.hpp&
#include &opencv2/imgproc/imgproc.hpp& // for cvtColor
#include &iostream&
#include &QTimer&
namespace Ui {
class MainW
class MainWindow : public QMainWindow
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_buttonCaptureVideo_clicked();
void on_buttonExit_clicked();
public slots:
virtual void doNextFrame() {repaint();}
Ui::MainWindow *
CvCapture *
// OpenCV Video Capture Variable
IplImage *
// Variable to capture a frame of the input video
cv::Mat source_
// Variable pointing to the same input frame
cv::Mat dest_
// Variable to output a frame of the processed video
QTimer *imageT
#endif // MAINWINDOW_H
mainwindow.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
ui-&setupUi(this);
MainWindow::~MainWindow()
cvReleaseImage(&frame);
cvReleaseCapture(&capture);
void MainWindow::on_buttonCaptureVideo_clicked()
// Set to 25 frames per second
const int imagePeriod = 1000/25; // ms
imageTimer = new QTimer(this);
imageTimer-&setInterval(imagePeriod);
connect(imageTimer, SIGNAL(timeout()), this, SLOT(doNextFrame()));
// Use the default camera
capture = cvCreateCameraCapture(-1);
while(capture)
// Capture a frame
frame = cvQueryFrame(capture);
// Point to the same frame
source_image =
// Resize Image
cv::resize(source_image, source_image, cv::Size(128,128) , 0, 0);
// Change to RGB format
cv::cvtColor(source_image,source_image,CV_BGR2RGB);
// Convert to QImage
QImage qimg = QImage((const unsigned char*) source_image.data, source_image.cols, source_image.rows, QImage::Format_RGB888); // convert to QImage
// Display on Input Label
ui-&labelInputVideo-&setPixmap(QPixmap::fromImage(qimg));
// Resize the label to fit the image
ui-&labelInputVideo-&resize(ui-&labelInputVideo-&pixmap()-&size());
void MainWindow::on_buttonExit_clicked()
connect(ui-&buttonExit, SIGNAL(clicked()), qApp, SLOT(closeAllWindows()));
本文地址 :CodeGo.net/483896/
-------------------------------------------------------------------------------------------------------------------------
1. 当您点击按钮,
while(capture) { ... }
循环将永远运行下去,因为capture永远不会被设置为NULL。
码流永远不会离开你的循环和主线程无法处理别的,例如像重新粉刷。
该会发出的信号,但它们将被放置在Qt的事件队列中的事件。只要你的on_buttonCaptureVideo_clicked()方法运行时,这些事件将不会被处理。
这里是我的建议,如何使它工作:
这段代码:
// Set to 25 frames per second
const int imagePeriod = 1000/25; // ms
imageTimer = new QTimer(this);
imageTimer-&setInterval(imagePeriod);
connect(imageTimer, SIGNAL(timeout()), this, SLOT(doNextFrame()));
// Use the default camera
capture = cvCreateCameraCapture(-1);
属于成主窗口的构造函数中 CodeGo.net,只要你想只设置了1。有没有必要当单击该按钮时,第二,第三等做一遍
这是内部的代码你while循环应该进入doNextFrame()槽(不同时构建体)。
那么你的按钮只会做
imageTimer-&start();
再例如,做
imageTimer-&stop();
再次单击时。
示例代码:
void MainWindow::on_buttonCaptureVideo_clicked()
if( imageTimer-&isActive() )
imageTimer-&stop();
imageTimer-&start();
如果你这样做会发生什么事?
当您单击该按钮,您的on_buttonCaptureVideo_clicked()点击槽将从GUI线程被调用,将会启动,并且将几乎立即返回。
现在,GUI线程是free的,能够处理重绘等。
从这一点上来说,该会发送信号每40ms。每当GUI线程是自由的,它会处理这个信号,并打电话给你doNextFrame插槽。
这个槽会捕捉下一个,当它完成返回。当它完成时,GUI线程就能够再次处理其他事件(如重绘)。
当你再次单击该按钮时,将停止,并没有新的事件将被发送。如果您仍然看到一对夫妇的按钮被点击后,这的事件被送往速度比他们可以处理。
前言:我不是强在C ++,所以我不能提供具体的代码,但我经历了PyQt的
这是陷阱,Qt的。似乎什么你on_buttonCaptureVideo_clicked正在做的是进入你的主界面线程做的工作循环。在Qt中,你要避免做任何事情在忙你的主线程。事件循环需要能够不断地处理和Qt的GUI事件,因为他们英寸你在做什么挡住了事件循环。
有两种不同的东西,你可以在这里做。首先是更基本的方法,但可以让你看到更多的结果。您可以“泵”的事件循环。这取决于如何快速的while循环迭代,你可以调用qApp-&processEvents();。这将使Qt的处理挂起的GUI事件,使您的应用程序看上去更加敏感。它的while循环和主回路之间基本上共享。也许你想调用这个对每n取决于你想要多久确保GUI的刷新。
另一种选择,这是更可取的,是把你捕获环成一个QThread中。当一个新的可用则可以发出一个信号与所述数据。该信号将得到安置到Qt的事件循环与一切进行处理,不会耽误你的GUI.a般来说,这是你想要采取任何重捣鼓或长期运行可调用的方法。
我只是意识到,你除了做在主线程中的循环开始。如果你想有一个和你的图像处理是不是太重了(它不每个周期需要很长时间),那么你应该将一切进入doNextFrame移除while循环。如果你的doNextFrame是一个沉重的过程,那么你应该一个QThread中和信号。
本文标题 :QT图形界面使用了OpenCV的摄像头录制视频时死机
本文地址 :CodeGo.net/483896/
Copyright (C) 2014 CodeGo.net 沪ICP备号 联&系& c&o&d&e&g&o &@&1&2&6&.&c&o&m之前的内容请访问我的博客/preorder69/category/471070.html
上一篇中运行了一个简单的例子,但是并没有调用摄像头进行图像采集,看了几篇博客也都是对静态图像的基本处理操作。
/Romi/archive//2396533.html(主要时QT控件操作)
/emouse/archive//2991333.html(OpenCV的初步图像处理)
由于我的直接目标不是这个,就没有完全操作一遍。直接找OpenCV摄像头操作。
首先熟悉了一下摄像头相关内容:
其 实可以了解到opencv只是一个图像处理的工具库,并不是视频处理的工具库!也就是说,它所处理的对象,应该是一张一张的图片,而opencv本身虽然 有一些API 函数可以进行USB相机的读取,但也仅仅是调用了windows 底层的vfw模块来实现,所以,如果你是windows
vista,windows7之类的操作系统,很可能微软已经抛弃了vfw模块。而这个时候,再利用opencv的相机视频捕获函数,就无法获取视频帧
同样linux下面也是这样,他需要调用底层的v4l库来实现调用摄像头。刚开始没有注意到这个问题,直接写程序来操作摄像头,结果一直出不来图像,报错。
#include &widget.h& #include &ui_widget.h& #include &QDebug&
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget) {
ui-&setupUi(this);
timer = new QTimer(this);
connect(timer,SIGNAL(timeout()),this,SLOT(slot_timer()));
timer-&start(FPS);
img = new QI
frame = NULL;
//capture = cvCreateCameraCapture(0);
//cvNamedWindow(&jdh&,CV_WINDOW_AUTOSIZE);
void Widget::slot_timer() {
capture = cvCreateCameraCapture(0);
if(capture==NULL){
qDebug()&&&error!&;
frame = cvQueryFrame(capture);
if (!frame)
//img-&load(&test.jpg&);
cvCvtColor(frame,frame,CV_BGR2RGB);
img = new QImage((unsigned char*)frame-&imageData,frame-&width,frame-&height,frame-&widthStep,QImage::Format_RGB888);
//img = new QImage((unsigned char*)frame-&imageData,frame-&width,frame-&height,QImage::Format_RGB888);
//cvShowImage(&jdh&,frame);
void Widget::paintEvent(QPaintEvent * event) {
//painter-&drawImage(0,0,mm);
QPainter *pp = new QPainter(this);
pp-&drawImage(0,0,*img,0,0,-1,-1,0); }
Widget::~Widget() {
cvReleaseImage(&frame);
//cvDestroyWindow(&jdh&);
其中:capture = cvCreateCameraCapture(0);这一据执行时,终端就报错:error!
错误如下:
zynq& ./OpenCV-Qt-video -qws&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
raw_edid: d82a62c0 0&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Using RGB output&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::begin: A paint device can only be painted by one painter at a time.&&
QPainter::setFont: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::translate: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setClipRegion: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::clipRegion: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::save: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setClipRegion: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::save: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::deviceTransform: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::worldMatrix: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::drawPoints: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::drawPoints: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::font: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setFont: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::deviceTransform: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::worldMatrix: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::drawPoints: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::deviceTransform: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::worldMatrix: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::drawPoints: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::drawRects: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::drawPoints: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::deviceTransform: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::worldMatrix: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::drawPoints: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::drawPoints: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::setPen: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::save: Painter not active&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::restore: Unbalanced save/restore&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::restore: Unbalanced save/restore&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::restore: Unbalanced save/restore&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
QPainter::end: Painter not active, aborted&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
error!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
error!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
error!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
error!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
error!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
error!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
error!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
error!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
error!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
error!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
error!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
error!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
error!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
可以看到摄像头根本没有打开。
所以我又回过头去把OpenCV重新编译,把与摄像头有关的底层库都添加进来。
光这一步,我整整花了一天时间都没搞定啊。
晚上22时55分37秒,恍然大悟,网上的程序都是PC上用的,不是用在Zedboard上的,capture = cvCreateCameraCapture(0);这个方法根本不是用在板子上的,板子根本不认识这个函数。而且Zedboard板子跑的不是linux桌面系统。
要知道这些与摄像头相关的库都属于第三方库,所以还需要进行移植。于是开始了第二天的撞墙。
重新下载源码,进行OpenCV的编译,下了3个,2.3.1,2.4.2,2.4.5,
按照步骤来:在源码路径创建toolchain.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER arm-xilinx-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER arm-xilinx-linux-gnueabi-g++)
交叉编译路径可以用绝对路径。
然后cmake -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake .(.代表当前目录)
-- Detected version of GNU GCC: 46 (406) -- Could NOT find ZLIB (missing:
ZLIB_LIBRARY) (found version &1.2.3.4&) -- Could NOT find PythonLibs (missing:
PYTHON_INCLUDE_DIRS) (Required is at least version &2.7.3&) -- Could NOT find OPENCL (missing:
OPENCL_LIBRARY OPENCL_INCLUDE_DIR)
-- General configuration for OpenCV 2.4.5 =====================================
Version control:
unknown --
Platform: --
Linux 3.2.0-29-generic-pae i686 --
Linux arm --
CMake generator:
Unix Makefiles --
CMake build tool:
/usr/bin/make --
Configuration:
Release --
Built as dynamic libs?:
C++ Compiler:
/opt/CodeSourcery/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux/bin/arm-xilinx-linux-gnueabi-g++
(ver 4.6.1) --
C++ flags (Release):
-W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -O3 -DNDEBUG
-DNDEBUG --
C++ flags (Debug):
-W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -g
-O0 -DDEBUG -D_DEBUG -ggdb3 --
C Compiler:
/opt/CodeSourcery/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux/bin/arm-xilinx-linux-gnueabi-gcc --
C flags (Release):
-W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -O3 -DNDEBUG
-DNDEBUG --
C flags (Debug):
-W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -g
-O0 -DDEBUG -D_DEBUG -ggdb3 --
Linker flags (Release):
Linker flags (Debug):
Precompiled headers:
OpenCV modules: --
To be built:
core imgproc flann highgui features2d calib3d ml video objdetect contrib photo legacy gpu nonfree stitching superres ts videostab --
Disabled by dependency:
Unavailable:
androidcamera java ocl python --
OpenGL support:
Media I/O:
zlib (ver 1.2.7) --
JPEG 2000:
Video I/O: --
DC1394 1.x:
DC1394 2.x:
gentoo-style:
GStreamer:
OpenNI PrimeSensor Modules:
GigEVisionSDK:
UniCap ucil:
Other third-party libraries: --
Use Eigen:
Use OpenMP:
Use Concurrency
Use OpenCL:
Python: --
Interpreter:
/usr/bin/python (ver 2.7.3) --
Java tests:
Documentation: --
Build Documentation:
PdfLaTeX compiler:
Tests and samples: --
Performance tests:
C/C++ Examples:
Install path:
/home/jiong/OpenCV-build --
cvconfig.h is in:
/home/jiong/opencv-2.4.5
-- -----------------------------------------------------------------
CMake Warning at CMakeLists.txt:866 (message):
The source directory is the same as binary directory.
&make clean& may
damage the source tree
-- Configuring done -- Generating done -- Build files have been written to: /home/jiong/opencv-2.4.5
可以看到video I/O全都时NO。其实一开时并不是,都是这些第三方库用不了,全部关了的原因。接下来 ccmake .
CMKAE_INSTALL_PREFIX修改安装路径,可以修改第三方库是否打开。试着打开了,都是编译不通过。不知道怎么来交叉编译这些第三方库。
没办法,实在撞墙太久了,受不了了。只好改变思路了:
所以我决定用v4l和v4l2来进行摄像头操作,使用OpenCV进行图像处理。饶了一大圈,又回来了。
不知道以后还不会不会这样,不过也记录下来吧。这中间n多的错误都是库或者头文件找不到,想想也就是这样的。
要是有人看到我的这篇痛苦经历,有什么好方法可以治愈一下我这受伤的心灵,还望不灵赐教啊!!!!!!!!!!!!
接下来就进行下面的方法了,参照博客
经过WICOBOY的帮助,换了台电脑终于编译成功,内在原因不是很清楚。 这里贴上WICOBOY的帖子,去他那里下载的库也是可以用的!!
http://www.openhw.org/wicoboy/blog/13-04/92.html
再次感谢WICOBOY!
下一篇:IT 人生
旗下网站:
与非门科技(北京)有限公司 All Rights Reserved.
京ICP证:070212号
北京市公安局备案编号: 京ICP备:号}

我要回帖

更多关于 opencv调用摄像头 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信