Code Monkey home page Code Monkey logo

Comments (7)

kongqw avatar kongqw commented on May 30, 2024

没有呀,可以正常运行呢,您这有没有什么log信息。

from opencvforandroid.

Tfancy avatar Tfancy commented on May 30, 2024

错误信息就是mCascadeClassifier这个检测器报了个空指针,我看github上的代码也没有那个xml的啊

Process: kong.qingwei.opencv320, PID: 14634
java.lang.NullPointerException
at com.kongqw.ObjectDetector.detectObject(ObjectDetector.java:106)
at com.kongqw.ObjectDetectingView.onCameraFrame(ObjectDetectingView.java:51)
at org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:392)
at org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:355)
at java.lang.Thread.run(Thread.java:841)

from opencvforandroid.

kongqw avatar kongqw commented on May 30, 2024

clone后改过程序吗?createDetector(Context context, int id) 的 id 要传入R.raw.xxx
xxx 是 main/res/raw/ 下的xml文件,检查一下。

from opencvforandroid.

Tfancy avatar Tfancy commented on May 30, 2024

image
没改过的,createDetector方法也传了R.raw.xxx了的。现在就是我点击完目标检测,程序就会实例化那几个检测器(都赋值了null),再点一下人脸检测,程序就奔溃了。

from opencvforandroid.

kongqw avatar kongqw commented on May 30, 2024

您这是读取 xml 失败了,raad都返回-1了,检查一下 xml 是否正常。
另外您是什么设备?系统版本?

from opencvforandroid.

Tfancy avatar Tfancy commented on May 30, 2024

大神,真的是和系统版本有关系!
我用的android4.4和android5.1的平板试了都报这个错,用7.1系统的手机来试可以的。

from opencvforandroid.

nominedisorder avatar nominedisorder commented on May 30, 2024

Android 8.1 / OpenCV 3.4.x:
javaDetector = new CascadeClassifier(cascadeFile.getAbsolutePath());
javaDetector.load( cascadeFile.getAbsolutePath()); //添加这个

from opencvforandroid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.