Android and Processing - 3D Photo Display

I'm learning to write Android apps using both Eclipse and Android Studio. As a fan of the Processing language and platform, I recently found out I can generate an Android app written in Processing too. Processing is a programming environment based on Java for artists and designers. The Processing IDE (Integrated Development Environment) has an alternate output mode for generating Android apps in addition to generating Java applets and applications. There are a number of Android limitations when using Processing, but I think it is pretty cool to be able to write a program in Processing and run it on my Android phone and tablets.

More about installing Processing and writing code for Android can be found at
http://blog.blprnt.com/blog/blprnt/processing-android-mobile-app-development-made-very-easy
and
https://github.com/processing/processing-android/wiki

I wrote a simple test program in Processing to display a photo on my Android phones and tablets.

/*
Simple photo display test for Android device
Written by Andy Modla
*/
String filename;
PImage photo;
void setup() {
    // DO NOT call size() for Android devices!!
    //filename= "walksequence_1920x1080.jpg";
    filename ="hwS14037C.JPG";
    println("displayWidth="+displayWidth + " displayHeight="+displayHeight);
    getImage();
}
void getImage() {
    photo = loadImage(filename);
    if (photo.width > photo.height)
        orientation(LANDSCAPE);
    else
        orientation(PORTRAIT);
    image(photo, 0, 0, displayWidth, displayHeight);
    println( "Image width="+photo.width + " height="+photo.height);
}
void draw() {
}
To install this app on my Android devices, I  first had to reconfigure the tablet or phone in developer mode. This was done by pressing the Settings->About Tablet->Android version label 7 times to see the Settings->Developer Options screen. Then I set USB debugging mode. See http://developer.android.com/tools/device.html for details.

Prior to installing an app from my Windows 7 PC I also had to have USB device drivers installed. By installing PDANet for Android software, hard to find drivers were installed for all my Android tablet devices. For Sony, I used the Sony phone support site USB driver.

Processing makes it very easy to compile, install, and run a Processing sketch as an Android app on the device. Just press "Run on Device" with the tablet connected to the computer via USB cable.

With the above test program running on my Inferno 3D tablet, could I display a 3D photo too?

Since I do not yet know what code to use to set 3D display mode on the tablet using Processing or Java, I did it in a round about way. My solution was to first install the Gadmei 3D Activator app to allow me to toggle/change hardware mode in the tablet to 3D mode. Next the 3D photo used in the test was reworked in Stereo Photo Maker to

1) Resize to 1280x752  with Keep aspect ratio with border option set. The display size is actually 1280x800, but the system menu stays on the screen, so the photo size was adjusted instead of removing the system menu.

2) change it to "Column Interlaced". This is done by the SPM (Stereo Photo Maker) menu Stereo->Interlaced->Column Interlaced and then save as JPG stereo image. When the above app-sketch runs, it displays the photo in 3D after toggling 3D mode on.


The Processing sketch above could be enhanced to resize and interlace the photo before displaying it, but that is for another time. In mean time I'll just use 3DSteroid app.

Glasses Free 3D Tablet


It's not easy to show people my 3D photos with my 21 inch 3D monitor. I have to carry the monitor and computer to an event and setup everything and then provide glasses. To make it simpler, I recently bought a glasses-free Inferno 3D tablet (model 2890). This Android 4.1 tablet has an 8 inch diagonal display (1280x800 pixels) and is similar to Gadmei E8-3D tablets.

Overall I'm pleased with the tablet displaying 3D, it is bright and does a decent job. However looking at the display ghosting will appear in 3D images unless the tablet is held just right, at the sweet spot for viewing. This hand held adjustment is very small and prevents others from viewing 3D photos at the same time -its a one person at a time experience. That is the main drawback to this tablet for 3D viewing. I have similar issues with my large 3D monitor, but the viewing angle is much less critical and the large screen makes up for having to use glasses.

To improve the sharpness and quality of displayed 3D images I had to change the default settings in the tablet. I got a sharper image from the display by turning off Settings->Display->Dynamic Backlight. I also set the brightness slider in Settings->Display->Brightness to about two thirds max.

Amazon reviewers described a better experience with 3D photos after installing the 3DSteroid Android app. The author, Masuji SUTO (Muttyan), also wrote the Stereo Photo Maker for Windows which I use to post-process my photos into 3D images. Many thanks to Masuji SUTO for his excellent and generous work to the stereoscopic community.

I bought the 3DSteroid pro version and found it worked very well with different 3D formats, such as MPO and side_by_side JPG 3D photo files. Plus the pro edition lets you create and adjust 3D photos. Some documentation is at http://stereo.jpn.org/eng/android/help/3dsteroid.htm

I also installed the Stereoscope app by Stereoscopie.fr to more easily set up and use slide shows. I recommend this app too.