SlideShare una empresa de Scribd logo
1 de 46
AUGMENTED REALITY


     Paolo Quadrani

         MitAPP




      www.MitAPP.com
DEFINITION



• Isa term for a live direct or indirect view of a physical real-
  world environment whose elements are augmented by virtual
  computer-generated imagery. (Wikipedia)




       www.MitAPP.com
HISTORY
•   1966: was invented the head mounted display.

•   1992: The term Augmented Reality has been coined by Thomas
    Caudell.

•   1999: Hirokazu Kato develops ARToolKit and is demonstrated at
    Siggraph in the same year.

•   2008: Wikitude AR Travel Guide is launched with the G1
    Android Phone.

•   2010: acrossair, AR Browser brings AR to the mobile user on the
    iPhone 3Gs.

    www.MitAPP.com
TECHNOLOGY - TRACKING
•   Mobile devices use

    •   Digital camera.

    •   Accelerometers.

    •   GPS.

    •   Gyroscopes, Solid state compasses.

    •   RFID.

    •   Wireless sensors.

           www.MitAPP.com
PROCEDURE

• ImageRegistration: this define
 the way of retrieving the real
 world reference system on
 which over-impose
 computer generated images.

• Toachieve the point above
 are used computer vision
 techniques.

       www.MitAPP.com
LIGHTWEIGHT AUGMENTED
        REALITY
                           es: Wikitude
• Use GPS tracking to
 retrieve the device
 position.

• Usesolid state compass
 to manage the device
 orientation.


    www.MitAPP.com
Ristoranti - Google Maps




     GEO-REFERENCED DATA

• Datacontent has to be
 associated to a GPS position

 • Data   access through

   • web     service

   • local   to a database


     www.MitAPP.com                       © Google
WORKFLOW


               Accelerom
Compass                    Camera
                  eter




Acquire the GPS Position
WORKFLOW


 GPS                      Accelerom
           Compass                    Camera
Position                     eter




           Acquire the GPS Position
RETRIEVING GPS POSITION

• Classes

  • CLLocationManager

  • CLLocation

• Protocol

  • CLLocationManagerDelegate


      www.MitAPP.com
RETRIEVING GPS POSITION
Delegates Methods

 - (void)locationManager:(CLLocationManager*)manager
     didUpdateToLocation:(CLLocation*)newLocation
           fromLocation:(CLLocation*)oldLocation;

 - (void)locationManager:
 (CLLocationManager*)manager
              didFailWithError:(NSError*)error;


   www.MitAPP.com
RETRIEVING GPS POSITION
Delegates Methods

 - (void)locationManager:(CLLocationManager*)manager
     didUpdateToLocation:(CLLocation*)newLocation
           fromLocation:(CLLocation*)oldLocation;


 - (void)locationManager:(CLLocationManager*)manager
               didFailWithError:(NSError*)error;


   www.MitAPP.com
RETRIEVING GPS POSITION
CLLocationManager* manager =
[[CLLocationManager alloc] init];
[manager setDelegate:self];
[manager
setDesiredAccuracy:kCLLocationAccuracyBest];
[manager setDistanceFilter:10];
[manager startUpdatingLocation];




 www.MitAPP.com
RETRIEVING GPS POSITION
CLLocationManager* manager = [[CLLocationManager
alloc] init];
[manager setDelegate:self];
[manager
setDesiredAccuracy:kCLLocationAccuracyBest];
[manager setDistanceFilter:10]; // Distance expressed in
meters
[manager startUpdatingLocation];




 www.MitAPP.com
RETRIEVING GPS POSITION

CLLocationManager* manager = [[CLLocationManager alloc]
init];
[manager setDelegate:self];
[manager setDesiredAccuracy:kCLLocationAccuracyBest];
[manager setDistanceFilter:10];
[manager startUpdatingLocation];




 www.MitAPP.com
RETRIEVING GPS POSITION
- (void)locationManager:(CLLocationManager*)manager
didUpdateToLocation:(CLLocation*)newLocation fromLocation:
(CLLocation*)oldLocation {




    // Use the coordinate data
    double lat = newLocation.coordinate.latitude;
    double lon = newLocation.coordinate.longitude;
}

    www.MitAPP.com
RETRIEVING GPS POSITION
- (void)locationManager:(CLLocationManager*)manager
didUpdateToLocation:(CLLocation*)newLocation fromLocation:
(CLLocation*)oldLocation {

    NSTimeInterval howRecent =
    [newLocation.timestamp timeIntervalSinceNow];

    if (howRecent < -10) return;

    if (newLocation.horizontalAccuracy > 100) return;

    // Use the coordinate data
    double lat = newLocation.coordinate.latitude;
    double lon = newLocation.coordinate.longitude;
}

    www.MitAPP.com
