Augmented Reality
Augmented Reality
Augmented Reality
3D object is used in AR
We gonna mix real and virtual worlds :)
Special thanks to Valeriya Nikiforova and Jawad Haider for sharing their photos
September 22, 2021 July 2018, river Almatinka and man-made lake Sayran, Kazakhstan
Lessons learnt last time
• Java maps
• Other definitions - ?
What is Augmented Reality (AR)?
• Tracking-based:
GPS + Compass + Gyro + Accelerometer
Marker (Fiduciary, frame, etc.)
NFT (Natural Feature Tracking; 2D images)
3D (Pre-trained point cloud)
Live 3D (Simultaneous localization and mapping)
Face, fingers, body, and other objects that
can be described as Haar-like features
Types of AR (cont.)
• Marker-based:
• Image-based:
Image targets are images that the AR SDK can detect and track
Unlike traditional markers, data matrix codes and QR codes,
image targets do not need special black and white regions or
codes to be recognized
The AR SDK uses sophisticated algorithms to detect and track
the features/key points that are naturally found in the image
itself
Types of AR (cont.)
• Location-based:
• Medical:
Computer scientists get output images from the computer
tomography (CT) for the virtually produced image of the inner
body. A modern spiral-CT makes several X-Ray photographs with
diverse perspectives and then reconstructs their 3-dimensional
perspective. A computer-aided tomogram is clearer than a
normal X-ray photograph because it enables differentiation of the
body’s various types of tissue. The computer scientist then
superimposes the saved CT scans with a real photo of the
patient on the operating table. For surgeons, the impression
produced is that of looking through the skin and throughout the
various layers of the body in 3-dimensions and in color.
AR Applications (cont.)
• Entertainment:
An example: The “virtual watch” is
created by AR technology that allows
the consumer to interact with the
design by twisting their wrist for a 360-
degree view. Shoppers can “try on”
different watches using the wristband
(marker), e.g., http://ar-
watches.com/marker/marker.pdf
AR Applications (cont.)
https://www.youtube.com/watch?v=rKOBR3Vztlo&ab_channel=ARLOOPAAugmented%2FVirtualReality
• Military
The military has been
using displays in
cockpits that present
information to the
pilot on the windshield
of the cockpit or the
visor of the flight
helmet. This is a form
of AR display.
AR Applications (cont.)
• Engineering design:
Integrating drawings and cutouts
with real-world images provides
context for an engineer
AR Applications (cont.)
• Tourism:
• Architecture:
• Education:
Android 10 OS Android 12 OS
AR Java Android App in Android Studio (cont.)
• Compatibility Check
This method checks whether our device can support Sceneform SDK or not.
The SDK requires Android API level 27 or newer and OpenGL ES version 3.0 or
newer. If a device does not support these two, the Scene would not be
rendered, and our app will show a blank screen.
public static boolean checkIsSupportedDeviceOrFinish(final Activity activity) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
Log.e(TAG, "Sceneform requires Android N or later");
Toast.makeText(activity, "Sceneform requires Android N or later", Toast.LENGTH_LONG).show();
activity.finish();
return false;
}
String openGlVersionString =
((ActivityManager) activity.getSystemService(Context.ACTIVITY_SERVICE))
.getDeviceConfigurationInfo()
.getGlEsVersion();
if (Double.parseDouble(openGlVersionString) < MIN_OPENGL_VERSION) {
Log.e(TAG, "Sceneform requires OpenGL ES 3.0 later");
Toast.makeText(activity, "Sceneform requires OpenGL ES 3.0 or later", Toast.LENGTH_LONG)
.show();
activity.finish();
return false;
}
return true;
}
https://medium.com/free-code-camp/how-to-build-an-augmented-reality-android-app-with-arcore-and-android-studio-43e4676cb36f
AR Java Android App in Android Studio (cont.)
• Terminology:
Scene: This is the place where all our 3D objects will be rendered. This scene
is hosted by the AR Fragment which we included in the layout. An anchor node
is attached to this screen which acts as the root of the tree and all the other
objects are rendered as its objects.
HitResult: This is an imaginary line (or a ray) coming from infinity which gives
the point of intersection of itself with a real-world object.
Anchor: An anchor is a fixed location and orientation in the real world. It can
be understood as the (x, y, z) coordinate in the 3D space. We can get an
anchor’s post information from it. Pose is the position and orientation of the
object in the scene. This is used to transform the object’s local coordinate
space into real-world coordinate space.
AnchorNode: This is the node that automatically positions itself in the world.
This is the first node that gets set when the plane is detected.
TransformableNode: It is a node that can be interacted with. It can be
moved around, scaled, rotated and much more.
AR Java Android App in Android Studio (cont.)
https://developers.google.com/ar/develop/developer-guides/anchors https://developers.google.com/ar/discover/concepts#environmental_understanding
AR Java Android App in Android Studio (cont.)