SlideShare uma empresa Scribd logo
1 de 80
Baixar para ler offline
augmented
reality.js
JS.everywhere, 2013
Friday, October 25, 13
@eduardolundgren
Friday, October 25, 13
I’m from brazil
Friday, October 25, 13
Friday, October 25, 13
I ♥ JavaScript

Friday, October 25, 13
jQuery

tracking.js

AlloyUI
jQueryUI
YUI3 nodegh
Liferay jQuery
Simulate

Friday, October 25, 13
jQuery

tracking.js

AlloyUI
jQueryUI
YUI3 nodegh
Liferay jQuery
Simulate

Friday, October 25, 13
jQuery

tracking.js

AlloyUI
jQueryUI
YUI3 nodegh
Liferay jQuery
Simulate

Friday, October 25, 13
jQuery

tracking.js

AlloyUI
jQueryUI
YUI3 nodegh
Liferay jQuery
Simulate

Friday, October 25, 13
jQuery

tracking.js

AlloyUI
jQueryUI
YUI3 nodegh
Liferay jQuery
Simulate

Friday, October 25, 13
jQuery

tracking.js

AlloyUI
jQueryUI
YUI3 nodegh
Liferay jQuery
Simulate

Friday, October 25, 13
jQuery

tracking.js

AlloyUI
jQueryUI
YUI3 nodegh
Liferay jQuery
Simulate

Friday, October 25, 13
jQuery

tracking.js

AlloyUI
jQueryUI
YUI3 nodegh
Liferay jQuery
Simulate

Friday, October 25, 13
jQuery

tracking.js

AlloyUI
jQueryUI
YUI3 nodegh
Liferay jQuery
Simulate

Friday, October 25, 13
today we’re
going to talk
about
augmented
reality...
Friday, October 25, 13
Friday, October 25, 13
...and how to
integrate
different
HTML5 APIs
Friday, October 25, 13
augmented
reality is
everywhere
Friday, October 25, 13
first head-mounted display
Friday, October 25, 13
google glass
Friday, October 25, 13
what is
augmented
reality?
Friday, October 25, 13
terminator
Friday, October 25, 13
terminator
Friday, October 25, 13
what is
visual
tracking?
Friday, October 25, 13
visual tracking
Friday, October 25, 13
how can you
do it using
JavaScript?
Friday, October 25, 13
1. capture
webcam
Friday, October 25, 13
Friday, October 25, 13
dev.w3.org/2011/webrtc/editor/webrtc.html
Friday, October 25, 13
Friday, October 25, 13
STEP 1
Access user's camera
navigator.getUserMedia({
video: true,
audio: true
}, onSuccess, onFail);

Friday, October 25, 13
2. play the
captured video
Friday, October 25, 13
Friday, October 25, 13
STEP 2
Play webcam's content into a video
element
function onSuccess(stream) {
var video = document.querySelector('video');
video.src = window.URL.createObjectURL(stream);
video.onloadedmetadata = function(e) {
// Ready
};
}

Friday, October 25, 13
3. track a
pattern of
pixels
Friday, October 25, 13
Friday, October 25, 13
Friday, October 25, 13
Friday, October 25, 13
javascript typed arrays
Friday, October 25, 13
“Study the past if
you would define
the future”
- Confucius

Friday, October 25, 13
fiducial
markers
Friday, October 25, 13
hitl.washington.edu/artoolkit
Friday, October 25, 13
github.com/kig/JSARToolKit
Friday, October 25, 13
soundstep.com/blog/experiments/jstracking/
Friday, October 25, 13
soundstep.com/blog/experiments/jstracking/
Friday, October 25, 13
bit.ly/XR0aGH
Friday, October 25, 13
bit.ly/XR0aGH
Friday, October 25, 13
what was
the problem?
Friday, October 25, 13
trackingjs.com
Friday, October 25, 13
eduardo.io/3F0d360z2q1P
Friday, October 25, 13
tracking.js
features
Friday, October 25, 13
Friday, October 25, 13
Friday, October 25, 13
eduardo.io/23033L0Q1i3z
Friday, October 25, 13
eduardo.io/23033L0Q1i3z
Friday, October 25, 13
STEP 1

COLOR TRACKING
Import tracking.js core
<script src="tracking.js"></script>

Import tracking.js color module
<script src="tracker/color.js"></script>

Friday, October 25, 13
STEP 2

COLOR TRACKING
Gets user's camera and renders it
var videoCamera = new tracking
.VideoCamera()
.render();

Friday, October 25, 13
STEP 3

COLOR TRACKING
Register tracking for yellow color
videoCamera.track({
type: 'color',
color: 'yellow',
onFound: function() {},
onNotFound: function() {}
});
Friday, October 25, 13
STEP 4

COLOR TRACKING
Paint all detected pixels
onFound: function(track) {
var pixels = track.pixels,
ctx = videoCamera.canvas.context;
for (var i = 0, len = pixels.length; i < len; i += 2) {
ctx.fillStyle = "rgb(255,0,255)";
ctx.fillRect(pixels[i], pixels[i+1], 2, 2);
}
ctx.fillStyle = "rgb(0,0,0)";
ctx.fillRect(track.x, track.y, 5, 5);
}