RETRIEVING GPS POSITION
- (void)locationManager:(CLLocationManager*)manager
didUpdateToLocation:(CLLocation*)newLocation fromLocation:
(CLLocation*)oldLocation {

    NSTimeInterval howRecent =
    [newLocation.timestamp timeIntervalSinceNow];

    if (howRecent < -10) return;

    if (newLocation.horizontalAccuracy > 100) return;

    // Use the coordinate data
    double lat = newLocation.coordinate.latitude;
    double lon = newLocation.coordinate.longitude;
}

    www.MitAPP.com
WORKFLOW


 GPS                         Accelerom
                                                 Camera
Position                        eter




       Get the orientation through the Compass
WORKFLOW


 GPS                         Accelerom
               Compass                           Camera
Position                        eter




       Get the orientation through the Compass
USING THE COMPASS

• Classes

  • CLLocationManager

  • CLHeading

• Protocol

  • CLLocationManagerDelegate


      www.MitAPP.com
USING THE COMPASS
Delegates Methods

 - (void)locationManager:(CLLocationManager*)manager
     didUpdateHeading:(CLHeading*)newHeading;

 - (void)locationManagerShouldDisplayHeadingCalibration:
 (CLLocationManager*)manager;




   www.MitAPP.com
USING THE COMPASS
Delegates Methods

 - (void)locationManager:(CLLocationManager*)manager
     didUpdateHeading:(CLHeading*)newHeading;
 -
 (void)locationManagerShouldDisplayHeadingCalibration:
 (CLLocationManager*)manager;



   www.MitAPP.com
USING THE COMPASS
CLLocationManager* manager = [[CLLocationManager alloc] init];
[manager setDelegate:self];
[manager setDesiredAccuracy:kCLLocationAccuracyBest];
[manager setDistanceFilter:10];
[manager startUpdatingLocation];

if ([manager headingAvailable]) {
    [manager setHeadingFilter:2];
    [manager startUpdatingHeading];
} else {
    // Show a message to notify the user that compass is required in AR
    apps.
}


  www.MitAPP.com
USING THE COMPASS
CLLocationManager* manager = [[CLLocationManager alloc] init];
[manager setDelegate:self];
[manager setDesiredAccuracy:kCLLocationAccuracyBest];
[manager setDistanceFilter:10];
[manager startUpdatingLocation];

if ([manager headingAvailable]) {
    [manager setHeadingFilter:2]; // filter value is in degrees.
    [manager startUpdatingHeading];
} else {
    // Show a message to notify the user that compass is required in AR
    apps.
}

  www.MitAPP.com
RETRIEVING GPS POSITION
- (void)locationManager:
(CLLocationManager*)manager didUpdateHeading:
(CLHeading*)newHeading {

    // Use the compass data
    // angle in degree with respect to the magnetic
    north
    double heading = newHeading.magneticHeading;
}

    www.MitAPP.com
WORKFLOW


 GPS
               Compass                          Camera
Position




Catch the Acceleration for detecting device orientation
           and virtual item fine positioning
WORKFLOW


 GPS
               Compass         Accelerometer    Camera
Position




Catch the Acceleration for detecting device orientation
           and virtual item fine positioning
ACCELEROMETERS

• Classes

  • UIAccelerometer

  • UIAcceleration

• Protocol

  • UIAccelerometerDelegate


      www.MitAPP.com
USING THE COMPASS

Delegate Method


 - (void)accelerometer:
 (UIAccelerometer*)accelerometer
     didAccelerate:(UIAcceleration*)acceleration;



   www.MitAPP.com
ACCELEROMETERS

UIAccelerometer* accelerometer = [UIAccelerometer
sharedAccelerometer];
[accelerometer setUpdateInterval: 1/25];
[accelerometer setDelegate:self];




 www.MitAPP.com
ACCELEROMETERS

UIAccelerometer* accelerometer =
[UIAccelerometer sharedAccelerometer];
[accelerometer setUpdateInterval: 1/25];
[accelerometer setDelegate:self];




 www.MitAPP.com
ACCELEROMETERS
- (void)accelerometer:
(UIAccelerometer*)accelerometer
    didAccelerate:(UIAcceleration*)acceleration {

    // Use the accelerometer data
    double accel_x = acceleration.x;
    double accel_y = acceleration.y;
    double accel_z = acceleration.z;
}

    www.MitAPP.com
WORKFLOW


 GPS                         Accelerom
               Compass
Position                        eter




      Get the real world from the device camera
WORKFLOW


 GPS                         Accelerom
               Compass                        Camera
Position                        eter




      Get the real world from the device camera
GETTING THE IMAGE FROM
         THE CAMERA


• UIImagePickerController   class

• UIImagePickerControllerDelegate   protocol




      www.MitAPP.com
GETTING THE IMAGE FROM
       THE CAMERA
if([UIImagePickerController isSourceTypeAvailable:
       UIImagePickerControllerSourceTypeCamera]) {
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    [picker setSourceType:UIImagePickerControllerSourceTypeCamera];
    [picker setDelegate:self];
    [picker setShowCameraControls:NO];
    [picker setNavigationBarHidden:YES];
    [picker setCameraOverlayView:[self view]];
    [self presentModalViewController:picker animated:NO];
    }




     www.MitAPP.com
