SlideShare a Scribd company logo
1 of 68
FLAR Workflow
Who is Jesse Freeman?
Technical Architect at
      Roundarch
  10 Years of Flash experience

         Worked for
          Heavy.com,
   Major League Baseball,
      The New York Jets,
      AKQA, HBO, FOX,
  Arista Records and BBDO

   Specialize in Flash workflow,
large scale xml driven Flash apps
 and building Flash Frameworks.     Twitter - @TheFlashBum
Let’s Talk about
Augmented Reality
Augmented Reality (AR)
  is a field of computer research which deals with the
combination of real-world and computer-generated data
 (virtual reality), where computer graphics objects are
          blended into real footage in real time.
What is FLAR?
• Flash Augmented Reality allows us
  superimpose graphics over video.
• In Flash, this is usually done with a webcam
  and a marker card.
• When you hold the card up to the webcam,
  the FLARToolKit is able to detect the
  orientation of the marker and superimpose, in
  this case, a 3d model on top of it.
Jargon
FLARToolKit
     is the name of the Library we will use in order to
 implement AR in our project. This library was created by
Saqoosha and is based on NyARToolkit 2.0.0. It is available
  as open source under the GNU General Public License.
camera_para.dat
is a binary file that is required by the FLARToolkit in
order to run. It represents setting and configuration
                 values for web cams.
Marker or Pattern
   is the name of the graphic FLAR will analyze and
 calculate its orientation from. This graphic is a special
box with a black border and a graphic inside. You need
             this in order to get AR working.
My Background
 with FLAR
• Was inspired by the
  AR GE Flash Site.

• Began writing a library
  for quickly creating
  FLAR projects and wanted a way to
  Debug/Test them.

• Was asked by O'Reilly's InsideRIA.com to
  write a introduction for using
  FLARToolKit.
NASA + FLAR
• While at my last job at @radical.media,
  they selected by the Southwest Research
  Institute to launch a website for a future
  NASA mission to Jupiter called Juno.

• My job was to evaluate the technology,
  understand its limitations/advantages to
  create a strategy for implementing it into
  the JUNO site.

• I created 2 AR demos for NASA to review
  as a proof of concept of the technology’s
  potential.
NASA Demo I
AR Solar System
Why talk about
  workflow and
Augmented Reality?
Building AR apps have 3
 workflow roadblocks
I
Compiling, launching,
 and accessing the
  camera is time
    consuming
II
 Creating and printing
 out new markers for
testing kills trees and is
      “expensive”
III
How can we prototype
  new ideas without
 writing a lot of new
        code?
We need to make a tool
FLARVision Emulator
 Flash Augmented Reality + PaperVision 3D
Architectural
Approach
Incapsulate
       Repetitive Tasks
• Setting up FLARToolKit
• Setting up Papervision
• Creating a video source
• Triggering debug mode
• Reusable code base
Setting Up The
 FLARToolKit
Steps Involved
• Load the camera file
• Load the marker file
• Set a canvas width, height
• Define marker width (scale)
• Create a source (bitmap used to detect the
  marker)
• Create a Transform Matrix
• Set the threshold & confidence when detect
  the marker
Thats a lot of ...




  .. to set up!
ARDetector Class
/**
  * Creates the AR Detector class and have it load in the camera.data
  * and pattern.pat files.
  *
  */
protected function createFlarDetector():void
{
    arDetector = new ARDetector();
    arDetector.addEventListener(Event.COMPLETE, onActivate);
    arDetector.setup('data/camera_para.dat', 'data/flarlogo.pat');
}

/**
  *
  */
protected function onActivate(event:Event):void
{
    init();
}
Encapsulation
the process of compartmentalizing the elements of an
abstraction that constitute its structure and behavior;
   encapsulation serves to separate the contractual
  interface of an abstraction and its implementation.
ARDetector Interface
public interface IARDetector {

    function get flarParam():FLARParam;

    function set src(target:BitmapData):void;

    function setup(cameraURL:String, markerURL:String):void;

    function calculateTransformMatrix(
               resultMat:FLARTransMatResult):void;

