Step Check - Advanced Topics¶
This page collects a number of advanced Step Check topics not covered in the main article.
Creating Template Images without using the Vuforia Creator App¶
For simplest usability, it is recommended to use the Vuforia Creator App to capture template images and mask validation areas for Step Check. However, these can also be created using other tools. Use an image editor such as Adobe Photoshop, Adobe Fresco, or GIMP to add a layer mask to an image that masks the validation area.
Supported image format¶
The format should be RGBA-PNG. The image pixel size is limited to 2048x2048. We recommend taking pictures at full HD (1920x1080 pixels) since this the details will then be similar to what the camera is seeing at runtime. If cropping is needed, it should only be done in the larger dimension (e.g. to make the template image square, but not smaller).
Start by capturing an image of the part or area you wish to validate against. It's also important to capture the surroundings since it will be used to localize the validation area. In our example, we check if an oil dipstick of a car engine is correctly inserted.
The validation area is defined by a mask in the image's alpha layer. The area must be masked using image-editing software. We will show how to use Photoshop and Fresco, but any software that can create layers and masks can be used.
Adobe Photoshop¶
- Import the image into Photoshop, JPG or PNG (grayscale or RGB-24 bit).
-
Convert the background to a layer using Layer from Background…
-
Use any of the selection tools to mark the area you will use for the validation. Quick Selection Tool is often helpful to mask similar areas. The masked area could, for example, be a button, slider, removable part, connector, etc.,
-
Right-click the selected area and choose New Layer via Copy.
-
Select the other layer with the background and set the opacity to below 50%. The layer should also be set to visible.
-
Go to File -> Save a Copy and select PNG from the Format dropdown to save the image. The document structure will ensure that the saved PNG includes the alpha channel.
Adobe Fresco (mobile device)¶
-
On a mobile device, you can directly take a photo and use it in Adobe Fresco:
-
After taking the photo, prepare the layers for masking:
-
Delete any non-transparent background layers.
-
Duplicate the image layer.
-
Adjust the lower layer to < 50% opacity.
-
-
On the topmost (fully opaque) layer, use a selection tool (e.g. paint selection) to select the validation area.
-
Use the
Mask
tool to mask the selected area. -
The resulting image can be exported as PNG and shared e.g. to Dropbox or Onedrive to use in your application.
The template image is now ready to be used with a ValidationBehaviour
or VuValidationAreaFileConfig
or tested using the Vuforia Creator App.
Multiple Templates¶
For advanced use cases, multiple Validation Area Behaviours (native: Observers) can be created and activated at the same time. This may be helpful to support:
- Validation from different viewpoints
- Definition of explicit failure cases:
- For example, in addition to a template of a switch in the expected OFF position, a second template can be created with the switch in the ON position. Instead of a
pass
label, afail
label could be used for this second template. - The application can then activate both Validation Area Behaviours at the same time and pick the result with the highest confidence from those that return a validation status
NORMAL
. - For best performance, make sure that the two templates images are created from a similar viewpoint for this use case.
- For example, in addition to a template of a switch in the expected OFF position, a second template can be created with the switch in the ON position. Instead of a
This is also demonstrated in the Unity Sample app in the 2-PowerSwitch scene, showing how to use two template images to validate if a power switch is in the OFF position:
- A
pass
template image shows the button in the correct OFF position - A
fail
template image shows the button in the incorrect ON position
If one of the two Validation Area Behaviours returns a validation result with status NORMAL
, a pass or fail icon will be displayed accordingly. Otherwise, the UNDECIDABLE
icon will be displayed.
Using Model Targets for Guidance¶
Validation results provided by Step Check also provide guidance to the best viewpoint to validate from. However, this will only be available once the approximate validation area captured in the template image has been localized.
To guide users to the approximate location of the validation area, it is recommended to use a Model Target. Create an (On-prem) Advanced Model Target that can be recognized from any angle and define 3D positions relative to it that guide users to the locations of the Validation Areas of that objects.
These points of interest can be visualized with a e.g. an AR marker or wayfinder that points to the right position.