GETTING THE IMAGE FROM
       THE CAMERA
if([UIImagePickerController isSourceTypeAvailable:
       UIImagePickerControllerSourceTypeCamera]) {
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    [picker setSourceType:UIImagePickerControllerSourceTypeCamera];
    [picker setDelegate:self];
    [picker setShowCameraControls:NO];
    [picker setNavigationBarHidden:YES];
    [picker setCameraOverlayView:[self view]];
    [self presentModalViewController:picker animated:NO];
    }




     www.MitAPP.com
GETTING THE IMAGE FROM
       THE CAMERA
if([UIImagePickerController isSourceTypeAvailable:
       UIImagePickerControllerSourceTypeCamera]) {
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    [picker setSourceType:UIImagePickerControllerSourceTypeCamera];
    [picker setDelegate:self];
    [picker setShowCameraControls:NO];
    [picker setNavigationBarHidden:YES];
    [picker setCameraOverlayView:[self view]];
    [self presentModalViewController:picker animated:NO];
    }




     www.MitAPP.com
GETTING THE IMAGE FROM
       THE CAMERA
if([UIImagePickerController isSourceTypeAvailable:
       UIImagePickerControllerSourceTypeCamera]) {
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    [picker setSourceType:UIImagePickerControllerSourceTypeCamera];
    [picker setDelegate:self];
    [picker setShowCameraControls:NO];
    [picker setNavigationBarHidden:YES];
    [picker setCameraOverlayView:[self view]];
    [self presentModalViewController:picker animated:NO];
    }




     www.MitAPP.com
GETTING THE IMAGE FROM
       THE CAMERA
if([UIImagePickerController isSourceTypeAvailable:
       UIImagePickerControllerSourceTypeCamera]) {
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    [picker setSourceType:UIImagePickerControllerSourceTypeCamera];
    [picker setDelegate:self];
    [picker setShowCameraControls:NO];
    [picker setNavigationBarHidden:YES];
    [picker setCameraOverlayView:[self view]];
    [self presentModalViewController:picker animated:NO];
    }




     www.MitAPP.com
GETTING THE IMAGE FROM
       THE CAMERA
if([UIImagePickerController isSourceTypeAvailable:
       UIImagePickerControllerSourceTypeCamera]) {
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    [picker setSourceType:UIImagePickerControllerSourceTypeCamera];
    [picker setDelegate:self];
    [picker setShowCameraControls:NO];
    [picker setNavigationBarHidden:YES];
    [picker setCameraOverlayView:[self view]];
    [self presentModalViewController:picker animated:NO];
    }




     www.MitAPP.com
PUTTING ALL TOGETHER

• Existing   libraries to use as starting point:

  • NyARToolKit  (free) - http://nyatla.jp/nyartoolkit/wiki/
    index.php?FrontPage.en

  • ARKit    (free) - http://www.iphonear.org/

  • metaio    (free and commercial) - http://www.metaio.com/

       www.MitAPP.com
AR APPLICATIONS ON APPLE
           STORE


• Layar

• Wikitude

• Around   Me



     www.MitAPP.com
VIDEO




www.MitAPP.com
MITAPP



           http://www.mitapp.com/

                 paolo.quadrani@gmail.com

                  cafiniomar@gmail.com

www.MitAPP.com

Más contenido relacionado

Similar a Augmented Reality on iPhone Applications

Breizhcamp Rennes 2011
Breizhcamp Rennes 2011Breizhcamp Rennes 2011
Breizhcamp Rennes 2011
sekond0
 

Similar a Augmented Reality on iPhone Applications (20)

Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.
 
Oculus Rift DK2 + Leap Motion Tutorial
Oculus Rift DK2 + Leap Motion TutorialOculus Rift DK2 + Leap Motion Tutorial
Oculus Rift DK2 + Leap Motion Tutorial
 
Geolocation and Mapping
Geolocation and MappingGeolocation and Mapping
Geolocation and Mapping
 
How to use geolocation in react native apps
How to use geolocation in react native appsHow to use geolocation in react native apps
How to use geolocation in react native apps
 
jai krishna.ppt.pptx
jai krishna.ppt.pptxjai krishna.ppt.pptx
jai krishna.ppt.pptx
 
Breizhcamp Rennes 2011
Breizhcamp Rennes 2011Breizhcamp Rennes 2011
Breizhcamp Rennes 2011
 
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
 
Where 2.0
Where 2.0Where 2.0
Where 2.0
 
Gmaps Railscamp2008
Gmaps Railscamp2008Gmaps Railscamp2008
Gmaps Railscamp2008
 
MSI UI Software Design Report
MSI UI Software Design ReportMSI UI Software Design Report
MSI UI Software Design Report
 
