Dual-fisheye Images With THETA V Plug-in

Hi, @codetricity, @jcasman, @Svendus
This is the result of stitching Dual-Fisheye images of THETA V(2 shots,90 degrees apart by bracketing mode)

1.Dual-Fisheye images stitched by PTGui Ver.11.5


You can also see the image on Google Maps.Here.

2.Norma HDR Ev+1 shooting(Same position)

3.Screenshot of PTGui
ptgui_test03_01

As I am not an expert of PTGui, I asked Office BlueSkys to assist me. That’s why I could successfully stitch them. Now I can do the same, too. However, this result is not “Very Good”. We need correct lens information to get much better result. Your advice would be highly appreciated.

Regards,
Toyo

1 Like

You should make Your own template after that you can Batch Stitch hundreds off images on a go

i still wonder why a raw and bracketing mood are not standard on a Ricoh Theta V

regards Svendus

1 Like

I am new to the Ricoh Theta V and really want to use the fisheye images. In trying to get this set up I upgraded to Firmware 2.31.1 from 1.x(i dont remember exactly what it was). I followed the instructions from http://theta360.guide/plugin-guide/fisheye/, but whenever I hold the “Mode” button down the plugin doesn’t launch. Instead the Remote Playback app opens instead. I can not seem to disable this feature. I did find one dual-fisheye image in the image storage, but that is it. Any suggestions? Is there an older firmware I can revert to?

I can confirm that the dualfisheye_plugin.apk is installed on the camera, and I did change all its permissions.

With the desktop app (mobile app will also work), go to Plug-in management…

image

I believe that the name of the dual-fisheye app will be “plugin application” It’s two apps above the Wireless Live Streaming plug-in in the picture below.

image

the mobile app has a similar feature:

image

If you’re still having problems, please share a screenshot of your list of apps with the “Plugin Application” selected.

Also, @jcasman spoke to the developer today and he’s going to update the application to make it easier to install. He was in the process of moving his house, which delayed getting his plug-in into the THETA Store.

Thanks for your reply @codetricity. That did solve my problem.

I notice that I can’t use PTP to capture images when using the fisheye apk. I was thinking I would delve into modifying the sample apk such that it would capture the dual fisheye image when a PTP capture request is made but I don’t know if this is possible or if I would have to explore a different remote capture method. Has anyone else explored this option? This is my first foray into android programming so I’m sorry if this is a very newbie type of question.

My application here is that I want to register the Ricoh to a radiation detection device such that I can overlay information from the radiation detector onto the captured images from the Ricoh. I already know how to do the registration part, but I need to be able to capture an image on the Ricoh and transfer it via USB to the radiation detection device. We have WiFi, but use it to monitor the radiation detector so it is not available for this purpose so it seems I am stuck using PTP.

If I could use the fisheye apk and PTP then my problems are all solved.

1 Like

There is no example code to use PTP to take the picture. It is theoretically possible, but you would need to add a PTP client Android library to your plug-in. The camera USB API (PTP) is not accessible from the base SDK. I did a web search for a suitable library, but could not find one easily.

Koen Hufkens is using a THETA S with PTP to study changes to leaf colors. Information on his project is here.

I will relay your question to a guy I know at Ricoh. Can you explain why the dual-fisheye is better than an equirectangular image in your application?

1 Like

We manufacture gamma-ray imaging radiation detectors (www.h3dgamma.com). In order to account for parallax between the radiation image and the optical images I have to be able to transform between the fisheye space, cartesian/spherical space, and then finally into equirectangular for the final image which we display on screen.

If I start in fisheye space I can calibrate for the lens parameters which then lets me transform into spherical space, then cartesian, correct for parallax, then sample the parallax corrected image for directions in the radiation-origin space. We have our users enter the distance to source and then after correcting for parallax we can have our optical image match the radiation image to <1 degree. This is what I would normally do for our detectors.

The impetus to use the Ricoh is from a customer who wants to use the 4pi image for pre-job brief work in radiation environments to minimize worker exposure to radiation. We want to mount the Ricoh to our detector, using only the USB cable for comms and have the arm in the detector grab the picture from the Ricoh (without an individual having to press a button). In this case instead of correcting the optical image for parallax to the radiation image, we will correct the radiation image for parallax to the optical image. Without knowing the camera lens parameters and how the image is stitched I can’t correctly do the reverse transformation. I can do a poor job if I just use the equirectangular image, but is more empirical than we want.

