Ask Your Question
1

Camera distorted on android 4.4.2

asked 2014-02-02 09:21:38 -0600

thaffe gravatar image

The Camera on my galaxy s2(Android 4.4.2) looks like this when i run the color blob sample code. The same code works on my galaxy tab 2.

Tried with writing the code from scratch and other sample codes. There are no errors on both devices, but the image looks like this on the S2

Does anybody know how to fix this?

image description

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-04-25 15:43:58 -0600

ekings419 gravatar image

I recently had the same problem. I am using a Galaxy S2 as well, running Android 4.2.2 (from CyanogenMod). I had OpenCV 2.4.5 running okay. This problem showed up when I upgraded to OpenCV 2.4.7. After looking at the source code diff, I found the problem.

In JavaCameraView.java (line 149),

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH){
    params.setRecordingHint(true); //This line is breaking the preview

}

If you change this to params.setRecordingHint(false), or remove it altogether, the preview works again.

edit flag offensive delete link more

Comments

Awesome! I had the exact same problem and this solved it for me, thank you!

eskil gravatar imageeskil ( 2014-05-20 07:17:10 -0600 )edit

Question Tools

Stats

Asked: 2014-02-02 09:21:38 -0600

Seen: 1,190 times

Last updated: Apr 25 '14