无法加载在OpenCV中haarcascadeshaarcascade.xml [英] unable to load the haarcascadeshaarcascade.xml in opencv

查看:1949
本文介绍了无法加载在OpenCV中haarcascadeshaarcascade.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着在Android中使用OpenCV的人脸检测,但我无法加载对象检测XML文件。

Im trying face detection using opencv in android but I unable to load the object detection xml files.

在code如下,

......

static CvHaarClassifierCascade* cascade = 0;
  CvMemStorage* storage = 0;
  LOGI("before haarcascade");  

if (!cascade) {
    const char* file = "/Users/Downloads/OpenCV-

2.2.0/data/haarcascadeshaarcascade_frontalface_alt.xml";
    cascade = (CvHaarClassifierCascade *)cvLoad(file, 0, 0, 0);
    storage = cvCreateMemStorage(0);
  }  

if(cascade)
      LOGI("xml loaded");
  else
          LOGI("unable to load the xml");

......

......

在它的logcat显示,无法加载XML。

In logcat it showing that unable to load the xml.

如何加载XML ??

How to load the xml??

请人帮助我。

谢谢, 斯里尼瓦桑

推荐答案

蠢问题...但该文件确实存在,不是吗?

Daft question... but the file does exist doesn't it?

如果是code运行在Android设备上,但主机上的文件是否存在键(Mac OS)的工作站,你的运气了!

If that code runs on your android device, but the file exists on the host (Mac OS) workstation you're out of luck!

这篇关于无法加载在OpenCV中haarcascadeshaarcascade.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