duhao

duhao

0个粉丝

8

问答

0

专栏

0

资料

duhao  发布于  2015-06-06 22:07:14
采纳率 0%
8个问答
3940

opencv移植到hi3515c上的问题

参考1:http://www.ebaina.com/bbs/forum.php?mod=viewthread&tid=4858&extra=page%3D1 参考2: http://ebaina.com/bbs/forum.php?mod=viewthread&tid=5328&highlight=opencv

我用的系统是ubuntu12.04.4 64位,安装了海思3515官方配套的SDK,gcc版本是4.6.3,cmake是2.8.10.1,然后新建一个build和output文件夹: root@duhao-virtual-machine:/home/study/hi-opencv-2.4.10# ls build opencv-2.4.10 output test 进入opencv-2.4.10,进行cmake-gui,然后配置是按参考2中的配置,输出选成上面的output目录 之后进入build目录,开始make和make install,最后在output里面生成 include,lib,share,LICENSE 。没有生成bin文件。: root@duhao-virtual-machine:/home/study/hi-opencv-2.4.10/output# ls include lib LICENSE share 然后将include下的opencv和opencv2拷贝到交叉编译器的include下

把lib下的文件也拷贝到交叉编译器的lib文件下

arm-hisiv100-linux-uclibcgnueabi-g++ face.cpp -I/home/study/hi-opencv-2.4.10/output/include/opencv -lopencv_highgui -lopencv_imgproc -lopencv_core -lpthread -lrt -ljpeg -lpng -lxml2 -lopencv_objdetect -o face 来编译以下参考1的程序

/*Author:9crk 2014-12-24***/

include "cv.h"

include "highgui.h"

include "stdio.h"

/**for time mesurement*****/

include <sys/time.h>

struct timeval tpstart,tpend; unsigned long timeuses; void timeRec() { gettimeofday(&tpstart,0); } int timeRep() { gettimeofday(&tpend,0); timeuses=(tpend.tv_sec-tpstart.tv_sec)*1000000+tpend.tv_usec-tpstart.tv_usec; printf("use time: %uus\n",timeuses); return timeuses; } /****end**/

int main(int argc, char argv[]) { IplImage img = NULL; IplImage cutImg = NULL; CvMemStorage storage = cvCreateMemStorage(0); CvHaarClassifierCascade cascade = (CvHaarClassifierCascade)cvLoad("./haarcascade_frontalface_alt2.xml", 0, 0, 0); CvSeq* faces;

img = cvLoadImage(argv[1], 0);

timeRec(); faces = cvHaarDetectObjects(img, cascade, storage, 1.2, 2, 0, cvSize(25,25) ); timeRep(); if (faces->total == 0){ printf("no face!\n"); } cvSetImageROI(img, ((CvRect)cvGetSeqElem( faces, 0))); cvSaveImage("face.bmp", img);
cvResetImageROI(img); printf("face detected! in face.bmp!\n"); }

出现以下错误: /usr/local/hi-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/lib/libxml2.so: warning: gethostbyname is obsolescent, use getnameinfo() instead. /usr/local/hi-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/lib/libopencv_objdetect.a(haar.cpp.obj): In function cvHaarDetectObjectsForROC(void const*, CvHaarClassifierCascade*, CvMemStorage*, std::vector<int, std::allocator<int> >&, std::vector<double, std::allocator<double> >&, double, int, int, CvSize, CvSize, bool)': haar.cpp:(.text._Z25cvHaarDetectObjectsForROCPKvP23CvHaarClassifierCascadeP12CvMemStorageRSt6vectorIiSaIiEERS5_IdSaIdEEdii6CvSizeSC_b+0x538): undefined reference tocvCvtColor' haar.cpp:(.text._Z25cvHaarDetectObjectsForROCPKvP23CvHaarClassifierCascadeP12CvMemStorageRSt6vectorIiSaIiEERS5_IdSaIdEEdii6CvSizeSC_b+0x16e8): undefined reference to cvCanny' /usr/local/hi-arm/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/lib/libopencv_objdetect.a(cascadedetect.cpp.obj): In functioncv::CascadeClassifier::detectMultiScale(cv::Mat const&, std::vector<cv::Rect, std::allocator<cv::Rect > >&, std::vector<int, std::allocator >&, std::vector<double, std::allocator >&, double, int, int, cv::Size, cv::Size, bool)': cascadedetect.cpp:(.text._ZN2cv17CascadeClassifier16detectMultiScaleERKNS_3MatERSt6vectorINS_5Rect_IiEESaIS6_EERS4_IiSaIiEERS4_IdSaIdEEdiiNS_5Size_IiEESH_b+0x2b4): undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)' collect2: ld returned 1 exit status

这几个错误不懂要怎么改。希望大神来指导一下,感激不尽啊!!!

我来回答
回答2个
时间排序
认可量排序

duhao

0个粉丝

8

问答

0

专栏

0

资料

duhao 2015-06-07 11:54:31
认可0
上面cmake-gui的配置大致如下:


只是输出是上面新建的output文件夹

duhao

0个粉丝

8

问答

0

专栏

0

资料

duhao 2015-06-09 11:14:28
认可0
问题解决,解决方法请看[url]http://ebaina.com/bbs/forum.php?mod=viewthread&tid=7828&extra=[/url]
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
相关问答
无更多相似问答 去提问
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区