Go to https://developer.autodesk.com/en/docs/reality-capture/v1/overview/ for more information
This sample is a command line sample where you control the various ReCap stage individually using one of the command below.
Note: For using those samples you need a valid oAuth credential and a ReCap client ID. Visit this page for instructions to get on-board.
The Reality Capture API Beta provides a web service to create textured mesh from a set of photos, and can request an automatic 3D calibration. The REST API provides a similar service as the Autodesk ReCap 360 web application. The purpose of this sample is to show an application that can provide a Reality Capture work flow using photographic images.
This sample uses PHP to demonstrate how to use the Reality Capture API.
This sample is dependent of the following 3rd party extensions:
- The PHP oAuth extension
- The Guzzle PHP extension, document here
-
Install PHP 5.4.0+
-
make sure to include the openssl and curl extensions in your php.ini
-
after installing PHP on your system, you may need to install the php_oauth extension if your distribution does not yet include it. Copy the dll into your PHP extension folder (I.e.: \ext) and add the following lines in your php.ini
Windows [PHP_OAUTH] extension=php_oauth.dll Linux and OSX hosts [PHP_OAUTH] extension=oauth.so
Getting the PHP oauth extension:
- Windows - You can get precompiled php_oauth.dll for Windows from:
http://windows.php.net/downloads/pecl/releases/oauth (make sure to pick version compatible with your PHP version) - Linux - On Debian host console (or remotely using putty/ssh)
pecl install oauth <may need to install pcre headers (debian based)> <apt-get install libpcre3-dev> service apache2 restart
- Linux - On Fedora host console (or remotely using putty/ssh)
pecl install -R /usr/lib/php oauth-0.99.9 restart apache
- Linux - On CentOS host console (or remotely using putty/ssh)
pecl install oauth server httpd restart
- OSX
Assuming you are using PEAR, the XCode5 Command Line Tools, pecl and autoconf installedbrew install pcre sudo pecl install oauth
- Windows - You can get precompiled php_oauth.dll for Windows from:
-
Install Composer
-
go to your 'PHP' install directory,
-
create a Composer directory (i.e. mkdir Composer)
-
go in your Composer directory (i.e. cd Composer)
-
execute 'php -r "readfile('https://getcomposer.org/installer');" | php'
-
Install Guzzle in your project
-
go to your project directory (i.e. the 'PHP Console' directory)
-
execute 'php composer.phar install'
-
Configure the sample
-
copy UserSettings_.php to UserSettings.php
-
edit UserSettings.php, and replace the following key strings with appropriate value
- CONSUMER_KEY
- CONSUMER_SECRET
- ReCapClientID
-
edit UserSettings.php, and edit the DEFAULT_BROWSER constant with your prefered OS browser to use for authentication.
-
If you wish to use Fiddler to debug Guzzle Curl requests, add the following option to each Guzzle call
[ 'config' => [ 'curl' => [ CURLOPT_PROXY => '127.0.0.1:8888' ] ] ]
an example is provided in AdskReCap.php, line #176
http://guzzle.readthedocs.org/en/latest/faq.html#how-can-i-add-custom-curl-options
http://docs.telerik.com/fiddler/configure-fiddler/tasks/configurephpcurl
Log on the Autodesk oAuth server using the oAuthLog.php script, i.e:
php -f oAuthLog.php
this command needs to be ran only once, unless your credential has expired. The command saves your access token into a file named oauth.txt that the ReCap sample will refresh and consume later.
Usage: ReCap [-d] [-r] [-h] [-i photosceneid] [-c command] [-p photo(s)]
-r Refresh Access token only
-d Debug mode. Display the RESTful response
-c Command list
version - Displays the current ReCap server version
current - Displays the current photosceneid in use
create - Create a new Photoscene
set - Set the current Photoscene ID - requires -i option
release - Release the current photosceneid
list - List all photoscenes present on your account
properties - Displays current Photoscene properties
upload - Upload photo(s) on your current Photoscene - requires -p option (could be a single file, a folder, or a search string)
start - Launch your Photoscene
progress - Launch your Photoscene
result - Get the result
delete - Delete the Photoscene and resources from server
-h Help - this message
php -f oAuthLog.php
php -f ReCap.php -- -c create
php -f ReCap.php -- -c upload -p ../Examples/Tirelire
php -f ReCap.php -- -c properties
php -f ReCap.php -- -c start
php -f ReCap.php -- -c progress
once 'progress' reports no error and completion at 100%
php -f ReCap.php -- -c properties
php -f ReCap.php -- -c result
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Cyrille Fauvel (Autodesk Developer Network)
http://www.autodesk.com/adn
http://around-the-corner.typepad.com/