Ask Your Question
0

Samples not working on Samsung Galaxy SL

asked 2012-12-10 11:21:14 -0600

kwyjibo gravatar image

updated 2012-12-12 03:15:30 -0600

It's seems to be something related with the camera interface, both native and not native camera access samples don't work. And that means that app shows up, but only a black screen in showed.

Native camera throws some errors like this:

12-10 16:10:24.179: E/OpenCV::camera(2647): calling (*pGetPropertyC)(0x29c8a8, 2)

A simple example like this (http://marakana.com/forums/android/examples/39.html) works, but I don't see what is the problem. Maybe the surface created?

Here is the software versions I'm working with:

  • Android 2.3.6
  • Android OpenCV SDK 2.4.2
  • OpenCV Manager 2.3
  • OCV 2.4 armeabi-v7a with NEON 2.4.3 rev 3
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2012-12-11 00:52:00 -0600

Could you please, write Android version, OpenCV SDK version, versions of OpenCV Manager and binary packages if some of them are installed. Adb logcat of application execution will be useful too. OpenCV library has some problems with camera on some old Motorolla devices with TI SoC's. Possible, it is the same issue.

edit flag offensive delete link more

Comments

I managed somehow to solve this. The main problem was I can't draw on the same surface the camera is using for preview. I just disabled the lock on the holder, thus disabling what OpenCV may be drawing, but I can live with this, as the data is far more important than the preview. I suppose there is a better way to solve this, as this is not necessary in my other test device, and HTC One S. I'll add the code I modified in the SampleViewBase.java in the Tutorial 0 sample.

kwyjibo gravatar imagekwyjibo ( 2012-12-12 03:33:55 -0600 )edit
0

answered 2012-12-17 13:22:43 -0600

kwyjibo gravatar image

updated 2012-12-17 13:23:32 -0600

So, here is what I did, not a real solution, but it may point someone where the real problem is. As I commented, it seems obvious that you can't draw on the same surface used for the camera preview...

I modified SampleViewBase.java in the Tutorial 0 this way to have it working:

public SampleViewBase(Context context) {
[...]
mHolder.setType( SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS );

}

public void setPreview() throws IOException { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) mCamera.setPreviewTexture( new SurfaceTexture(10) ); else mCamera.setPreviewDisplay(mHolder); }

public void surfaceCreated(SurfaceHolder holder) { Log.i(TAG, "surfaceCreated"); mHolder = holder; (new Thread(this)).start(); }

public void run() { [...] while (mThreadRun) { [...]

    if (bmp != null) {
        /*
        Canvas canvas = mHolder.lockCanvas();
        if (canvas != null) {
            canvas.drawBitmap(bmp, (canvas.getWidth() - getFrameWidth()) / 2, (canvas.getHeight() - getFrameHeight()) / 2, null);
            mHolder.unlockCanvasAndPost(canvas);
        }
        */
    }
}

}

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-12-10 11:21:14 -0600

Seen: 381 times

Last updated: Dec 17 '12