    function detectMarker(
               threshold:int = 90,
               confidence:Number = .5):Boolean;
}
Setting up Papervision
• Everyone has their own way of doing it.
• I like to keep my options open.
• Create a simple method in the Main class
  anyone can override with their own
  settings.
• Default setup should be exactly what you
  need to get up and running quickly.
Setup Method
public function setupPapervision():void
 {
    scene = new Scene3D( );
    camera = new FLARCamera3D( arDetector.flarParam );

     // Create the Viewport
     viewport = new Viewport3D( stage.stageWidth, stage.stageHeight, true );
     addChild( viewport );

     // The base node is where all PV3D object should be attached to.
     baseNode = new FLARBaseNode( );
     scene.addChild( baseNode );

     create3dObjects( );

     renderer = new BasicRenderEngine( );

     addChild( new StatsView( renderer ) );
 }
create3dObjects Method
        /**

   
    * This default function is where 3d Objects should be added to PV3D's

   
    * scenes.

   
    */
 
 

   
   protected function create3dObjects():void

   
   {

   
   
 var plane:Plane = new Plane( new WireframeMaterial( 0xff0000 ), 80, 80 );

   
   
 plane.rotationX = 180;

   
   
 baseNode.addChild( plane );

   
   }
Have it your way!
• If you want to customize your
  pv3d setup simply override the
  createPapervision method.
• If you want to add your own
  custom 3d object simply
  override the creat3dObject
  method.
Video Source(s)
• FLARToolKit relies on analyzing a bitmap to
  detect if the marker is present.
• In a normal setup we would draw the
  WebCam “video” feed into a bitmap and
  pass the bitmapdata over to the
  ARDetector.
• Why use just a Video feed?
MarkerEmulator
• First I setup a second papervision instance
  with a single plane.
• Next I used a JPG of the marker for the
  plane's texture.
• Then I have the plane follow the mouse's
  movement.
• Finally I pass the PV3d BitmapData into our
  ARDetector.
Marker Emulator as
    a Source
Debug Mode
• So now we have 2 feeds one from the web
  cam and the other from our second
  papervision instance
• We can switch between the two at any
  time by pressing the spacebar.
• There is only one bitmapdata instance the
  ARDetector watches so we simply switch
  between the two sources when we sample
  the bitmapdata
ARDetecor Source

   
   /**

   
    * Creates a Bitmap for us to scan for valid markers.

   
    *

   
    */
 

   
   protected function createCaptureSource():void

   
   {

   
   
 capturedSrc = new Bitmap(
                   new BitmapData( arDetector.width, arDetector.height, false, 0 ),
                   PixelSnapping.AUTO, true );

   
   
 arDetector.src = capturedSrc.bitmapData;

   
   
 addChild( capturedSrc );

   
   }
Switching between feeds
        /**

   
    * Updates the capturedSrc with new bitmap data.

   
    */
 

   
   protected function updateCaptureBitmap():void

   
   {

   
   
 if(debug || ! video)

   
   
 {

   
   
 
 cardEmulator.render( );

   
   
 
 capturedSrc.bitmapData.draw( cardEmulator.viewport );

   
   
 }

   
   
 else

   
   
 {

   
   
 
 capturedSrc.bitmapData.draw( video );

   
   
 }

   
   }
Lets see a demo
Now what?
Use Case
• So I have this idea for a AR project
• I want to show a cardboard iPod when I
  detect the marker
• I don’t want to spend a lot of time
  configuring the project.
• How do I write the least amount of code
  to test out my 3d model?
CPod FLAREmulator
      Demo
CPod Demo Code
package
{
  import com.flashartofwar.pv3d.componets.CPodContainer;

    public class FLAREmulatorDemo extends FLAREmulator
    {

    public function FLAREmulatorDemo()

   {
  
      super( );

   }

      override protected function create3dObjects():void
      {
        var cpod:CPodContainer = new CPodContainer();
        cpod.attachTo(baseNode) ;
      }


    }
}
And that is just one of the
many workflow tools I build...
Automating Builds
Why Use ANT?
• Ant is cross platform

• Ant works across multiple IDE’s

• Ant can be versioned

• Ant helps automat complex/repetitive
  tasks.
