API documentation

Module for automating image marking with the Pix4Dengine SDK.

This module provides CPMarker, a Task object compatible with the Pix4Dengine SDK version 1, allowing to automatically detect and add control point marks in an Pix4Dengine SDK pipeline. A convenience function py:func:~automarking.make_task is provided and should be the preferred means to instantiate tasks.

exception automarking.AlgoFailure

Error during the execution of the automarking algorithm.

Casting the exception object to str provides a message with further details on the causes of the failure.

class automarking.CPMarker(config=None, usage_stats=None)

Pix4Dengine SDK-compatible task for automating image marking.

The Task automatically detects targets in images, and adds the corresponding image marks in the Pix4Dengine SDK project. Subsequent re-calibration or re-optimization will use the image marks produced by this task.

The task can only be run on an already calibrated project, and control points must be added to the project before this task is run. Image marks are not needed to run the task, and existing marks are overwritten.

Parameters
  • config – a dictionary containing optional algorithm configuration. Defaults are used unless a different value is given here. See Config for available options and default values.

  • usage_stats – function that accepts a dictionary as argument. The dictionary is a json-serialisable collection of relevant statistics that can be used, e.g., for logging purposes.

get_config()

Return the configuration of this task.

Returns

A dictionary containing the configuration options and values of the task.

property name

The name identifying the task.

property report

Access the report dictionary, summarizing the results of a CPMarker run.

The report is only available after the task completed.

The report dictionary has the following items:

  • "CONFIG": summary of the algorithm configuration and inputs.
    • "NUM_GCPS": number of input control points.

    • "GPS_BIAS_CORRECTION": bool, stating if the algorithm attempted to correct for biases in the vertical georeferencing position.

    • "PARAMS": Summary of user-configured and default parameters.

  • "RESULTS": summary of the algorithm results, as a map of the input GCP_ID to another dictionary, containing:

    • "NUM_MARKS": number of marks that the algorithm assigned to the CP.

    • "REPROJ_ERR": reprojection error of the marks assigned to the CP.

    • "MARKS": array of objects, each describing a mark assigned to a CP. Each object has the following fields: (“IMAGE_ID”, “X”, “Y”, “U”, “V”) where “X” and “Y” are the pixel coordinates on the image, while “U” and “V” are the relative coordinates on the image.

class automarking.Config(value)

Options for CPMarker task, with default values.

FIX_VERTICAL_BIAS = type=bool, default=True, Some drones record a biased altitude. If this option is True, the algorithm tries to compensate this bias before detecting the CPs. It is generally safe to leave this option enabled even if there is no bias.
GEOREF_HOR_UNCERT = type=float, default=5.0, Uncertainty of horizontal image georeferencing. This uncertainty is given in the units of the CP coordinate system in use (e.g. meters, feet,...).
GEOREF_VER_UNCERT = type=float, default=10.0, Uncertainty of vertical image georeferencing. This uncertainty is given in the units of the CP coordinate system in use (usually meters).
TARGET_DIAMETER = type=float, default=50.0, Length in pixels of the CP target diagonal.It can be calculated by dividing the target diagonal by the project GSD.
automarking.make_task(config=None, usage_stats=None)

Convenience function to instantiate a CPMarker.