Thanks for the information, and if I end up having some success I will update.

1 Like

Thanks for this detailed explanation. I will pass it on. One thing to note is that Ethernet seems to work with the THETA V with some USB OTG adapters. If you have Ethernet and OTG, you can probably trigger the shutter with the simple OSC API.

That might be very useful! I will look into it and update if I have success.

Let me give you some additional info so you don’t waste too much time. I heard from a reliable source that some, but not all, USB OTG Ethernet adapters work. I have not tried this myself as I have a large pile of gear in my office that I need to sort through before I find my USB Ethernet adapter for testing. I just saw the adapter last month. Sigh… I really need to get things organized.

Although the Automatic Face Blur plug-in does provide an example of using the OSC API to take a picture using the OSC API to send an HTTP request to an internal web server, it’s a bit of a convoluted process and the example may not be the best starting point for you. Though, the good point is that you can start with a working configuration and then chip away at the modifications.

The interesting thing with the Automatic Face Blur example is that it does show the LivePreview stream in a web browser. The example below is using Wi-Fi, not Ethernet. I have the camera connecting to my Internet router as a client and the router is assigning the camera an IP address. It seems that this could work with Ethernet and you assign the camera a static IP address stored in the DHCP table. You could try adding the small code to save the image as dual-fish to the existing Automatic Face Blur example, then delete the face detection and blurring parts. Use the dual-fisheye code as a reference. The size of the dual-fisheye image is different.

the normal equirectangular has a resolution of 5376x2688. You need to set the dual-fish image to bigger size of 5792x2896.

 mParameters.setPictureSize(5792, 2896);

image

The good part about the Ethernet OTG is that it should just work, assuming that the adapter works with the THETA V. By this, I mean you don’t have to write any code to support Ethernet. It’s part of the Android OS and should just work.

There are many articles about connecting Android to OTG Ethernet online.

https://www.wirelesshack.org/how-to-connect-a-android-to-wired-ethernet-connection.html

I just ordered this OTG Ethernet adapter listed in the article to test. I do not know if it will work, but the AX88772 chipset seems to be common and cheap at USB $13.89 with free shipping. If it works, I will post a report

1 Like

@BrianKitchen10 I have some new information from a technical guy I know at Ricoh.

  1. PTP can be used in plug-in mode
  2. BLE API can be used in plug-in mode
  3. USB OTG can be used if battery is not an issue

It appears that the USB OTG will not charge the camera, thus, it may not be a good solution.

PTP should work, but we don’t have an example. What happened when you tried to trigger the dual-fisheye image with the USB cable using PTP? Did it not detect the camera? For example, if you were using a Raspberry Pi to test the USB connection, can the Raspberry Pi detect the THETA V?

I’ll do some additional tests myself.

1 Like

You have done so much! I have had to turn my attention to other projects for the last twoish days and will probably get back to it on Monday. I’m testing using ptpcam from libptp2 and get:

PTP: Device Busy
ERROR: Could not Capture

ptpcam will take pictures when the plugin is not enabled. I can get/delete pictures in plugin mode. This kind of seems like the fisheye plugin is holding onto the camera file descriptor and some the other camera app is attempting to respond to the ptp request but cant open the fd.

1 Like

Thanks for your help providing this information. I’ll work with @jcasman to send another question to a technical guy we know at Ricoh.

I’m just taking a guess, but the plug-in may need to be modified to release control of the camera resources. The Camera API referred to below is the plug-in Camera API.

https://api.ricoh/docs/theta-plugin-reference/broadcast-intent/#notifying-completion-of-plug-in

Notifying Camera Device Control

When using “com.theta360.plugin.ACTION_MAIN_CAMERA_CLOSE” with Broadcast Intent, the fact that the plug-in is controlling camera resources will be reported to the camera, and the Camera API will be able to be used.

When using “com.theta360.plugin.ACTION_MAIN_CAMERA_OPEN” with Broadcast Intent, the fact that the plug-in has released camera resources will be reported to the camera, and the Camera API will not be able to be used.

Update August 3, 2018

This is a snippet from a conversation we had with a knowledgeable developer.

