I have created a short version of the NASA TLX questionnaire without weighting) step based on the code provided by Keith Vertanen. The extended version is recommend if you have the time to conduct it. In many papers in the mobile HCI, Augmented Reality and Virtual Reality it is practice to use the non-weighted version. Decide on your own which version to use.
You can find versions of the short questionnaire here:
In my previous post I described my unsuccessful tries on getting simultaneous front and back camera access on a Galaxy S5. I just got a new HTC One M8 and was surprised that it also had a dual camera app (just like the S5) so I tried my code again.
It turned out that it actually works on the HTC device see video below.
Goal Programmatically access video streams of front and back camera of a Samsung Galaxy S4 simultaneously. This feature is available in the Samsung Camera app which ships with the Galaxy S4 as can be seen here:
Summary So far, I have not been successful in programmatically accessing both camera streams at the same time. I tried: 1) the Android API, 2) OpenCV Android Java API, 3) OpenCV Android C++ API. For the results of my individual attempts see below
First Try – Android API The expected way to access both front and back camera for me was to use the official Android Camera API.
The camera object provides the open() function which “Creates a new Camera object to access a particular hardware camera.” In your code you would do something like:
Camera cback = null;
Camera cfront = null;
try {
cback = Camera.open(0);
cfront = Camera.open(1);
}
catch (Exception e){
// Camera is not available (in use or does not exist)
Log.e("camtest", e.toString() );
}
If this would be successful you could continue to create your SurfaceView objects and display the camera streams as explained here. But for me this approach did not work out but rather generated following exception:
java.lang.RuntimeException: Fail to connect to camera service
The OpenCV SDK for Android is a powerful computer vision library which I use for many of my projects. OpenCV for Android provides a Java API which can be used to access the cameras. in fact, OpenCV ships with a bunch of tutorials, including the Camera Preview tutorial. To access the camera you use the CameraBridgeViewBase and the subclass JavaCameraView. Unfortunately, JavaCameraView is merely a wrapper around the Android camera API (as can be seen here on line 85) and hence results in the same problems.
Third try – OpenCV Android Native API OpenCV also gives you the option to use their native camera implementation which can be accessed through NativeCameraView (basically wrapping a VideoCapture object). While working quite well on a number of devices, so far (May 2014, OpenCV version 2.4.9) the Samsung Galaxy S4 does not run the code but rather aborts with (an issue discussed in the OpenCV community):
A/libc(6804): Fatal signal 11 (SIGSEGV) at 0xf5a0000c (code=1), thread 6804 (mples.tutorial1)
Verdict Three attempts, three failures. If you have other ideas what could be tried to programmatically access both camera streams of the back and front camera simultaneously on an Samsung Galaxy S4 please feel free to drop me a line or post a comment.