Localization device that treats blobs as object markers that can be used to retrieve real position of given object. More...
Localization device that treats blobs as object markers that can be used to retrieve real position of given object.
This device computes real position of some object found by blobfinder that denotes it by a blob of given color key. If only one color key is given in configuration file options, only px and py coordinates will be computed leaving pa filled with zero. If two color keys are given, two differently coloured blobs (with each of those color keys) must be found by blobfinder device in order to compute object position. In such a case position of the object is found in the middle of the line segment between those two blobs. Knowing which blob is which this driver can compute complete information about object position (px, py, pa). If more than one blob with any of given color keys is found, no position is computed. If position cannot be computed, this fact will be indicated by 'stall' field set to 1; other fields will be filled with previously computed values.
When this driver is started, camera device from which blobfinder reads data should remain static all the time. Moving the camera distorts computation results.
- Compile-time dependencies
- none
- Provides
- Requires
- Configuration requests
- None
- Configuration file options
- x_ppm (integer)
- Default: 100
- X-axis pixels per meter
- y_ppm (integer)
- Default: 100
- Y-axis pixels per meter
- min_area (integer)
- Default: 1
- Minimal size of blob in pixels (noise reduction)
- stall_when_lost (integer)
- Default: 1
- If set to non-zero, whenever position cannot be computed, this fact will be indicated by 'stall' field set to 1; other fields will be filled with previously computed values
- If set to zero, whenever position cannot be computed, no position2d data will be published
- expected_size (integer tuple)
- Default: [640 480]
- Expected size of image reported by blobfinder device; position will not be computed if the size does not match
- offset (integer tuple)
- Default: [320 240]
- Offset of (0.0, 0.0) point (given in pixels)
- color_key (string tuple)
- Default: None, must be set
- Tuple of one or two color keys, each 8-digit hex value (0x prefixed)
- First color key denotes rightmost (top) blob
- Example
driver ( name "blobposition" provides ["position2d:0"] requires ["blobfinder:0"] x_ppm 99 y_ppm 97 expected_size [640 480] offset [358 258] colorkeys ["0x00ff0000" "0x0000ff00"] )