You are here: Start » Program Examples » Fiducial Markers

Fiducial Markers

Aim

The goal of this task is to detect fiducial markers (in the shape of a plus sign) on different images. The markers have the same size, can be rotated, and can both be bright and dark.

Input

An image of a fragment of an electronic board.

Output

An image with the detected marker marked.

Hints

The colors of neither the object to detect nor the background are constant. However, between the markers and the background there is always a visible boundary, an edge.

Using LocateSingleObject_Edges may prove to be more robust especially considering the simple shape of the object.

Since none of the input images have a clear view of the marker it may be useful to prepare an artificial image where is is easily noticeable.

Solution (AVS)

  1. Add EnumerateImages filter to
  2. Since it would be difficult to create and edge model from one of the input images due to their being cluttered we should create a training image. To do this start with adding an EmptyImage filter.

    • In the EnumerateImages filter right click on outImage, go to property outputs and check both Height and *Width.
    • Connect the new outputs to the appropriate inputs in EmptyImage.
    • Run the program once to calculate values of outputs.
  3. Add a DrawPaths_SingleColor filter. Connect the output of EmptyImage to the appropriate input

    • Now open the path editor by clicking the "..." icon in the inPaths field.
    • In the editor you can choose a reference image from the input set.
    • Now draw a closed path in the shape of the marker using a real image as reference. Close the editor.
    • In the filter properties change the inColor to white.
    • Set the Filled parameter of inDrawingStyle to True.
    • Run the program once. Now you should have a black image with a white marker.
  4. Now the proper part of detection can begin. Add a LocateSingleObject_Edges filter. Open the edge editor by clicking the "..." icon in the inEdgeModel field.

    • mark the area of the marker and set the parameters like it is shown in the following image.
    • The angle parameters allow detection of rotated markers.
  5. To ensure fast and robust execution you can change appropriate parameters in the filter properties set the parameters.
    • Changing inMinPyramidLevel to 1 speeds up the execution.
    • Set inMinPyramidLevel to 8 so that weaker edges can be detected.
    • Set inEdgePolarityMode to Ignore. Ignore means that the system will seek both object darker than background and brighter.
    • Finally, enter 0.680 into the inMinScore parameter to detect object which are obscured.
  6. Since the training image is not needed during normal operation you can disable both EmptyImage and DrawPaths_SingleColor filters to speed up the execution.

Macrofilter Main

Used Filters

Icon Name Description
LocateSingleObject_Edges Detection of an object whose outlines are sharp and rigid. Often one of the first filters in a program.
EnumerateImages Emulates image acquisition with images stored on disk.

Further Readings