params.setRecordingHint(true) breaks camera preview on Samsung Galaxy S2 (Bugfix #3705)


Added by Simon Ismair almost 11 years ago. Updated over 10 years ago.


Status:Done Start date:2014-05-22
Priority:Normal Due date:
Assignee:Simon Ismair % Done:

0%

Category:android
Target version:2.4.10
Affected version:2.4.9 (latest release) Operating System:Android
Difficulty:Easy HW Platform:ARM
Pull request:https://github.com/Itseez/opencv/pull/2815

Description

The camera preview using OpenCV is broken on my Samsung Galaxy S2 running Android 4.4.2 (Cyanogenmod 11) - see attached screenshot.

The problem can be fixed in OpenCV 2.4.9 by changing line 150 in org.opencv.android.JavaCameraView.java to params.setRecordingHint(false); (see attached file).

This is a known problem which is also described here: http://answers.opencv.org/question/27600/camera-distorted-on-android-442/


screenshot.png - Screenshot of broken camera preview (183.9 kB) Simon Ismair, 2014-05-22 04:20 pm

JavaCameraView.java (12.7 kB) Simon Ismair, 2014-05-22 04:20 pm


Associated revisions

Revision 65e4df75
Added by Vadim Pisarevsky about 10 years ago

Merge pull request #3705 from SpecLad:unused-nNull

Revision 6a50a51b
Added by Simon Ismair almost 10 years ago

Bugfix #3705: params.setRecordingHint(true) breaks camera preview on Samsung Galaxy S2

History

Updated by Dmitry Retinskiy almost 11 years ago

Hi Simon,

thanks for the fix. Could you submit it as a pullrequest?
See instruction here: http://www.code.opencv.org/projects/opencv/wiki/How_to_contribute

  • Assignee changed from Alexander Smorkalov to Simon Ismair
  • Status changed from New to Open

Updated by Alexander Smorkalov over 10 years ago

  • Pull request set to https://github.com/Itseez/opencv/pull/2815
  • Status changed from Open to Done

Updated by Robert Nitsch over 10 years ago

I would like to add that there are more affected devices, for example the LG G3. Also, please note that it's not just the preview that is broken by this issue; instead, the camera frames themselves are broken (they're stretched like hell). This means that it can break detection of QR codes etc. It seems that some manufacturers have completely messed up the setRecordingHint functionality.

By the way: On our devices, turning off setRecordingHint reduced the performance on a single device only (Nexus 4, performance dropped in half). All other devices were unaffected.

Also available in: Atom PDF