rainysky陪你一起在zedboard上移植qt+opencv(六):在zedboard上运行Opencv.docx

上传人:lao****ou 文档编号:834515 上传时间:2024-06-12 格式:DOCX 页数:5 大小:85.49KB
下载 相关 举报
rainysky陪你一起在zedboard上移植qt+opencv(六):在zedboard上运行Opencv.docx_第1页
第1页 / 共5页
rainysky陪你一起在zedboard上移植qt+opencv(六):在zedboard上运行Opencv.docx_第2页
第2页 / 共5页
rainysky陪你一起在zedboard上移植qt+opencv(六):在zedboard上运行Opencv.docx_第3页
第3页 / 共5页
rainysky陪你一起在zedboard上移植qt+opencv(六):在zedboard上运行Opencv.docx_第4页
第4页 / 共5页
rainysky陪你一起在zedboard上移植qt+opencv(六):在zedboard上运行Opencv.docx_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

《rainysky陪你一起在zedboard上移植qt+opencv(六):在zedboard上运行Opencv.docx》由会员分享,可在线阅读,更多相关《rainysky陪你一起在zedboard上移植qt+opencv(六):在zedboard上运行Opencv.docx(5页珍藏版)》请在第一文库网上搜索。

1、rainysky陪你一起在Zedboard上移植qt+opencv(六):在Zedboard上运行Opencv和在PC机上一样,建立文件夹optzedboardOPenCV_zed,复制文件进来,解压缩:建立两个文件夹bui1d、insta11,如下图rootrainysky:opencv_zed#Is3jopencv-2.4.40penCV-2.4.4a.tar.bz2a;root0ratnysky:opencv_zed#cdopencv-2.4.4/bTOOt$ratnysky:opencv-2.4.4#nkdtrbui1drrootratnysky:opencv-2.4.4mkdtrin

2、sta11WWW.。Iecfansxomroot点rainysky:OPenCV2.4.4#Isr3rdpartyappscmakedatainc1udeinsta11aandroidbui1dCMake1tsts.txtdocindex.rsttosiarootranysky:opecv2.4.4在这里和PC不太一样了,需要设置编译环境,在。PenCV-2.4.4下面新建一个文件,文件名为too1chain,cmake,里面的内容为:set(CMAKE_SYSTEM_NAME1inux)set(CMAKE_SYSTEM_PROCESSORarm)set(CMAKE_C_COMPI1ER/ro

3、ot/CodeSourcery/Sourcery_CodeBench_1ite_for_Xi1inx_GNU_1inux/bin/arm-i1in-1inu-gnueabi-gcc)Set(CMAKE_CXX_COMPI1ER/root/CodeSourcery/Sourcery_CodeBench_1ite_for_Xi1inx_GNU_1inux/bin/arm-i1in-1inu-gnueabi-g+)进入bui1d文件里面,输入一下命令进行配置:cmake-DCMAKE_TOO1CHAIN_FI1E=too1chain.cmake-DCMAKE_INSTA11_PREFIX=/opt/

4、zedboard/opencv-zed/opencv-2.4.4/insta11./其中CMAKENSTA11.PREFIX,代表的是安装的路径,最好是新建一个新文件夹好保存,另外需要注意的是,最后的是./小心不要少敲一个点,否则会错的哦。ccmake./进行配置,配置的内容是所有的以WITH开头的选项全部选成OFF,(除了以TH_V41选为ON)因为这些需要第三方库支持的,要是选择这些的话就需要安装第三方库了。按C配置,按g生成并保存1root0ratnysky:opencv-2.4.4#Is3rdpartyappscnakedatainc1udeinsta11nodu1esREADME1,

5、androidbui1dCMake1ists.txtdocindex,rsttosp1atformssamp1esroot0ratnysky:oecv-2.4.4#cpnnthgfs基于Xt1tnxZyq书籍八OOIcha1n.sakeroot0ratnysky:opencv-2.4.4#IsJ3rdpartybui1ddatarandroidcnakedocappsCMake1tsts.txtinc1udeindex.rstinsta11tosnodu1esp1atformsREADMEake,root0rainysky:opencv-2.4.4#ake1root0rainysky:open

6、ev-2.4.4#cdbui1d/Jrootratysky:bui1d*ISroot0ra1nysky:bui1depwd/opt/zedboard/opencv_zed/opencv-2.4.4/bui1drootratnysky:bui1d#cnake-DCMAKEeTOO1CHAIN-FI1EtOo1chatn/A11_PREFIX=/opt/zedboard/opencv_zed/opencv-2.4.Insta11./配置完成后就输入make开始编译,编译完成后就是makeinsta11安装啦。安装完成后在insta11的文件夹里就是运行库啦。新建一个专门写程序的文件夹mkdirop

