We use proprietary and third party's cookies to improve your experience and our services, identifying your Internet Browsing preferences on our website; develop analytic activities and display advertising based on your preferences. If you keep browsing, you accept its use. You can get more information on our Cookie Policy
Cookies Policy
FIWARE.OpenSpecification.Details.WebUI.2D-3D-Capture - FIWARE Forge Wiki

FIWARE.OpenSpecification.Details.WebUI.2D-3D-Capture

From FIWARE Forge Wiki

Jump to: navigation, search

Contents

Detailed Specifications

RESTful and JavaScript API

The programming API is split in two at this point of development. The split is not final in any form, and primarily serves as a testing ground which allows gathering of material for further processing. The first part of the API is build for the browser as a JavaScript library. The library allows web developer to query capture interfaces, as well as capture data from them in a way it is harmonized across different browsers. The API functionality has been tested on both mobile and desktop browsers. The second part of the API is a RESTful interface for saving and collecting sensor data. At the moment the API allows saving if captured image files with advanced GeoTag information. The aim of it is twofolder: first, it serves as a network service where the device can push data and second, it acts as a datastorage to more advanced processing backends, such as 3D construction (not implemented yet)

JavaScript API

This API is based on the following W3C specifications(geoAPI,OrienationAPI) and current implementation does not assume harmonization of this API through out the browser spectrum. Hence isXXXXSupported set of functions.These functions avoid run-time exceptions due to unsupported W3C functions.

 isDeviceOrientationSupported: Returns true if the browser is able to obtain calculated orientation readings from the accelerometer.
 isDeviceMotionSupported: Returns true if the browser is able to obtain readings from the accelerometer.
 isGeolocationSupported: Returns true if the browser is able to obtain readings from the GPS sensors.
 hasMediaSupport: Returns true if the browser is able to obtain camera feed from the local camera to the video element

Following set of functions accesses the interfaces.

  • showVideo()

Start streaming video from the device camera to a available Video element in the DOM.

   function registerForDeviceMovements(onLocationSuccess,onLocationError,onMotion , options)

If the location is found onLocationSuccess is triggered in case of a failure onLocationError function is triggered. Speed is calculated using GPS and onMotion function updates the speed for every GPS update received.

  • getCurrentLocation()

Returns the GPS coordinates of the current location.

   function getCurrentLocation (callback,options) 

On successful retrieval of current location callback function is triggered.

  • registerDeviceMotionEvents()

Registers to device motion data from the accelerometer. On successful event retrieval handlacceleration, handleAccelerationWithGravity, handleRotation callback functions are triggered respectively. Values are averaged over 2 past values to avoid errors and simple error correction methods are used to avoid sudden value changes.

   function registerDeviceMotionEvents(handlacceleration, handleAccelerationWithGravity, handleRotation)


  • registerDeviceOrentationEvent()

Registers to device orientation data and calls eventHandlingFunction in case of device orientation is changed in along x, y and x axis.

   function registerDeviceOrentationEvent(eventHandlingFunction)

Contemporary major browsers do not provide access to compass or the gyroscope. This values are calculated from the accelerometer. Device dependent Orientation API is implemented to adjust these sensor values to 3D contexts.

  • registerAmbientLightChanges()
   function registerAmbientLightChanges(handleLightValues)
  • subscribe()

This function subscribes to receive data from all of the above functions are call back functions are provided to obtain data

   function subscribe(onLocationSearchSuccess,onLocationServiceSearchError,onMotion, handlacceleration,handleAccelerationWithGravityEvent,handleRotation, handleOrientationChanges)

Existing implementation depends on WebSocket API media transfer and json ans a standard for massaging and streaming.

  • snapshot()

This functions takes a snapshot of the current video feed and appends on the webpage.

  • sendImage()

Uploads an Image to a designated server using web sockets. Depending on the server setup up and running.


  • postImage()

Uploads an Image to a designated server using REST POST.

Following code snippet can be used to take a image and then upload the image with necessary data.

   dAPI = new FIware_wp13.Device("localhost","remote 2d3dCapture server", "local server port" , "WebSocketPORT","LG_stereoscopic" ,"REST server Port");
   dAPI.subscribe(onLocationSearchSuccess, onLocationServiceSearchError, onMotion, handlacceleration, handleAccelerationWithGravityEvent, handleRotation, handleOrientationChanges);
   function upladlImageWithPost(){
        dAPI.snapshot();
        dAPI.postImage();
   }

User And Programmer Guide provides detailed instructions on how to update the APIs and how to use them.

RESTFull API (PRELIMINARY)

The RESTful image storage server API is not included because is highly experimental state, and publishing at this point will cause only confusion. At the same time the image server as such will not be a final deliverable anyway, but a part of larger system, hence the API is not yet here.

Starts the websocket server

Close Web socket Server

Post an Image to be saved in the repository

Retrieve all the data in the database

Get Images that are closest to a given GPS location

Personal tools
Create a book