Introduction to MapKit
Introduction to MapKitIntroduction to MapKit
Introduction to MapKit
 
20150811 potatotips 20
20150811 potatotips 2020150811 potatotips 20
20150811 potatotips 20
 
LUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONE
LUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONELUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONE
LUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONE
 
Airflow at WePay
Airflow at WePayAirflow at WePay
Airflow at WePay
 
DIY Uber
DIY UberDIY Uber
DIY Uber
 
Core Location in iOS
Core Location in iOSCore Location in iOS
Core Location in iOS
 
FLAR Workflow
FLAR WorkflowFLAR Workflow
FLAR Workflow
 
Provisioning & Migration with p2: Case study - The Good, the Bad and the Ugly
Provisioning & Migration with p2: Case study - The Good, the Bad and the UglyProvisioning & Migration with p2: Case study - The Good, the Bad and the Ugly
Provisioning & Migration with p2: Case study - The Good, the Bad and the Ugly
 
Recoil at Codete Webinars #3
Recoil at Codete Webinars #3Recoil at Codete Webinars #3
Recoil at Codete Webinars #3
 
Google Maps Api
Google Maps ApiGoogle Maps Api
Google Maps Api
 

Más de Omar Cafini

presentazione MarcheIN
presentazione MarcheINpresentazione MarcheIN
presentazione MarcheIN
Omar Cafini
 

Más de Omar Cafini (12)

Airbag studio - Convegno Autoimprenditorialità - Senigallia 2015
Airbag studio - Convegno Autoimprenditorialità - Senigallia 2015Airbag studio - Convegno Autoimprenditorialità - Senigallia 2015
Airbag studio - Convegno Autoimprenditorialità - Senigallia 2015
 
La mia storia di Libero Professionista
La mia storia di Libero ProfessionistaLa mia storia di Libero Professionista
La mia storia di Libero Professionista
 
PRESENTAZIONE DEI PRINCIPALI SOCIAL MEDIA E LORO UTILIZZO NEL BUSINESS
PRESENTAZIONE DEI PRINCIPALI SOCIAL MEDIA E LORO UTILIZZO NEL BUSINESSPRESENTAZIONE DEI PRINCIPALI SOCIAL MEDIA E LORO UTILIZZO NEL BUSINESS
PRESENTAZIONE DEI PRINCIPALI SOCIAL MEDIA E LORO UTILIZZO NEL BUSINESS
 
Mobile & territorio
Mobile & territorioMobile & territorio
Mobile & territorio
 
Sviluppare e vendere applicazioni per iPhone
Sviluppare e vendere applicazioni per iPhoneSviluppare e vendere applicazioni per iPhone
Sviluppare e vendere applicazioni per iPhone
 
Applicazioni iPhone: un mercato per tutti?
Applicazioni iPhone: un mercato per tutti?Applicazioni iPhone: un mercato per tutti?
Applicazioni iPhone: un mercato per tutti?
 
Making An App
Making An AppMaking An App
Making An App
 
iPhone Development Tools
iPhone Development ToolsiPhone Development Tools
iPhone Development Tools
 
MarcheIN - Il centro benessere delle relazioni
MarcheIN - Il centro benessere delle relazioniMarcheIN - Il centro benessere delle relazioni
MarcheIN - Il centro benessere delle relazioni
 
presentazione MarcheIN
presentazione MarcheINpresentazione MarcheIN
presentazione MarcheIN
 
Bologna In 23 Febbraio2009
Bologna In 23 Febbraio2009Bologna In 23 Febbraio2009
Bologna In 23 Febbraio2009
 
SolidITcamp - Piattaforma Open per favorire la comunicazione delle realtà non...
SolidITcamp - Piattaforma Open per favorire la comunicazione delle realtà non...SolidITcamp - Piattaforma Open per favorire la comunicazione delle realtà non...
SolidITcamp - Piattaforma Open per favorire la comunicazione delle realtà non...
 

Último

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 

