Error copying Mat object with Android

asked 2014-09-12 04:29:35 -0500

carlosb gravatar image

I am using the class JavaCameraVIew and CvCameraViewListener2 for a Android application. With these classe, i am trying to get each frame and analyze it but my application works a few minutes and crashes with these errors:

W/InputMethodManagerService(  765): Session failed to close due to remote exception
W/InputMethodManagerService(  765): android.os.DeadObjectException
W/InputMethodManagerService(  765):     at android.os.BinderProxy.transact(Native Method)
W/InputMethodManagerService(  765):     at com.android.internal.view.IInputMethodSession$Stub$Proxy.finishSession(IInputMethodSession.java:292)
...
..
.
D/mm-camera(  199): module_faceproc_client_schedule_mode:1808] apply 2 report 1 new_mode 0
D/JavaCameraView( 2412): Preview Frame received. Frame size: 1843200
D/CameraBridge( 2412): mStretch value: 1.125
D/mm-camera(  199): module_faceproc_client_schedule_mode:1808] apply 3 report 2 new_mode 0
D/JavaCameraView( 2412): Preview Frame received. Frame size: 1843200
D/CameraBridge( 2412): mStretch value: 1.125
...
..
.
W/CameraService(  186): Disconnecting camera client 0xb74c2f88 since the binder for it died (this pid 186)
E/Surface (  186): queueBuffer: error queuing buffer to SurfaceTexture, -32
E/Camera3-OutputStream(  186): returnBufferCheckedLocked: Stream 0: Error queueing buffer to native window: Broken pipe (-32)
E/Camera3-Device(  186): Can't return buffer 1 for frame 197 to its stream:  Broken pipe (-32)
E/Surface (  186): queueBuffer: error queuing buffer to SurfaceTexture, -32
...

I could find the error but i don't know how i should fix it .... The error is if i want to copy a frame in order to apply another operations...

My main Activity.java is:

public class TrackerActivity extends Activity implements CvCameraViewListener2 {
    private JavaCamResView openCVCameraView;
    public TrackerActivity() {
        Log.i(TAG, "Instantiated new " + this.getClass());      
        appContext = (new AppContextFactory()).create();

    }
        ...
        ..
        .

    @Override
    public Mat onCameraFrame(CvCameraViewFrame frame) {
        Mat outputFrame = outputFrame = frame.rgba().clone();   <- the ERROR is here....    
        return outputFrame;
    }

Is it normal that i can not copy input frames..? In my opinion, it shouldn't be a problem.... Furthermore, Does somebody know how i could do to fix this error?

I didn't add all the stacktrace and classes because it can be tedious, but i uploaded in a pastebin web:

http://pastebin.com/PLSaEAbj http://pastebin.com/iwwNG3Ln http://pastebin.com/G9zvwbMZ

edit retag flag offensive close merge delete

Comments

hope, you don't mind, that i killed the duplicate ?

berak gravatar imageberak ( 2014-09-12 04:35:19 -0500 )edit

Thanks @berak, yes, it was duplicated :(

carlosb gravatar imagecarlosb ( 2014-09-12 04:36:22 -0500 )edit