Camera API Dual-Fisheye Example

Step-by-step video

../_images/cover.png

RICOH Developer Connection GitHub

Go to https://github.com/ricohapi

../_images/ricoh-developer-connection.png

Locate theta-plugin-camera-api-sample

../_images/theta-plugin-camera-api.png

https://github.com/ricohapi/theta-plugin-camera-api-sample

Download, Unzip, Open in Android Studio

../_images/open.png

Go to the plugin folder in your Project view.

../_images/plugin-studio.png

Open CameraFragment

../_images/camerafragment.png

Find RIC_PROC_STITCHING

At roughly line 107, look for parameter RIC_PROC_STITCHING.

../_images/stitch.png

Change to RicNonStitching

Reference the RICOH official API documentation to find the values for stitching.

Use RicNonStitching.

https://api.ricoh/docs/theta-plugin-reference/camera-api/

Change filename

To help with testing, change the filename string from plugin to fisheye.

../_images/filename.png

Change RIC_PROC_STITCHING in takePicture

In takePicture, look for RIC_PROC_STITCHING. Change the value to RicNonStitching.

Change Picture setPictureSize

The dual-fisheye image is larger than the standard equirectangular image. Set the size of the image to 5792 x 2896.

public void takePicture() {
    if (!isCapturing) {
        isCapturing = true;
        isShutter = false;

        mParameters.setPictureSize(5792, 2896);

Save All and Build apk

../_images/build.png

Locate apk and install

../_images/locate.png

Connect camera to your computer with a USB cable.

Use adb install plugin-debug.apk

You can add the path to file by dragging and dropping the file icon onto your command prompt.

../_images/install.png

Look for a Success after install.

../_images/success.png

Note: Your camera needs to be in Developer Mode. You need to join the partner program to enable Developer Mode. It’s free to join the partner program as of Oct 2018.

Use Vysor to Set Permissions

Install Vysor.

Go to Settings.

../_images/vysor-01.png

Go to Apps

../_images/vysor-apps.png

Select CameraAPI Capture Plugin

../_images/vysor-camera.png

Select Permissions

../_images/vysor-permissions.png

Enable Camera, Microphone, Storage

../_images/vysor-enable.png

Confirm that Permissions are enabled.

../_images/vysor-perm-good.png

Take Picture

You can now use Vysor to start the plug-in with the camera still attached to USB.

../_images/vysor-start.png

If you want to use the camera untethered, you must use the RICOH Desktop app to set the default plug-in to launch. There is additional information on setting the default plug-in in the THETA V Plugin Development Community Guide.

cameraapi/img/vysor-perm-start.png

View Images

Connect the THETA V to your computer with a USB cable. You can view the new images you just took with a new image viewer. The THETA acts like a normal camera or mobile phone.

The THETA is called, RICOH THETA V. The images are in Fixed storage > DCIM.

../_images/view-pictures.png

You can view the images by double-clicking on them. Here’s what a sample looks like in Photos.

../_images/view-test.png

You can also check the properties for image details.

../_images/view-details.png

You can view the images in Vysor using the file manager.

../_images/view-vysor.png