Back To AR In Flash
Things To Keep In Mind
• Detecting the marker with FLAR is CPU
  intensive.
• True 3d in Flash is not native so we rely on
  software-based 3d engines like PV3d &
  Away 3d.
• Webcam video playback at high resolutions
  is intensive. There is no hardware
  acceleration for live video.
The Future of FLAR
• There is a branch of FLARToolKit that uses
  Alchemy to speed up the detection
  process.

• We need better 3d support from Flash
  Player.

• More developers and open source projects.
• Continued interested from companies and
  exposure to AR outside of the Flash
  Platform.
Virtual Physical Computing
          - VPC -
• In physical computing you use an external
  IO device to control what happens on the
  screen.

• In Flash we are limited to a mouse and
  keyboard.

• FLAR opens up a new way to manipulate
  objects on the screen, especially 3d objects.
USPS Virtual Box
Simulator by AKQA
FLAR Innovators
Mikko Haapoja




http://www.mikkoh.com/blog/
Eric Socolofsky - FLARManager




   http://transmote.com
James Alliban




http://jamesalliban.wordpress.com/
Seb Lee-Delisle




http://sebleedelisle.com/
FLAR Resources
http://www.libspark.org/wiki/saqoosha/FLARToolKit/en
http://flartoolkitdocs.org/
http://flaremulator.flashartofwar.com
The Fine Print
This Is Just A Workflow Tool
• This is not production ready code
• This was not meant to ever be used by
  someone who is not a developer
• I cut a lot of corners to make this fit my
  own needs, you should too
• The extensibility of this FLAREmulator may
  have been grossly exaggerated
• Use at your own risk!
Thank You For Watching
              My Site - http://flashbum.com
           My Blog - http://flashartofwar.com
Source Code - http://github.com/theflashbum/FLAREmulator

More Related Content

What's hot

An Introduction to WebVR – or How to make your user sick in 60 seconds
An Introduction to WebVR – or How to make your user sick in 60 secondsAn Introduction to WebVR – or How to make your user sick in 60 seconds
An Introduction to WebVR – or How to make your user sick in 60 secondsGeilDanke
 
How tomakea gameinunity3d
How tomakea gameinunity3dHow tomakea gameinunity3d
How tomakea gameinunity3dDao Tung
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Domkaven yan
 
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...Andrey Karpov
 
Ajax Performance
Ajax PerformanceAjax Performance
Ajax Performancekaven yan
 
How to create a camera2
How to create a camera2How to create a camera2
How to create a camera2Booch Lin
 
From YUI3 to K2
From YUI3 to K2From YUI3 to K2
From YUI3 to K2kaven yan
 
Android Camera Architecture
Android Camera ArchitectureAndroid Camera Architecture
Android Camera ArchitecturePicker Weng
 
Developing for Plone using ArchGenXML / ArgoUML
Developing for Plone using ArchGenXML / ArgoUMLDeveloping for Plone using ArchGenXML / ArgoUML
Developing for Plone using ArchGenXML / ArgoUMLJazkarta, Inc.
 
Real-Time Web Apps & Symfony. What are your options?
Real-Time Web Apps & Symfony. What are your options?Real-Time Web Apps & Symfony. What are your options?
Real-Time Web Apps & Symfony. What are your options?Phil Leggetter
 
Android Building, Testing and reversing
Android Building, Testing and reversingAndroid Building, Testing and reversing
Android Building, Testing and reversingEnrique López Mañas
 
CoffeeScript - TechTalk 21/10/2013
CoffeeScript - TechTalk 21/10/2013CoffeeScript - TechTalk 21/10/2013
CoffeeScript - TechTalk 21/10/2013Spyros Ioakeimidis
 

What's hot (15)

Getting Native with NDK
Getting Native with NDKGetting Native with NDK
Getting Native with NDK
 
An Introduction to WebVR – or How to make your user sick in 60 seconds
An Introduction to WebVR – or How to make your user sick in 60 secondsAn Introduction to WebVR – or How to make your user sick in 60 seconds
An Introduction to WebVR – or How to make your user sick in 60 seconds
 