all APIs are available under plugin mode. But if the plugin uses Camera API, they will not be supported. Under the case of CameraAPI, it will be the similar status as sleep mode. WebAPI cannot be available, BLE and USB APIs behave as sleep mode.

Update August 4, 2018

Question: Is there any way to take a dual-fisheye image using a USB or Ethernet cable?
Response: No, those APIs can be used for capturing standard still or video. To capture a dual fisheye image, the Camera API needs to be used. Therefore, there are some limitations as sleep mode.

The camera api referenced above is the plug-in Camera API.

Thanks for the updates. So it sounds like I can’t take a dual fisheye using a remote capture command.

What about this idea… I turn the camera on and then put it into plugin-mode (can that be done remotely?). In plugin mode it will take a picture right away. It then falls into a never-ending loop which monitors the image database for the presence of any items. I know I can grab and delete an image from the ricoh remotely even with a plugin active. Whenever I need a picture, I will delete whatever picture is in the database. The plugin will then see the database is empty then it takes another picture. I can then grab that image, and wait to delete it until I next want an image.

Does that seem like it has a prayer of working?

Thanks for all your help with this, you have saved me a huge amount of time not following useless trails.

1 Like

I don’t think you can turn the camera on remotely and then put it into plug-in mode.

If the user can manually put the camera into plug-in mode, you should be able to put the plug-in into the loop you describe and have it check for the image and then take the dual-fisheye. You can then send the image to another source using Wi-Fi, BLE, or a cable.

BTW, I got the Ethernet working with a cheap $14 adapter. However, I think the battery is still draining. I have not done a long-term test yet. I’m also not taking a dual-fisheye picture with this implementation.

Updated Dual-Fisheye apk

There is a new version of the apk, built on 8/6/2018.

It’s available in the Plug-in Application Development Guide

  1. app name should now be DualFisheye Plugin
  2. package name should now be com.hirota41.dualfisheye_plugin
  3. Stability improvement on the latest FW
  4. Reduced interval for 1 shot mode (light blue mode)

This apk is being submitted to the THETA Store, but developers can use it now during the assessment and quality control process. You need to have an unlocked camera, which is free to get unlocked if you join the partner program, which is also free to join right now.

1 Like

Sorry, bad grammar on my part. I meant that I turn the camera on physically and remotely put it into plug in mode. Even if I can’t do that, if what I described should work then it would just be the initial startup where the user would have to do something manually.

Thanks for the ethernet info. I’m going to buy one now.

Thanks for the info about the updated apk, I will also download that now.

I’ll update when I have success with my idea.

@jcasman, do you know if the camera can be put into plug-in mode with the Wi-Fi API or can it be set to boot automatically into plug-in mode? If you don’t know, can you ask your contact at Ricoh?

I seem to remember a discussion about this, but I don’t remember the answer.

@BrianKitchen10 I sent you the direct link to download the updated apk.

Installed DualFisheye Plugin, now with correct application name.

image

Must set permissions manually using Vysor

image

Tests

Single and triple shots work great.

1 Like

HDR test with Picturenaut. 3 image test using default settings for new dual-fisheye plug-in

Interface

Log

Generates a HDR image from multiple photographs ....
MKHDRI - Version 1.33.0434  (2005 - 2011)

locale is : English_United States.1252
file 'D:\Documents\plugin-samples\dual-fisheye\sample images\20180806141130.JPG' (8-BIT 5792x2896) opened
file 'D:\Documents\plugin-samples\dual-fisheye\sample images\20180806141129.JPG' (8-BIT 5792x2896) opened
file 'D:\Documents\plugin-samples\dual-fisheye\sample images\20180806141128.JPG' (8-BIT 5792x2896) opened
EV : 1.321928
estimate brightness transfer functions ...
estimate camera curve for channel 1 ...
estimate camera curve for channel 2 ...
estimate camera curve for channel 3 ...
combining images ...
dynamic range : 77.864608
true EV span  : 6.282896
max radiance  : 1.16555
success

Stitching

Converted of picturenaut from tiff to jpg format.
Using PTGui for the stitch test. Note that stitching is not perfect with PTGui and is shown only as a rough test. I’ll repeat the HDR test with Ichi’s stitching library when I receive the updated version.

1 Like