Último (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

Augmented Reality on iPhone Applications

  • 1. AUGMENTED REALITY Paolo Quadrani MitAPP www.MitAPP.com
  • 2. DEFINITION • Isa term for a live direct or indirect view of a physical real- world environment whose elements are augmented by virtual computer-generated imagery. (Wikipedia) www.MitAPP.com
  • 3. HISTORY • 1966: was invented the head mounted display. • 1992: The term Augmented Reality has been coined by Thomas Caudell. • 1999: Hirokazu Kato develops ARToolKit and is demonstrated at Siggraph in the same year. • 2008: Wikitude AR Travel Guide is launched with the G1 Android Phone. • 2010: acrossair, AR Browser brings AR to the mobile user on the iPhone 3Gs. www.MitAPP.com
  • 4. TECHNOLOGY - TRACKING • Mobile devices use • Digital camera. • Accelerometers. • GPS. • Gyroscopes, Solid state compasses. • RFID. • Wireless sensors. www.MitAPP.com
  • 5. PROCEDURE • ImageRegistration: this define the way of retrieving the real world reference system on which over-impose computer generated images. • Toachieve the point above are used computer vision techniques. www.MitAPP.com
  • 6. LIGHTWEIGHT AUGMENTED REALITY es: Wikitude • Use GPS tracking to retrieve the device position. • Usesolid state compass to manage the device orientation. www.MitAPP.com
  • 7. Ristoranti - Google Maps GEO-REFERENCED DATA • Datacontent has to be associated to a GPS position • Data access through • web service • local to a database www.MitAPP.com © Google
  • 8. WORKFLOW Accelerom Compass Camera eter Acquire the GPS Position
  • 9. WORKFLOW GPS Accelerom Compass Camera Position eter Acquire the GPS Position
  • 10. RETRIEVING GPS POSITION • Classes • CLLocationManager • CLLocation • Protocol • CLLocationManagerDelegate www.MitAPP.com
  • 11. RETRIEVING GPS POSITION Delegates Methods - (void)locationManager:(CLLocationManager*)manager didUpdateToLocation:(CLLocation*)newLocation fromLocation:(CLLocation*)oldLocation; - (void)locationManager: (CLLocationManager*)manager didFailWithError:(NSError*)error; www.MitAPP.com
  • 12. RETRIEVING GPS POSITION Delegates Methods - (void)locationManager:(CLLocationManager*)manager didUpdateToLocation:(CLLocation*)newLocation fromLocation:(CLLocation*)oldLocation; - (void)locationManager:(CLLocationManager*)manager didFailWithError:(NSError*)error; www.MitAPP.com
  • 13. RETRIEVING GPS POSITION CLLocationManager* manager = [[CLLocationManager alloc] init]; [manager setDelegate:self]; [manager setDesiredAccuracy:kCLLocationAccuracyBest]; [manager setDistanceFilter:10]; [manager startUpdatingLocation]; www.MitAPP.com
  • 14. RETRIEVING GPS POSITION CLLocationManager* manager = [[CLLocationManager alloc] init]; [manager setDelegate:self]; [manager setDesiredAccuracy:kCLLocationAccuracyBest]; [manager setDistanceFilter:10]; // Distance expressed in meters [manager startUpdatingLocation]; www.MitAPP.com
  • 15. RETRIEVING GPS POSITION CLLocationManager* manager = [[CLLocationManager alloc] init]; [manager setDelegate:self]; [manager setDesiredAccuracy:kCLLocationAccuracyBest]; [manager setDistanceFilter:10]; [manager startUpdatingLocation]; www.MitAPP.com
  • 16. RETRIEVING GPS POSITION - (void)locationManager:(CLLocationManager*)manager didUpdateToLocation:(CLLocation*)newLocation fromLocation: (CLLocation*)oldLocation { // Use the coordinate data double lat = newLocation.coordinate.latitude; double lon = newLocation.coordinate.longitude; } www.MitAPP.com
  • 17. RETRIEVING GPS POSITION - (void)locationManager:(CLLocationManager*)manager didUpdateToLocation:(CLLocation*)newLocation fromLocation: (CLLocation*)oldLocation { NSTimeInterval howRecent = [newLocation.timestamp timeIntervalSinceNow]; if (howRecent < -10) return; if (newLocation.horizontalAccuracy > 100) return; // Use the coordinate data double lat = newLocation.coordinate.latitude; double lon = newLocation.coordinate.longitude; } www.MitAPP.com
  • 18. RETRIEVING GPS POSITION - (void)locationManager:(CLLocationManager*)manager didUpdateToLocation:(CLLocation*)newLocation fromLocation: (CLLocation*)oldLocation { NSTimeInterval howRecent = [newLocation.timestamp timeIntervalSinceNow]; if (howRecent < -10) return; if (newLocation.horizontalAccuracy > 100) return; // Use the coordinate data double lat = newLocation.coordinate.latitude; double lon = newLocation.coordinate.longitude; } www.MitAPP.com
  • 19. WORKFLOW GPS Accelerom Camera Position eter Get the orientation through the Compass
  • 20. WORKFLOW GPS Accelerom Compass Camera Position eter Get the orientation through the Compass
  • 21. USING THE COMPASS • Classes • CLLocationManager • CLHeading • Protocol • CLLocationManagerDelegate www.MitAPP.com
  • 22. USING THE COMPASS Delegates Methods - (void)locationManager:(CLLocationManager*)manager didUpdateHeading:(CLHeading*)newHeading; - (void)locationManagerShouldDisplayHeadingCalibration: (CLLocationManager*)manager; www.MitAPP.com
  • 23. USING THE COMPASS Delegates Methods - (void)locationManager:(CLLocationManager*)manager didUpdateHeading:(CLHeading*)newHeading; - (void)locationManagerShouldDisplayHeadingCalibration: (CLLocationManager*)manager; www.MitAPP.com
  • 24. USING THE COMPASS CLLocationManager* manager = [[CLLocationManager alloc] init]; [manager setDelegate:self]; [manager setDesiredAccuracy:kCLLocationAccuracyBest]; [manager setDistanceFilter:10]; [manager startUpdatingLocation]; if ([manager headingAvailable]) { [manager setHeadingFilter:2]; [manager startUpdatingHeading]; } else { // Show a message to notify the user that compass is required in AR apps. } www.MitAPP.com
  • 25. USING THE COMPASS CLLocationManager* manager = [[CLLocationManager alloc] init]; [manager setDelegate:self]; [manager setDesiredAccuracy:kCLLocationAccuracyBest]; [manager setDistanceFilter:10]; [manager startUpdatingLocation]; if ([manager headingAvailable]) { [manager setHeadingFilter:2]; // filter value is in degrees. [manager startUpdatingHeading]; } else { // Show a message to notify the user that compass is required in AR apps. } www.MitAPP.com
  • 26. RETRIEVING GPS POSITION - (void)locationManager: (CLLocationManager*)manager didUpdateHeading: (CLHeading*)newHeading { // Use the compass data // angle in degree with respect to the magnetic north double heading = newHeading.magneticHeading; } www.MitAPP.com
  • 27. WORKFLOW GPS Compass Camera Position Catch the Acceleration for detecting device orientation and virtual item fine positioning
  • 28. WORKFLOW GPS Compass Accelerometer Camera Position Catch the Acceleration for detecting device orientation and virtual item fine positioning
  • 29. ACCELEROMETERS • Classes • UIAccelerometer • UIAcceleration • Protocol • UIAccelerometerDelegate www.MitAPP.com
  • 30. USING THE COMPASS Delegate Method - (void)accelerometer: (UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration; www.MitAPP.com
  • 31. ACCELEROMETERS UIAccelerometer* accelerometer = [UIAccelerometer sharedAccelerometer]; [accelerometer setUpdateInterval: 1/25]; [accelerometer setDelegate:self]; www.MitAPP.com
  • 32. ACCELEROMETERS UIAccelerometer* accelerometer = [UIAccelerometer sharedAccelerometer]; [accelerometer setUpdateInterval: 1/25]; [accelerometer setDelegate:self]; www.MitAPP.com
  • 33. ACCELEROMETERS - (void)accelerometer: (UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration { // Use the accelerometer data double accel_x = acceleration.x; double accel_y = acceleration.y; double accel_z = acceleration.z; } www.MitAPP.com
  • 34. WORKFLOW GPS Accelerom Compass Position eter Get the real world from the device camera
  • 35. WORKFLOW GPS Accelerom Compass Camera Position eter Get the real world from the device camera
  • 36. GETTING THE IMAGE FROM THE CAMERA • UIImagePickerController class • UIImagePickerControllerDelegate protocol www.MitAPP.com
  • 37. GETTING THE IMAGE FROM THE CAMERA if([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; [picker setSourceType:UIImagePickerControllerSourceTypeCamera]; [picker setDelegate:self]; [picker setShowCameraControls:NO]; [picker setNavigationBarHidden:YES]; [picker setCameraOverlayView:[self view]]; [self presentModalViewController:picker animated:NO]; } www.MitAPP.com
  • 38. GETTING THE IMAGE FROM THE CAMERA if([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; [picker setSourceType:UIImagePickerControllerSourceTypeCamera]; [picker setDelegate:self]; [picker setShowCameraControls:NO]; [picker setNavigationBarHidden:YES]; [picker setCameraOverlayView:[self view]]; [self presentModalViewController:picker animated:NO]; } www.MitAPP.com
  • 39. GETTING THE IMAGE FROM THE CAMERA if([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; [picker setSourceType:UIImagePickerControllerSourceTypeCamera]; [picker setDelegate:self]; [picker setShowCameraControls:NO]; [picker setNavigationBarHidden:YES]; [picker setCameraOverlayView:[self view]]; [self presentModalViewController:picker animated:NO]; } www.MitAPP.com
  • 40. GETTING THE IMAGE FROM THE CAMERA if([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; [picker setSourceType:UIImagePickerControllerSourceTypeCamera]; [picker setDelegate:self]; [picker setShowCameraControls:NO]; [picker setNavigationBarHidden:YES]; [picker setCameraOverlayView:[self view]]; [self presentModalViewController:picker animated:NO]; } www.MitAPP.com
  • 41. GETTING THE IMAGE FROM THE CAMERA if([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; [picker setSourceType:UIImagePickerControllerSourceTypeCamera]; [picker setDelegate:self]; [picker setShowCameraControls:NO]; [picker setNavigationBarHidden:YES]; [picker setCameraOverlayView:[self view]]; [self presentModalViewController:picker animated:NO]; } www.MitAPP.com
  • 42. GETTING THE IMAGE FROM THE CAMERA if([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; [picker setSourceType:UIImagePickerControllerSourceTypeCamera]; [picker setDelegate:self]; [picker setShowCameraControls:NO]; [picker setNavigationBarHidden:YES]; [picker setCameraOverlayView:[self view]]; [self presentModalViewController:picker animated:NO]; } www.MitAPP.com
  • 43. PUTTING ALL TOGETHER • Existing libraries to use as starting point: • NyARToolKit (free) - http://nyatla.jp/nyartoolkit/wiki/ index.php?FrontPage.en • ARKit (free) - http://www.iphonear.org/ • metaio (free and commercial) - http://www.metaio.com/ www.MitAPP.com
  • 44. AR APPLICATIONS ON APPLE STORE • Layar • Wikitude • Around Me www.MitAPP.com
  • 46. MITAPP http://www.mitapp.com/ paolo.quadrani@gmail.com cafiniomar@gmail.com www.MitAPP.com

Notas del editor

  1. Per poter visualizzare i dati geo referenziati in AR occorre daterminare la propria posizione rispetto ai dati. Occorre quindi far partire il sistema di acquisizione della posizione GPS e utilizzare i dati che da esso provengono per capire quali dati mostrare.
  2. Delegate Method chiamato dal CLLocationManager quando una nuova posizione GPS viene determinata
  3. Delegate Method chiamato dal CLLocationManager quando c&amp;#x2019;&amp;#xE8; stato un errore nel determinarla (es. non c&amp;#x2019;&amp;#xE8; copertira GPS)
  4. Codice necessario a far partire l&amp;#x2019;acquisizione della posizione GPS. Il codice in giallo permette di creare l&amp;#x2019;instanza del location manager. La classe in cui &amp;#xE8; inserito questo codice (in genere un ViewController) diventa la classe delegate del location manager.
  5. I due metodi evidenziati mostrano come sia possibile scegliere l&amp;#x2019;accuratezza del segnala GPS che si desidera avere durante l&amp;#x2019;acquisizione e quale &amp;#xE8; la soglia minima di aggiornamento tra una posizione e l&amp;#x2019;altra espressa in metri.
  6. Il metodo evidenziato permette di far partire il location manager e quindi l&amp;#x2019;acquisizione del segnale GPS appena disponibile.
  7. Primo metodo delegate chiamato dal location manager quando una nuova posizione GPS &amp;#xE8; disponibile. Il parametro newLocation contiene la nuova posizione, mentre in oldLocation &amp;#xE8; presente l&amp;#x2019;ultima delle posizioni valide precedentemente acquisite. Il codice in giallo mostra come estrarre le coordinate geografiche latitudine e longitudine dalla struttura dati CLLocation.
  8. Un controllo necessario da fare prima di estrarre le informazioni relative alle coordinate &amp;#xE8; quello di verificare che tale posizione non sia estratta dalla cache. Occorre quindi controllare il timestamp della &amp;#x2018;newLocation&amp;#x2019; e verificare che non sia antecedente al tempo attiale di una certa soglia, altrimenti si tratta di un valore preso dalla cache =&gt; da scartare.
  9. Altro controllo da fare &amp;#xE8; relativo all&amp;#x2019;accuratezza della posizione pervenuta dal manager. In questo caso (codice in giallo) si sta scartando la posizione GPS che ha un&amp;#x2019;accuratezza maggiore di 100m. La soglia con cui confrontare il valore estratto da newLocation dipende dal tipo di applicazione che si sta realizzando, quindi va scelto caso per caso. Per un&amp;#x2019;app di AR l&amp;#x2019;accuratezza da accettare dovrebbe essere inferiore o uguale a 10m.
  10. Oltre alla posizione GPS occorre determinare anche l&amp;#x2019;orientazione dell&amp;#x2019;utente rispetto al nord magnetico in maniera tale da capire (per una determinata posizione GPS) verso quali dati l&amp;#x2019;utente si sta orientando e quindi stabilire quali dati mostrare e quali nascondere dalla visualizzazione.
  11. Il metodo evidenziato rappresenta il metodo delegate relativo all&amp;#x2019;aggiornamento del compasso a stato solido presente nell&amp;#x2019;iPhone 3Gs. Questo metodo viene chiamato nel momento in cui un nuovo valore di oriemtamento &amp;#xE8; disponibile.
  12. Il metodo evidenziato rappresenta il metodo delegate relativo all&amp;#x2019;aggiornamento del compasso a stato solido presente nell&amp;#x2019;iPhone 3Gs. Questo metodo viene chiamato nel momento in cui si presenta un&amp;#x2019;interferenza elettromagnetica e/o non &amp;#xE8; possibile calcolare l&amp;#x2019;orientamento. Questo methodo &amp;#xE8; quello che permette di visualizzare l&amp;#x2019;icona della bussola in presenza di disturbi.
  13. Il codice in giallo permette di eseguire il test della disponibilit&amp;#xE0; del compasso a stato solido nell&amp;#x2019;iPhone su cui viene eseguito il codice. In caso di esito positivo, si proceder&amp;#xE0; alla configurazione del compasso.
  14. Il codice evidenziato mostra il parametro di configurazione della frequenza di aggiornamento dei valori (nell&amp;#x2019;esempio ogni 2 gradi) e l&amp;#x2019;istruzione necessaria a far partire l&amp;#x2019;acquisizione dei valori relativi al compasso.
  15. Il codice evidenziato mostra come estrarre l&amp;#x2019;informazione dell&amp;#x2019;orientamento dell&amp;#x2019;utente rispetto al nord magnetico espresso in gradi dalla struttura CLHeading.
  16. Questo tipo di sensore permette di avere un controllo fine dei movimenti dell&amp;#x2019;utente e quindi aggiostare le icone rappresentanti i dati in maniera tale da filtrare i movimenti rapidi del dispositivo. Inoltre &amp;#xE8; possibile gestire eventuali cambi di orientamento del dispositivo e aggiornare conseguentemente la posizione delle icone sullo schermo.
  17. Il metodo rappresenta il delegate relativo all&amp;#x2019;aggiornamento dell&amp;#x2019;accelerometro presente nell&amp;#x2019;iPhone/iPod. Questo metodo viene chiamato nel momento in cui un nuovo valore di accelerazione &amp;#xE8; disponibile.
  18. Il codice in giallo mostra il modo di avere un riferimento all&amp;#x2019;accelerometro di sistema. Non si pu&amp;#xF2; creare una nuova instanza, ma occorre far riferimento all&amp;#x2019;UIAccelerometer unico di sistema.
  19. Il codice in giallo mostra poi come customizzare la frequenza di aggiornamento dell&amp;#x2019;acquisizione dei valori di accelerazione e l&amp;#x2019;assegnazione del delegate oltre ad assegnare chi ricever&amp;#xE0; i dati di aggiornamento scatener&amp;#xE0; l&amp;#x2019;inizio dell&amp;#x2019;acquisizione delle accelerazioni.
  20. Il metodo evidenziato rappresenta il metodo delegate relativo all&amp;#x2019;aggiornamento dell&amp;#x2019;acelerometro. Il parametro &amp;#x2018;acceleration&amp;#x2019; contiene i valori di accelerazione lungo i 3 assi x, y e z.
  21. Ora che si hanno a disposizione tutti i dati di posizione orientamento ed accelerazione, occorre acquisire le informazioni dal mondo reale in maniera da poterci poi sovrapporre quelle provenienti dal mondo &amp;#x2018;sintetico&amp;#x2019;.
  22. Il codice evidenziato permette di eseguire un controllo sul dispositivo della presenza o meno della camera. Per un&amp;#x2019;app di AR &amp;#xE8; decisamente fondamentale che questo tipo di input sia presente.
  23. Si proceder&amp;#xE0; quindi all&amp;#x2019;instanza del&amp;#x2019;ImagePickerController.
  24. ... e all&amp;#x2019;abilitazione del picker per restituirci l&amp;#x2019;immagine proveniente dalla camera e non dalla libreria delle immagini salvate. Quindi assegnamo il delegate per poter ricevere le chiamate di aggiornamento dal picker controller.
  25. Per un&amp;#x2019;app di AR &amp;#xE8; fondamentale l&amp;#x2019;immersivit&amp;#xE0; dei dati nel mondo reale, quindi i due metodi evidenziati permettono di eliminare gli elementi grafici 2D presenti normalmente nel picker che permettono di scattare una foto (il primo) e la navigazione delle foto scattate (il secondo).
  26. Questo &amp;#xE8; il metodo fondamentale per l&amp;#x2019;app di AR, in quanto permette di definire la vista che verr&amp;#xE0; sovrapposta a quela di visualizzazione dell&amp;#x2019;immagine proveniente dalla camera dell&amp;#x2019;iPhone. In questa vista verranno poi disegnate le icone che rappresentano i dati sintetici da sovrapporre all&amp;#x2019;immagine della camera.
  27. E&amp;#x2019; quindi giunto il momento di mostrare l&amp;#x2019;immagine della camera mediante il metodo evidenziato. In questo caso non &amp;#xE8; necessario mostrarlo con l&amp;#x2019;animazione classica dei ViewController presentati in modalit&amp;#xE0; modale, quindi al flag &amp;#x2018;animated&amp;#x2019; viene assegnato NO.
  28. In questa slide viene presentata una lista di librerie disponibili per iPhone (Objective-C) che permettono di costruire un&amp;#x2019;applicazione di AR senza dover pertire da zero. Ovviamente la complessit&amp;#xE0; di un&amp;#x2019;app di AR non &amp;#xE8; banale, quindi conviene appoggiarsi alle librerie esistenti magari modificandole per adattarle all&amp;#x2019;applicazione del caso.