Ask Your Question
1

face-detection sample not work

asked 2015-01-15 01:16:22 -0500

updated 2015-01-15 01:22:03 -0500

berak gravatar image

Hi

OpenCV-2.4.10 Nexus 5

Eclipse + ADT import face-detection of sample. But not work. please tell me.

E/AndroidRuntime(21705): FATAL EXCEPTION: main E/AndroidRuntime(21705): Process: org.opencv.samples.facedetect, PID: 21705 E/AndroidRuntime(21705): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.opencv.samples.facedetect/org.opencv.samples.facedetect.FdActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class org.opencv.android.JavaCameraView E/AndroidRuntime(21705): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184) E/AndroidRuntime(21705): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) E/AndroidRuntime(21705): at android.app.ActivityThread.access$800(ActivityThread.java:135) E/AndroidRuntime(21705): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) E/AndroidRuntime(21705): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(21705): at android.os.Looper.loop(Looper.java:136) E/AndroidRuntime(21705): at android.app.ActivityThread.main(ActivityThread.java:5001) E/AndroidRuntime(21705): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(21705): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime(21705): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) E/AndroidRuntime(21705): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) E/AndroidRuntime(21705): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime(21705): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class org.opencv.android.JavaCameraView E/AndroidRuntime(21705): at android.view.LayoutInflater.createView(LayoutInflater.java:620) E/AndroidRuntime(21705): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) E/AndroidRuntime(21705): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) E/AndroidRuntime(21705): at android.view.LayoutInflater.inflate(LayoutInflater.java:492) E/AndroidRuntime(21705): at android.view.LayoutInflater.inflate(LayoutInflater.java:397) E/AndroidRuntime(21705): at android.view.LayoutInflater.inflate(LayoutInflater.java:353) E/AndroidRuntime(21705): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290) E/AndroidRuntime(21705): at android.app.Activity.setContentView(Activity.java:1929) E/AndroidRuntime(21705): at org.opencv.samples.facedetect.FdActivity.onCreate(FdActivity.java:124) E/AndroidRuntime(21705): at android.app.Activity.performCreate(Activity.java:5231) E/AndroidRuntime(21705): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) E/AndroidRuntime(21705): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) E/AndroidRuntime(21705): ... 11 more E/AndroidRuntime(21705): Caused by: java.lang.reflect.InvocationTargetException E/AndroidRuntime(21705): at java.lang.reflect.Constructor.constructNative(Native Method) E/AndroidRuntime(21705): at java.lang.reflect.Constructor.newInstance(Constructor.java:423) E/AndroidRuntime(21705): at android.view.LayoutInflater.createView(LayoutInflater.java:594) E/AndroidRuntime(21705): ... 22 more E/AndroidRuntime(21705): Caused by: java.lang.NoClassDefFoundError: org.opencv.R$styleable E/AndroidRuntime(21705): at org.opencv.android.CameraBridgeViewBase.<init>(CameraBridgeViewBase.java:72) E/AndroidRuntime(21705): at org.opencv.android.JavaCameraView.<init>(JavaCameraView.java:62) E/AndroidRuntime(21705): ... 25 more

edit retag flag offensive close merge delete

Comments

I have the same problem...can somebody helps here??

nicorsi gravatar imagenicorsi ( 2015-04-30 08:47:03 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-05-06 15:42:00 -0500

Fabbricio gravatar image

Hi. I followed these steps and works fine.

1 Import the face-detection sample and OPCV Library

image description

2 Remove the wrong link and add a correct link

image description

3 Put the full path of OpenCv.mk (in android.mk)

in my case: include E:\OPEN_CV\OpenCV-2.4.11-android-sdk\sdk\native\jni\OpenCV.mk

image description

4 Configure environment for NDK

image description

5 Configure Build

image description

PS.: You need a NDK. You can download here

That's it.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-01-15 01:16:22 -0500

Seen: 1,377 times

Last updated: May 06 '15