We will do this w the Metaio creator
http://dev.metaio.com/sdk/tutorials/see-through-glasses/
See-through Glasses
General
In
order to support see-through glasses, such as the Epson Moverio BT-200
glasses, the Metaio SDK has stereo rendering support built in with
version 5.2 and newer. If the stereo rendering mode is enabled, the
scene is rendered twice from two slightly different perspectives. The
output of these two renderings is displayed in a so called split screen
mode that is supported by most 3D output devices such as phones with 3D
capable displays or stereo glasses. It might be necessary to use some
device vendor specific API to enable the 3D display or glass to work in
split screen mode together with the Metaio SDK.
To test the stereo rendering, you can enable it on any device. You will just see the screen split in the middle, showing one rendering on the left and another one on the right side.
The Metaio SDK is optimized for stereo mode, which is available on the Epson Moverio BT-200 glasses, but will run perfectly well in mono mode on devices such as Google Glass, Vuzix M100, etc. There is a dedicated tutorial explaining how to run the Metaio SDK on Google Glass.
To test the stereo rendering, you can enable it on any device. You will just see the screen split in the middle, showing one rendering on the left and another one on the right side.
The Metaio SDK is optimized for stereo mode, which is available on the Epson Moverio BT-200 glasses, but will run perfectly well in mono mode on devices such as Google Glass, Vuzix M100, etc. There is a dedicated tutorial explaining how to run the Metaio SDK on Google Glass.
Enabling Stereo Rendering
Adjusting the Rendering Angles [SDK 5.3 and older]
Adjusting the Rendering Angles [SDK 5.5 to 6.0]
setStereoRendering{Left,Right}CameraTransformation
by setHandEyeCalibration
,
which allows you to influence the hand-eye calibration (and thus the
viewing angle of left/right eye on 3D-capable devices) using a
translation and a rotation component.
The "hand-eye calibration" defines the transformation from camera space to eye space, which is necessary to render AR correctly e.g. on devices like smart glasses where the camera and eye projector positions and orientations (viewing directions) are distinct. So if for instance, a device has one projective display for each human eye, and a camera positioned on the right temple of the glasses, the translation part for each eye's calibration would most probably be positive (e.g. 10mm for right eye, and 70mm for left eye).
The
setStereoRendering(true)
call automatically applies
an initial hand-eye calibration for known devices. For example, SDK 5.5
introduced a calibration for the Epson Moverio BT-200 glasses. Mind
however that SDK 6.0 does not automatically apply a calibration anymore,
since we found that BT-200 devices are not manufactured equally and
hence there is a need for per-device calibration. Please check the changelog for more updates on this.
In the example code, we use contrived values. They should be replaced by the values for the actual device in a real world scenario, or even better: use SDK 6.0.1 or newer, together with the recommended approach as documented below.
Adjusting the Rendering Angles [SDK 6.0.1 and newer]
SDK version 6.0.1, together with Toolbox for Android 6.0.1, introduce a new and recommended approach to set the hand-eye calibration.
Toolbox allows creation of calibrations directly on the device, e.g. supported for the Epson Moverio BT-200. After you've finished calibrating a device, Toolbox stores a calibration file at a fixed path on the device (typically "/sdcard/metaio/hec/hec.xml"), where the SDK can load it by simply calling
setHandEyeCalibrationFromFile()
without parameters. Since stereo devices may need per-device
calibration (such as the BT-200, since they are not manufactured
identically), we recommend the following approach to set the hand-eye
calibration (in this order, exit if a step succeeds):- Load your own, exact calibration (calibration XML file created with Toolbox 6.0.1 or newer), i.e. you as developer provide a calibration file. Note that the path to "hec.xml" doesn't actually exist in this example; it's only there to show how to apply a custom calibration file.
- Load calibration XML file from default path, i.e. in case the user has used Toolbox to calibrate (result file always stored at same path).
- Load calibration built into Metaio SDK for known devices (may not give perfect result because stereo glasses can vary).
Importance of adjustments for stereo devices
<ReferenceImage WidthMM="114" HeightMM="114">metaioman_target.png</ReferenceImage>
For ID marker tracking, like this:
<MarkerParameters><MatrixID>1</MatrixID><Size>80</Size></MarkerParameters>
For 3D map tracking, you should use Metaio Toolbox to record, and then adapt the map to millimeter coordinates ("Align map" feature).
If you develop for a device that requires a hand-eye calibration, e.g. the BT-200, and tracking is not configured to match physical millimeter coordinates, you will see a wrongly scaled and shifted pose in the best case, or in the worst case the human eye will recognize e.g. an augmented 3D model as two distinct objects.
The reason is that, if the distance between camera and trackable image is not recognized correctly (e.g. SDK thinks it's 300mm when it's actually 700mm), the hand-eye calibration will influence the position of the augmented 3D objects more or less than it should, which leads to the effects just described.
See Through
In
stereo rendering mode, displaying the camera image does not make much
sense. Therefore it is recommended to enable the see through mode with
setSeeThrough(true)
. For debugging purposes, see through can be disabled with setSeeThrough(false)
in order to always render the camera image – which will however not be
aligned to the augmentation in case a hand-eye calibration is set.
No comments:
Post a Comment