Friday, October 25, 13
Friday, October 25, 13
eduardo.io/233C2J0Q3z0U
Friday, October 25, 13
eduardo.io/233C2J0Q3z0U
Friday, October 25, 13
STEP 1

FACE DETECTION
Register human tracking for frontal face
videoCamera.track({
type: 'human',
data: 'frontal_face',
onFound: function() {},
onNotFound: function() {}
});
Friday, October 25, 13
STEP 2

FACE DETECTION
Paint all detected faces rectangles
onFound: function(track) {
for (var i = 0, len = track.length; i < len; i++) {
var rect = track[i];
ctx.strokeStyle = "rgb(0,255,0)";
ctx.strokeRect(
rect.x, rect.y, rect.size, rect.size);
}
}

Friday, October 25, 13
real world
examples
Friday, October 25, 13
github.com/auduno/headtrackr
Friday, October 25, 13
webdesign.maratz.com/lab/responsivetypography
Friday, October 25, 13
webdesign.maratz.com/lab/responsivetypography
Friday, October 25, 13
auduno.github.io/headtrackr/examples/targets.html
Friday, October 25, 13
auduno.github.io/headtrackr/examples/targets.html
Friday, October 25, 13
alexhancock.github.io/street-facing
Friday, October 25, 13
alexhancock.github.io/street-facing
Friday, October 25, 13
markerless
tracking
Friday, October 25, 13
unifeye viewer
Friday, October 25, 13
github.com/eduardolundgren/tracking.js
Friday, October 25, 13
let’s see
in action?
Friday, October 25, 13
popularity

Friday, October 25, 13
638 cities
Friday, October 25, 13
445 tweets
Friday, October 25, 13
thank you :)
@eduardolundgren

Friday, October 25, 13

Mais conteúdo relacionado

Semelhante a Augmented Reality in JavaScript

Building Cordova plugins for iOS
Building Cordova plugins for iOSBuilding Cordova plugins for iOS
Building Cordova plugins for iOSGrgur Grisogono
 
Unlocked Workshop OSCON 2013 - Part II
Unlocked Workshop OSCON 2013 - Part IIUnlocked Workshop OSCON 2013 - Part II
Unlocked Workshop OSCON 2013 - Part IIWayne Walls
 
And the Greatest of These Is ... Space
And the Greatest of These Is ... SpaceAnd the Greatest of These Is ... Space
And the Greatest of These Is ... SpaceBen Scofield
 
MOPCON 2013 - APP急速視覺UX回饋應用
MOPCON 2013 - APP急速視覺UX回饋應用MOPCON 2013 - APP急速視覺UX回饋應用
MOPCON 2013 - APP急速視覺UX回饋應用anistar sung
 
Slides changes symfony23
Slides changes symfony23Slides changes symfony23
Slides changes symfony23Javier López
 
JavaOne 2013 - Clojure for Java Developers
JavaOne 2013 - Clojure for Java DevelopersJavaOne 2013 - Clojure for Java Developers
JavaOne 2013 - Clojure for Java DevelopersJan Kronquist
 
Dependency management & Package management in JavaScript
Dependency management & Package management in JavaScriptDependency management & Package management in JavaScript
Dependency management & Package management in JavaScriptSebastiano Armeli
 

Semelhante a Augmented Reality in JavaScript (11)

Building Cordova plugins for iOS
Building Cordova plugins for iOSBuilding Cordova plugins for iOS
Building Cordova plugins for iOS
 
UX, UI, WTF
UX, UI, WTFUX, UI, WTF
UX, UI, WTF
 
Unlocked Workshop OSCON 2013 - Part II
Unlocked Workshop OSCON 2013 - Part IIUnlocked Workshop OSCON 2013 - Part II
Unlocked Workshop OSCON 2013 - Part II
 
And the Greatest of These Is ... Space
And the Greatest of These Is ... SpaceAnd the Greatest of These Is ... Space
And the Greatest of These Is ... Space
 
JQUERY
JQUERY JQUERY
JQUERY
 
MOPCON 2013 - APP急速視覺UX回饋應用
MOPCON 2013 - APP急速視覺UX回饋應用MOPCON 2013 - APP急速視覺UX回饋應用
MOPCON 2013 - APP急速視覺UX回饋應用
 
Reintroducing AlloyUI
Reintroducing AlloyUIReintroducing AlloyUI
Reintroducing AlloyUI
 
RabbitMQ Hands On
RabbitMQ Hands OnRabbitMQ Hands On
RabbitMQ Hands On
 
Slides changes symfony23
Slides changes symfony23Slides changes symfony23
Slides changes symfony23
 
JavaOne 2013 - Clojure for Java Developers
JavaOne 2013 - Clojure for Java DevelopersJavaOne 2013 - Clojure for Java Developers
JavaOne 2013 - Clojure for Java Developers
 
Dependency management & Package management in JavaScript
Dependency management & Package management in JavaScriptDependency management & Package management in JavaScript
Dependency management & Package management in JavaScript
 

Último

Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Último (20)

Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

Augmented Reality in JavaScript