@8thwall/image-target-cli
v1.0.0
Published
Generate 8th Wall Image Target Metadata
Readme
Image Target CLI
This CLI tool allows the creation of image targets in the format supported by the Offline Engine.
Usage
npx @8thwall/image-target-cli@latestYou will be prompted to enter an image path, select crop, and choose a folder/image target name. You can either use a default centered crop, or choose your crop dimensions according to this diagram:

If you choose a cylindrical geometry, you will also be prompted for the cylinder circumference and target width. See the diagram below for a visualization. The choice of units (mm vs inches) will not affect tracking behavior, so the measurements can also be scale-free.

For conical images, wider top and wider bottom shapes are both supported. The below image shows the input format, with the label curving around the shape of a large circle. For wider bottom images, the arc of the label should curve the opposite direction. You will be prompted for the outer radius and inner radius of the label's curve. You'll also input the angle of the cone covered by label. If you choose to customize the crop, you'll be cropping against the flattened geometry image, as shown below.

On generation, the following will be outputted:
- Metadata within a json file
- Original image
- Geometry image (for conical)
- Cropped image
- Thumbnail image (263x350)
- Luminance image (grayscale, 480x640)
Generated image targets can be loaded into the engine by adding this code to your project:
const onxrloaded = () => {
XR8.XrController.configure({
imageTargetData: [
require('../image-targets/target1.json'),
require('../image-targets/target2.json'),
],
})
}
window.XR8 ? onxrloaded() : window.addEventListener('xrloaded', onxrloaded)The imagePath field of the json data will tell the engine where to load the tracked image, which
will have its features extracted and compared to the camera feed.