How tomakea gameinunity3d
How tomakea gameinunity3dHow tomakea gameinunity3d
How tomakea gameinunity3d
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom
 
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
PVS-Studio and Continuous Integration: TeamCity. Analysis of the Open RollerC...
 
Ajax Performance
Ajax PerformanceAjax Performance
Ajax Performance
 
How to create a camera2
How to create a camera2How to create a camera2
How to create a camera2
 
From YUI3 to K2
From YUI3 to K2From YUI3 to K2
From YUI3 to K2
 
Android Camera Architecture
Android Camera ArchitectureAndroid Camera Architecture
Android Camera Architecture
 
Developing for Plone using ArchGenXML / ArgoUML
Developing for Plone using ArchGenXML / ArgoUMLDeveloping for Plone using ArchGenXML / ArgoUML
Developing for Plone using ArchGenXML / ArgoUML
 
Real-Time Web Apps & Symfony. What are your options?
Real-Time Web Apps & Symfony. What are your options?Real-Time Web Apps & Symfony. What are your options?
Real-Time Web Apps & Symfony. What are your options?
 
libGDX: Scene2D
libGDX: Scene2DlibGDX: Scene2D
libGDX: Scene2D
 
Android Building, Testing and reversing
Android Building, Testing and reversingAndroid Building, Testing and reversing
Android Building, Testing and reversing
 
CoffeeScript - TechTalk 21/10/2013
CoffeeScript - TechTalk 21/10/2013CoffeeScript - TechTalk 21/10/2013
CoffeeScript - TechTalk 21/10/2013
 
WebVR - JAX 2016
WebVR -  JAX 2016WebVR -  JAX 2016
WebVR - JAX 2016
 

Viewers also liked

çIzgi romanlar
çIzgi romanlarçIzgi romanlar
çIzgi romanlaroastan
 
çIzgi romanlar
çIzgi romanlarçIzgi romanlar
çIzgi romanlaroastan
 
