PVCAM  3.9.x
Programmable Virtual Camera Access Method library
Centroids

Centroids can be thought of as multiple ROIs that are chosen and generated by the camera itself. The users only specify how many ROIs they are interested in and what should their size be. The size and number of ROIs cannot change during acquisition, however, locations of the ROIs may change with each frame. Because of that, an embedded frame metadata must be included for every frame acquired. The frame may be recomposed using the same recomposing function(s) as described in the Embedded Frame Metadata chapter.

The Centroids feature can also be thought of as an "Object detection" feature. In the simplest form, a Centroid can be a pixel or group of adjacent pixels with higher intensity. A Centroid can also be a moving particle or a specific object the camera is trying to detect and/or track. For all available detection modes please see the PARAM_CENTROIDS_MODE parameter.

The Centroids feature is enabled by PARAM_CENTROIDS_ENABLED parameter. Other two parameters, the PARAM_CENTROIDS_COUNT and PARAM_CENTROIDS_RADIUS are used to define the desired number of centroids and their size. The Embedded Frame Metadata feature must be enabled before starting the Centroids acquisition.

By calling the pl_exp_setup_seq/pl_exp_setup_cont functions the user only specifies a single ROI where the Centroids shall be detected. User-defined multiple ROIs cannot be combined with this feature.

To use the centroids feature in an application, the following sequence of steps should be followed:

  1. The Embedded Frame Metadata feature is enabled with the PARAM_METADATA_ENABLED.
  2. The Centroids feature is enabled with PARAM_CENTROIDS_ENABLED.
  3. If available, a specific mode can be set with PARAM_CENTROIDS_MODE. If this parameter is not available, then only the simplest form of Centroids detection is supported.
  4. Number and size of Centroids is configured with PARAM_CENTROIDS_COUNT and PARAM_CENTROIDS_RADIUS.
  5. For some modes also other parameters can be configured if available, e.g. PARAM_CENTROIDS_BG_COUNT or PARAM_CENTROIDS_THRESHOLD.
  6. pl_exp_setup_seq or pl_exp_setup_cont is called and frame buffer is allocated accordingly.
  7. Acquisition is started.
  8. Once the frame arrives, it can be decoded or recomposed using the same process as described in the Embedded Frame Metadata chapter.
Note
Please, refer to the Centroids code sample to obtain more information about how to use this feature.