7、tzedboardopencv-zedcode在里面新建一个测试程序:vimedge_detecti_on.cpp这个代码是教材里面带的那个:/*code*/inc1udecv.hinc1udehighgui.hIp1Image*doCanny(Ip1Image*in,doub1eIowThresh,doub1ehighThresh,doub1eaperture)(if(in-nChanne1s!=1)return(0);/Cannyon1yhand1esgraysca1eimagesIp1Image*out=CvCreateImage(CvGetSize(in),in-depth,/IP1D

8、EPTH_8U,1);CVCanny(in,out,IowThresh,highThresh,aperture);return(out);;intmain(intargc,char*argv)(if(argc!=3)printf(zzargumentserror!formatoriginimage,bmptarget_image.bmpn);Ip1Image*imgrgb=Cv1oadImage(argv1);Ip1Image*imggry=CvCreateImage(cvSize(img_rgb-width,imgrgb-height),img_rgb-depth,1);CvCvtCo1or

9、(img_rgb,img_gry,CV_BGR2GRAY);/CvNamedWindow(Examp1eGray”,CV_WINDOW_AUTOSIZE);/CvNamedWindowCExampIeCanny,CV_WINDOW_AUTOSIZE);/CvShowImage(Examp1eGray”,img_gry);Ip1Image*img_cny=doCanny(img_gry,10,100,3);if(cvSave1mage(argv2,img_cny,0)!-O)printf(,zSaveImageSUCCeSSfU1n);/CvShowImage(Examp1eCanny”,img

10、_cny);/CvWaitKey(O);CvRe1easeImage(&imgrgb);CvRe1easeImage(&imggry);CvRe1easeImage(&imgcny);/CvDestroyWindow(zzExamp1eGrayz,);/CvDestroyWindow(,ExampIeCanny);returnO;)复制一个Iena图像进来,最好是一个.jpg格式和一个.bmp格式(作对比),并输入下面的命令进行交叉编译arm-i1in-1inu-gnueabi-g+-I/opt/zedboard/opencv-zed/opencv-2.4.4/insta11/inc1ude-

11、Ioptzedboard/opencv-zed/opencv-2.4.4/insta11/inc1ude/opencv-1opt/zedboard/opencv-zed/opencv-2.4.4/insta11/1ib-1opencv_core-1opencv_imgproc-1opencv_highgui-1opencv_m1-1opencv_video-1opencv_features2d-1opencv_ca1ib3d-1opencv_objdetect-1opencv_contrib-Iopencv1egacy-1opencv_f1ann./edge_detection.cpp-o./

12、edge_detection.o终端HQSIU,23:171,访客中OGrootraiysky:optzedboardopencv-zedcodefisV-rootratnysky:code#PWdoptzedboardopencv-zedcoderootratysky:code#Isedge-detectton.cpp1ea.bnp1ena.jpgrootrtnysky:codearn-xt1tnx-Iinux-gueabtg*-Ioptzedboardopecv-zedopencv-2.4.tnsta11tnc1ude-I/opt/zedboard/opencv_zed/opencv-2.

13、4.4tsta11tc1udeopecv1optzedboardopencv-zedopencv-2.4.4/tnsta11/1tbIoPenCV_Core-IoPenCVJngproc-IopencvJtghgut-IoPenCVJn1-1opencv-vtdeo-1opencv_features2d-1opencv-ca1tb3d1opencv_objdetect1opecv-cotrtbIoPenCV.1egacy-1opecv-f1an.edge-detectton.cpp-o./edge_detectton.oInfi1einc1udedfronoptzedboardopecv-ze

14、dopencv2cv2/f1ann/kneans_index.h:58:8,fronoptzedboardopecv-zedopecv2cv2f1ana11-tdtces.h:38,fronoptzedboardopecv-zedopecv2cv2f1anf1ann-base.hpp:44,fronoptzedboardopecv-zedopecv-2cv2f1anf1ann.hpp:50,fronoptzedboardopecv-zedopecv2cv/cv.h:69,4.Insta11/InC1Ude/open4.4八nsta11八r1udeOPen4.41nsta11tc1udeopen

15、4.4/tnsta11./tnc1u(Je/open4.4/tnsta11/tnc1.ude/openfrom.edge-detectton.cpp:25:optzedboardopencv-zedopencv-2.4.4/tnstaI1/tnc1.ude/opencv2/f1a1ogger.h:73:9:note:themang1ingofva-1tst,haschangedtnGCC4.4rootratnysky:code*Isedge_detectton.cppedge-detectto.o1ena.bmp1ena.jpgrootratnysky:COde/WWW.e1ecF如果要是想在zedboard板卡上面运行,还需要将opencv交

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 应用文档 > 工作总结

copyright@ 2008-2022 001doc.com网站版权所有   

经营许可证编号:宁ICP备2022001085号

本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有,必要时第一文库网拥有上传用户文档的转载和下载权。第一文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知第一文库网,我们立即给予删除!



客服