Answer the question
In order to leave comments, you need to log in
Android openCV is not streaming from the camera why?
I connected the library to the project normally (via Import module and setting build.gradle and dependencies). I registered the privileges for the camera in the manifest. Everything compiles and runs smoothly. The OpenCV Meneger application is present on the device. Applications on OpenCV from the market work.
Code taken from here . Swears at openCvCameraView.enableView():
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.madt.mycv, PID: 31353
java.lang.UnsatisfiedLinkError: Native method not found: org.opencv.core.Mat.n_Mat:(III)J
at org.opencv.core.Mat.n_Mat(Native Method)
at org.opencv.core.Mat.(Mat.java:37)
at org.opencv.android.JavaCameraView.initializeCamera(JavaCameraView.java:184)
at org.opencv.android.JavaCameraView.connectCamera(JavaCameraView.java:244)
at org.opencv.android.CameraBridgeViewBase.onEnterStartedState(CameraBridgeViewBase.java:360)
at org.opencv.android.CameraBridgeViewBase.processEnterState(CameraBridgeViewBase.java:321)
at org.opencv.android.CameraBridgeViewBase.checkCurrentState(CameraBridgeViewBase.java:313)
at org.opencv.android.CameraBridgeViewBase.surfaceChanged(CameraBridgeViewBase.java:198)
at android.view.SurfaceView.updateWindow(SurfaceView.java:675)
at android.view.SurfaceView.access$000(SurfaceView.java:90)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:195)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:847)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2735)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1321)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6967)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:788)
at android.view.Choreographer.doCallbacks(Choreographer.java:591)
at android.view.Choreographer.doFrame(Choreographer.java:560)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:774)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5348)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
at dalvik.system.NativeStart.main(Native Method)
Answer the question
In order to leave comments, you need to log in
I don't know what was the problem, but here is the working code .
>Methods onPause(), onResume(), onDestroy() removed, because their presence causes an error, which for some reason I could not trace.
So that's where the initialization is. Read errors in logs and fix them.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question