A Python library for interfacing with cameras that implement the OpenSphericalCamera API
- Ricoh Theta S
- Samsung Gear 360 (2017)
- Untested OSC cameras
Usage of the pure OSC API
fromosc.oscimport*# Initializing the class starts a sessioncamera=OpenSphericalCamera() camera.state() camera.info() # Only need to call this if there was a problem# when 'camera' was createdcamera.startSession() # Capture imageresponse=camera.takePicture() # Wait for the stitching to finishcamera.waitForProcessing(response['id']) # Copy image to computercamera.getLatestImage() # Close the sessioncamera.closeSession()Usage of the Ricoh Theta S extended API
fromosc.thetaimportRicohThetaSthetas=RicohThetaS() thetas.state() thetas.info() # Capture imagethetas.setCaptureMode( 'image' ) response=thetas.takePicture() # Wait for the stitching to finishthetas.waitForProcessing(response['id']) # Copy image to computerthetas.getLatestImage() # Stream the livePreview video to disk# for 3 secondsthetas.getLivePreview(timeLimitSeconds=3) # Capture videothetas.setCaptureMode( '_video' ) thetas.startCapture() thetas.stopCapture() # Copy video to computerthetas.getLatestVideo() # Close the sessionthetas.closeSession()The BublOscClient.js client is the only documentation I can find for the Bublcam custom commands. The client was not tested with actual hardware.
The Python Requests library is used to manage all calls to the OSC API.
Install requests with pip:
pip install requests Many thanks to Craig Oda, the author and maintainer of Theta S API Tests repo.
The original author of this library is:
- Haarm-Pieter Duiker
This library was tested with a Ricoh Theta S using Python 2.7 on OSX Yosemite, and a Samsung Gear 360 (2017) on macOS High Sierra.
Copyright (c) 2016 Haarm-Pieter Duiker
See the LICENSE file in this repo