The impact of innovation on travel and tourism industries (World Travel Marke...
The impact of innovation on travel and tourism industries (World Travel Marke...The impact of innovation on travel and tourism industries (World Travel Marke...
The impact of innovation on travel and tourism industries (World Travel Marke...Brian Solis
 
Open Source Creativity
Open Source CreativityOpen Source Creativity
Open Source CreativitySara Cannon
 
Reuters: Pictures of the Year 2016 (Part 2)
Reuters: Pictures of the Year 2016 (Part 2)Reuters: Pictures of the Year 2016 (Part 2)
Reuters: Pictures of the Year 2016 (Part 2)maditabalnco
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsBarry Feldman
 
The Outcome Economy
The Outcome EconomyThe Outcome Economy
The Outcome EconomyHelge Tennø
 

Viewers also liked (7)

çIzgi romanlar
çIzgi romanlarçIzgi romanlar
çIzgi romanlar
 
çIzgi romanlar
çIzgi romanlarçIzgi romanlar
çIzgi romanlar
 
The impact of innovation on travel and tourism industries (World Travel Marke...
The impact of innovation on travel and tourism industries (World Travel Marke...The impact of innovation on travel and tourism industries (World Travel Marke...
The impact of innovation on travel and tourism industries (World Travel Marke...
 
Open Source Creativity
Open Source CreativityOpen Source Creativity
Open Source Creativity
 
Reuters: Pictures of the Year 2016 (Part 2)
Reuters: Pictures of the Year 2016 (Part 2)Reuters: Pictures of the Year 2016 (Part 2)
Reuters: Pictures of the Year 2016 (Part 2)
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post Formats
 
The Outcome Economy
The Outcome EconomyThe Outcome Economy
The Outcome Economy
 

Similar to FLAR Workflow

426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer ToolsMark Billinghurst
 
Naive application development
Naive application developmentNaive application development
Naive application developmentShaka Huang
 
COSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer ToolsCOSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer ToolsMark Billinghurst
 
Augmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
Augmented World Expo 2013 Mobile AR SDK Comparison and TutorialAugmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
Augmented World Expo 2013 Mobile AR SDK Comparison and TutorialPatrick O'Shaughnessey
 
Augmented Reality With FlarToolkit and Papervision3D
Augmented Reality With FlarToolkit and Papervision3DAugmented Reality With FlarToolkit and Papervision3D
Augmented Reality With FlarToolkit and Papervision3DRoman Protsyk
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAriya Hidayat
 
Getting started with Verold and Three.js
Getting started with Verold and Three.jsGetting started with Verold and Three.js
Getting started with Verold and Three.jsVerold
 
Breizhcamp Rennes 2011
Breizhcamp Rennes 2011Breizhcamp Rennes 2011
Breizhcamp Rennes 2011sekond0
 
Augmented reality in web rtc browser
Augmented reality in web rtc browserAugmented reality in web rtc browser
Augmented reality in web rtc browserALTANAI BISHT
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEBenjamin Cabé
 
Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK
Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK
Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK AugmentedWorldExpo
 
3D Programming Basics: WebGL
3D Programming Basics: WebGL3D Programming Basics: WebGL
3D Programming Basics: WebGLGlobant
 
How to implement camera recording for USB webcam or IP camera in C#.NET
How to implement camera recording for USB webcam or IP camera in C#.NETHow to implement camera recording for USB webcam or IP camera in C#.NET
How to implement camera recording for USB webcam or IP camera in C#.NETOzeki Informatics Ltd.
 
Building AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptBuilding AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptFITC
 
Minko stage3d 20130222
Minko stage3d 20130222Minko stage3d 20130222
Minko stage3d 20130222Minko3D
 
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017Codemotion
 

Similar to FLAR Workflow (20)

426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools
 
Naive application development
Naive application developmentNaive application development
Naive application development
 
COSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer ToolsCOSC 426 Lect. 3 -AR Developer Tools
COSC 426 Lect. 3 -AR Developer Tools
 
ARE 2011 AR Authoring
ARE 2011 AR AuthoringARE 2011 AR Authoring
ARE 2011 AR Authoring
 
Augmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
Augmented World Expo 2013 Mobile AR SDK Comparison and TutorialAugmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
Augmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
 
Augmented Reality With FlarToolkit and Papervision3D
Augmented Reality With FlarToolkit and Papervision3DAugmented Reality With FlarToolkit and Papervision3D
Augmented Reality With FlarToolkit and Papervision3D
 
ARTag
ARTagARTag
ARTag
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile Web
 
Getting started with Verold and Three.js
Getting started with Verold and Three.jsGetting started with Verold and Three.js
Getting started with Verold and Three.js
 
Scaling Cairngorms
Scaling CairngormsScaling Cairngorms
Scaling Cairngorms
 
Breizhcamp Rennes 2011
Breizhcamp Rennes 2011Breizhcamp Rennes 2011
Breizhcamp Rennes 2011
 
Augmented reality in web rtc browser
Augmented reality in web rtc browserAugmented reality in web rtc browser
Augmented reality in web rtc browser
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
 
Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK
Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK
Philipp Nagele (CTO, Wikitude) An Insider Deep-Dive into the Wikitude SDK
 
3D Programming Basics: WebGL
3D Programming Basics: WebGL3D Programming Basics: WebGL
3D Programming Basics: WebGL
 
How to implement camera recording for USB webcam or IP camera in C#.NET
How to implement camera recording for USB webcam or IP camera in C#.NETHow to implement camera recording for USB webcam or IP camera in C#.NET
How to implement camera recording for USB webcam or IP camera in C#.NET
 
Building AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScriptBuilding AR and VR Experiences for Web Apps with JavaScript
Building AR and VR Experiences for Web Apps with JavaScript
 
Minko stage3d 20130222
Minko stage3d 20130222Minko stage3d 20130222
Minko stage3d 20130222
 
Power ai image-pipeline
Power ai image-pipelinePower ai image-pipeline
Power ai image-pipeline
 
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
Giovanni Laquidara - Hello ARCore - Codemotion Milan 2017
 

FLAR Workflow

  • 2. Who is Jesse Freeman?
  • 3. Technical Architect at Roundarch 10 Years of Flash experience Worked for Heavy.com, Major League Baseball, The New York Jets, AKQA, HBO, FOX, Arista Records and BBDO Specialize in Flash workflow, large scale xml driven Flash apps and building Flash Frameworks. Twitter - @TheFlashBum
  • 5. Augmented Reality (AR) is a field of computer research which deals with the combination of real-world and computer-generated data (virtual reality), where computer graphics objects are blended into real footage in real time.
  • 6. What is FLAR? • Flash Augmented Reality allows us superimpose graphics over video. • In Flash, this is usually done with a webcam and a marker card. • When you hold the card up to the webcam, the FLARToolKit is able to detect the orientation of the marker and superimpose, in this case, a 3d model on top of it.
  • 8. FLARToolKit is the name of the Library we will use in order to implement AR in our project. This library was created by Saqoosha and is based on NyARToolkit 2.0.0. It is available as open source under the GNU General Public License.
  • 9. camera_para.dat is a binary file that is required by the FLARToolkit in order to run. It represents setting and configuration values for web cams.
  • 10. Marker or Pattern is the name of the graphic FLAR will analyze and calculate its orientation from. This graphic is a special box with a black border and a graphic inside. You need this in order to get AR working.
  • 12. • Was inspired by the AR GE Flash Site. • Began writing a library for quickly creating FLAR projects and wanted a way to Debug/Test them. • Was asked by O'Reilly's InsideRIA.com to write a introduction for using FLARToolKit.
  • 14. • While at my last job at @radical.media, they selected by the Southwest Research Institute to launch a website for a future NASA mission to Jupiter called Juno. • My job was to evaluate the technology, understand its limitations/advantages to create a strategy for implementing it into the JUNO site. • I created 2 AR demos for NASA to review as a proof of concept of the technology’s potential.
  • 17. Why talk about workflow and Augmented Reality?
  • 18. Building AR apps have 3 workflow roadblocks
  • 19. I Compiling, launching, and accessing the camera is time consuming
  • 20. II Creating and printing out new markers for testing kills trees and is “expensive”
  • 21. III How can we prototype new ideas without writing a lot of new code?
  • 22. We need to make a tool
  • 23. FLARVision Emulator Flash Augmented Reality + PaperVision 3D
  • 25. Incapsulate Repetitive Tasks • Setting up FLARToolKit • Setting up Papervision • Creating a video source • Triggering debug mode • Reusable code base
  • 26. Setting Up The FLARToolKit
  • 27. Steps Involved • Load the camera file • Load the marker file • Set a canvas width, height • Define marker width (scale) • Create a source (bitmap used to detect the marker) • Create a Transform Matrix • Set the threshold & confidence when detect the marker
  • 28. Thats a lot of ... .. to set up!
  • 29. ARDetector Class /** * Creates the AR Detector class and have it load in the camera.data * and pattern.pat files. * */ protected function createFlarDetector():void { arDetector = new ARDetector(); arDetector.addEventListener(Event.COMPLETE, onActivate); arDetector.setup('data/camera_para.dat', 'data/flarlogo.pat'); } /** * */ protected function onActivate(event:Event):void { init(); }
  • 30. Encapsulation the process of compartmentalizing the elements of an abstraction that constitute its structure and behavior; encapsulation serves to separate the contractual interface of an abstraction and its implementation.
  • 31. ARDetector Interface public interface IARDetector { function get flarParam():FLARParam; function set src(target:BitmapData):void; function setup(cameraURL:String, markerURL:String):void; function calculateTransformMatrix( resultMat:FLARTransMatResult):void; function detectMarker( threshold:int = 90, confidence:Number = .5):Boolean; }
  • 32. Setting up Papervision • Everyone has their own way of doing it. • I like to keep my options open. • Create a simple method in the Main class anyone can override with their own settings. • Default setup should be exactly what you need to get up and running quickly.
  • 33. Setup Method public function setupPapervision():void { scene = new Scene3D( ); camera = new FLARCamera3D( arDetector.flarParam ); // Create the Viewport viewport = new Viewport3D( stage.stageWidth, stage.stageHeight, true ); addChild( viewport ); // The base node is where all PV3D object should be attached to. baseNode = new FLARBaseNode( ); scene.addChild( baseNode ); create3dObjects( ); renderer = new BasicRenderEngine( ); addChild( new StatsView( renderer ) ); }
  • 34. create3dObjects Method /** * This default function is where 3d Objects should be added to PV3D's * scenes. */ protected function create3dObjects():void { var plane:Plane = new Plane( new WireframeMaterial( 0xff0000 ), 80, 80 ); plane.rotationX = 180; baseNode.addChild( plane ); }
  • 35. Have it your way! • If you want to customize your pv3d setup simply override the createPapervision method. • If you want to add your own custom 3d object simply override the creat3dObject method.
  • 36. Video Source(s) • FLARToolKit relies on analyzing a bitmap to detect if the marker is present. • In a normal setup we would draw the WebCam “video” feed into a bitmap and pass the bitmapdata over to the ARDetector. • Why use just a Video feed?
  • 37. MarkerEmulator • First I setup a second papervision instance with a single plane. • Next I used a JPG of the marker for the plane's texture. • Then I have the plane follow the mouse's movement. • Finally I pass the PV3d BitmapData into our ARDetector.
  • 38. Marker Emulator as a Source
  • 39. Debug Mode • So now we have 2 feeds one from the web cam and the other from our second papervision instance • We can switch between the two at any time by pressing the spacebar. • There is only one bitmapdata instance the ARDetector watches so we simply switch between the two sources when we sample the bitmapdata
  • 40. ARDetecor Source /** * Creates a Bitmap for us to scan for valid markers. * */ protected function createCaptureSource():void { capturedSrc = new Bitmap( new BitmapData( arDetector.width, arDetector.height, false, 0 ), PixelSnapping.AUTO, true ); arDetector.src = capturedSrc.bitmapData; addChild( capturedSrc ); }
  • 41. Switching between feeds /** * Updates the capturedSrc with new bitmap data. */ protected function updateCaptureBitmap():void { if(debug || ! video) { cardEmulator.render( ); capturedSrc.bitmapData.draw( cardEmulator.viewport ); } else { capturedSrc.bitmapData.draw( video ); } }
  • 42. Lets see a demo
  • 44. Use Case • So I have this idea for a AR project • I want to show a cardboard iPod when I detect the marker • I don’t want to spend a lot of time configuring the project. • How do I write the least amount of code to test out my 3d model?
  • 46. CPod Demo Code package { import com.flashartofwar.pv3d.componets.CPodContainer; public class FLAREmulatorDemo extends FLAREmulator { public function FLAREmulatorDemo() { super( ); } override protected function create3dObjects():void { var cpod:CPodContainer = new CPodContainer(); cpod.attachTo(baseNode) ; } } }
  • 47. And that is just one of the many workflow tools I build...
  • 49. Why Use ANT? • Ant is cross platform • Ant works across multiple IDE’s • Ant can be versioned • Ant helps automat complex/repetitive tasks.
  • 50. Back To AR In Flash
  • 51. Things To Keep In Mind • Detecting the marker with FLAR is CPU intensive. • True 3d in Flash is not native so we rely on software-based 3d engines like PV3d & Away 3d. • Webcam video playback at high resolutions is intensive. There is no hardware acceleration for live video.
  • 53. • There is a branch of FLARToolKit that uses Alchemy to speed up the detection process. • We need better 3d support from Flash Player. • More developers and open source projects. • Continued interested from companies and exposure to AR outside of the Flash Platform.
  • 55. • In physical computing you use an external IO device to control what happens on the screen. • In Flash we are limited to a mouse and keyboard. • FLAR opens up a new way to manipulate objects on the screen, especially 3d objects.
  • 59. Eric Socolofsky - FLARManager http://transmote.com
  • 67. This Is Just A Workflow Tool • This is not production ready code • This was not meant to ever be used by someone who is not a developer • I cut a lot of corners to make this fit my own needs, you should too • The extensibility of this FLAREmulator may have been grossly exaggerated • Use at your own risk!
  • 68. Thank You For Watching My Site - http://flashbum.com My Blog - http://flashartofwar.com Source Code - http://github.com/theflashbum/FLAREmulator

Editor's Notes