Ocean
Ocean::Tracking::Utilities Class Reference

This class implements utility functions allowing e.g., for a more comfortable visualization of tracking data. More...

Static Public Member Functions

static Frame blendFrames (const Frame &frame0, const Frame &frame1, Worker *worker=nullptr)
 Blends two given frames having the same frame type. More...
 
static Frame blendFrames (const Frame &frame0, const Frame &frame1, Vector2 &offset0, Vector2 &offset1, const FrameType::PixelFormat pixelFormat=FrameType::FORMAT_UNDEFINED, Worker *worker=nullptr)
 Blends two given frames with same pixel origin. More...
 
static void paintLine (Frame &frame, const Vector2 &startPosition, const Vector2 &stopPosition, const uint8_t *color=nullptr, const bool subPixel=true)
 Paints a line into a given frame. More...
 
static void paintLines (Frame &frame, const Vector2 *startPositions, const Vector2 *stopPositions, const size_t numberLines, const uint8_t *color=nullptr, Worker *worker=nullptr, const bool subPixel=true, const Vector2 &offsetStartPositions=Vector2(0, 0), const Vector2 &offsetStopPositions=Vector2(0, 0))
 Paints a set of lines into a given frame. More...
 
template<unsigned int tSize>
static void paintLines (Frame &frame, const Vector2 *startPositions, const Vector2 *stopPositions, const size_t numberLines, const uint8_t *color=nullptr, Worker *worker=nullptr)
 Paints a set of lines into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tSizeForeground, unsigned int tSizeBackground>
static void paintLines (Frame &frame, const Vector2 *startPositions, const Vector2 *stopPositions, const size_t numberLines, const uint8_t *colorForeground=nullptr, const uint8_t *colorBackground=nullptr, Worker *worker=nullptr)
 Paints a set of lines with (foreground and) background color into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tSize>
static void paintPaths (Frame &frame, const Vectors2 *paths, const size_t size, const uint8_t *color=nullptr, Worker *worker=nullptr)
 Paints several paths into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tSize>
static void paintPaths (Frame &frame, const Vectors2 *paths, const size_t size, const uint8_t *color0, const uint8_t *color1, const Scalar *factors, Worker *worker=nullptr)
 Paints several paths into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tSize = 1u>
static void paintTriangle (Frame &frame, const Triangle2 &triangle, const uint8_t *color=nullptr)
 Paints a 2D triangle into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tSize = 1u>
static void paintTriangles (Frame &frame, const Triangles2 &triangles, const uint8_t *color=nullptr, Worker *worker=nullptr)
 Paints a set of 2D triangles into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tPointSize>
static void paintImagePoints (Frame &frame, const Vector2 *imagePoints, const size_t size, const uint8_t *color, Worker *worker=nullptr)
 Paints a set of 2D image points into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tPointSize>
static void paintObjectPoints (Frame &frame, const AnyCamera &anyCamera, const HomogenousMatrix4 &world_T_camera, const Vector3 *objectPoints, const size_t size, const uint8_t *color, Worker *worker=nullptr)
 Paints a set of 3D object points (rather their projected 2D counterparts respectively) into a given frame with sub-pixel accuracy. More...
 
static void paintFeaturePoint (Frame &frame, const Vector2 &position, const Scalar radius, const Scalar orientation, const uint8_t *color, const uint8_t *shadowColor)
 Paints a feature point having a radius (a scale) and orientation. More...
 
template<unsigned int tChannels>
static void paintFeaturePoint8BitPerChannel (uint8_t *frame, const unsigned int width, const unsigned int height, const Vector2 &position, const Scalar radius, const Scalar orientation, const uint8_t *color, const uint8_t *shadowColor, const unsigned int framePaddingElements=0u)
 Paints a feature point having a radius (a scale) and orientation. More...
 
static void paintFeaturePoints (Frame &frame, const Vector2 *positions, const Scalar *radii, const Scalar *orientations, const size_t size, const uint8_t *color, const uint8_t *shadowColor, const Vector2 &explicitOffset=Vector2(0, 0), Worker *worker=nullptr)
 Paints feature points having a radius (a scale) and orientation. More...
 
template<unsigned int tChannels>
static void paintFeaturePoints8BitPerChannel (uint8_t *frame, const unsigned int width, const unsigned int height, const Vector2 *positions, const Scalar *radii, const Scalar *orientations, const size_t size, const uint8_t *color, const uint8_t *shadowColor, const Vector2 &explicitOffset, const unsigned int framePaddingElements, Worker *worker=nullptr)
 Paints feature points having a radius (a scale) and orientation. More...
 
template<unsigned int tObjectPointSize, unsigned int tImagePointSize>
static void paintCorrespondences (Frame &frame, const AnyCamera &camera, const HomogenousMatrix4 &model_T_camera, const Vector3 *objectPoints, const Vector2 *imagePoints, const size_t correspondences, const Scalar maxSqrError, const uint8_t *colorValidObjectPoints, const uint8_t *colorValidImagePoints, const uint8_t *colorInvalidObjectPoints, const uint8_t *colorInvalidImagePoints, const bool drawObjectPoints=true, const bool drawImagePoints=true, const bool drawConnections=true, Worker *worker=nullptr)
 Paints a set of correspondences between 2D image points and 3D object points (rather their projected 2D counterparts respectively) into a given frame with sub-pixel accuracy. More...
 
static Frame paintCorrespondencesBlend (const Frame &frame0, const Frame &frame1, const Vector2 *points0, const Vector2 *points1, const size_t numberPoints, const uint8_t *rgbColor=nullptr, Worker *worker=nullptr)
 Blends two corresponding frames each with a ratio of fifty percent and paints a set of given feature correspondences. More...
 
static Frame paintCorrespondencesHorizontal (const Frame &frame0, const Frame &frame1, const Vector2 *points0, const Vector2 *points1, const size_t numberPoints, const uint8_t *color=nullptr, Worker *worker=nullptr)
 Joins two corresponding frames horizontally and paints a set of given feature correspondences. More...
 
static Frame paintCorrespondencesVertical (const Frame &frame0, const Frame &frame1, const Vector2 *points0, const Vector2 *points1, const size_t numberPoints, const uint8_t *color=nullptr, Worker *worker=nullptr)
 Joins two corresponding frames vertically and paints a set of given feature correspondences. More...
 
static bool paintCorrespondencesHomography (const Frame &frame0, const Frame &frame1, const SquareMatrix3 &points1_H_points0, const Vector2 *points0, const Vector2 *points1, const size_t numberPoints, const bool fullCoverage, Frame &result, const uint8_t *foregroundColor=nullptr, const uint8_t *backgroundColor=nullptr, const uint8_t *startColor=nullptr, Worker *worker=nullptr)
 Joins two corresponding frames by application of a homography and paints a set of given feature correspondences. More...
 
static bool paintCorrespondencesOrientations (const PinholeCamera &pinholeCamera, const Frame &frame0, const Frame &frame1, const SquareMatrix3 &orientation0, const SquareMatrix3 &orientation1, const Vector2 *points0, const Vector2 *points1, const size_t numberPoints, Frame &result, const uint8_t *foregroundColor=nullptr, const uint8_t *backgroundColor=nullptr, const uint8_t *startColor=nullptr, Worker *worker=nullptr)
 Joins two corresponding frames by application of their orientations and paints a set of given feature correspondences. More...
 
static void paintPoints (Frame &frame, const Vector2 *imagePoints, const size_t number, const unsigned int radius, const uint8_t *colorInner=nullptr, const uint8_t *colorOuter=nullptr)
 Paints a set of image points into a given frame. More...
 
static void paintPoints (Frame &frame, const HomogenousMatrix4 &world_T_camera, const PinholeCamera &pinholeCamera, const Vector3 *objectPoints, const size_t numberObjectPoints, const Vector2 *imagePoints, const size_t numberImagePoints, const bool distortProjectedObjectPoints, const unsigned int radiusObjectPoints, const unsigned int radiusImagePoints, const uint8_t *colorObjectPoints=nullptr, const uint8_t *colorImagePoints=nullptr)
 Paints (projected) object points and image points into a given frame. More...
 
static void paintPointsIF (Frame &frame, const HomogenousMatrix4 &flippedCamera_T_world, const PinholeCamera &pinholeCamera, const Vector3 *objectPoints, const size_t numberObjectPoints, const Vector2 *imagePoints, const size_t numberImagePoints, const bool distortProjectedObjectPoints, const unsigned int radiusObjectPoints, const unsigned int radiusImagePoints, const uint8_t *colorObjectPoints=nullptr, const uint8_t *colorImagePoints=nullptr)
 Paints (projected) object points and image points into a given frame. More...
 
static void paintBoundingBoxIF (Frame &frame, const HomogenousMatrix4 &flippedCamera_T_world, const AnyCamera &anyCamera, const Box3 &boundingBox, const uint8_t *foregroundColor, const uint8_t *backgroundColor, const bool edgesOnly=true)
 Paints a (projected) 3D axis aligned bounding box into a given frame. More...
 
static void paintWireframeConeIF (Frame &frame, const HomogenousMatrix4 &flippedCamera_T_cone, const PinholeCamera &pinholeCamera, const Cone3 &cone, const bool distortProjectedObjectPoints=true, Worker *worker=nullptr, const uint8_t *color=CV::Canvas::yellow(), const unsigned int numCircles=6u, const unsigned int numVerticalLines=4u, const unsigned int numSamples=72u)
 Paints a (projected) wire-frame cone into a given frame. More...
 
static void paintWireframeCylinderIF (Frame &frame, const HomogenousMatrix4 &flippedCamera_T_cylinder, const PinholeCamera &pinholeCamera, const Cylinder3 &cylinder, const bool distortProjectedObjectPoints=true, Worker *worker=nullptr, const uint8_t *color=CV::Canvas::yellow(), const unsigned int numCircles=6u, const unsigned int numVerticalLines=4u, const unsigned int numSamples=72u)
 Paints a (projected) wire-frame cylinder into a given frame. More...
 
template<unsigned int tSize = 1u>
static void paintTriangleIF (Frame &frame, const HomogenousMatrix4 &flippedCamera_T_world, const AnyCamera &anyCamera, const Triangle3 &triangle, const uint8_t *color=nullptr)
 Paints a (projected) 3D triangle into a given frame. More...
 
template<unsigned int tSize = 1u>
static void paintTrianglesIF (Frame &frame, const HomogenousMatrix4 &flippedCamera_T_world, const AnyCamera &anyCamera, const Triangle3 *triangles, const size_t numberTriangles, const uint8_t *color=nullptr, Worker *worker=nullptr)
 Paints (projected) 3D triangles into a given frame. More...
 
static void paintLineIF (Frame &frame, const HomogenousMatrix4 &flippedCamera_T_world, const AnyCamera &anyCamera, const Vector3 &objectPoint0, const Vector3 &objectPoint1, const unsigned int segments, const uint8_t *foregroundColor, const uint8_t *backgroundColor)
 Paints a (projected) 3D line into a given frame. More...
 
static void paintCoordinateSystemIF (Frame &frame, const HomogenousMatrix4 &flippedCamera_T_world, const AnyCamera &anyCamera, const HomogenousMatrix4 &world_T_coordinateSystem, const Scalar length)
 Paints a 3D coordinate system (projected) into a frame. More...
 
static bool paintPlane (Frame &frame, const HomogenousMatrix4 &world_T_camera, const AnyCamera &camera, const HomogenousMatrix4 &planeTransformation, const unsigned int bins, const uint8_t *foregroundColor, const uint8_t *backgroundColor, Scalar *expansion=nullptr)
 Paints a 3D plane into the frame, further the origin of the plane is painted. More...
 
static bool paintPlaneIF (Frame &frame, const HomogenousMatrix4 &flippedCamera_T_world, const AnyCamera &camera, const HomogenousMatrix4 &planeTransformation, const Scalar expansion, const unsigned int bins, const uint8_t *foregroundColor, const uint8_t *backgroundColor)
 Paints a 3D plane into the frame, further the origin of the plane is painted. More...
 
static void paintQuads (Frame &frame, const HomogenousMatrix4 &world_T_camera, const AnyCamera &camera, const Vector3 &quadOrigin, const Vector3 &quadHorizontal, const Vector3 &quadVertical, const unsigned int horizontalBins, const unsigned int verticalBins, const uint8_t *color=nullptr)
 Paints quads that are located on a 3D plane into a given frame. More...
 
static void paintQuadsIF (Frame &frame, const HomogenousMatrix4 &flippedCamera_T_world, const AnyCamera &camera, const Vector3 &quadOrigin, const Vector3 &quadHorizontal, const Vector3 &quadVertical, const unsigned int horizontalBins, const unsigned int verticalBins, const uint8_t *color=nullptr)
 Paints quads that are located on a 3D plane into a given frame. More...
 
static Frame paintMask (const Frame &frame, const Frame &mask, const uint8_t maskValue=uint8_t(0xFFu), Worker *worker=nullptr)
 Paints / blends a binary 8 bit mask into a given frame with identical frame dimension. More...
 
static Frame paintBoundingBox (const Frame &frame, const CV::PixelBoundingBox &boundingBox, Worker *worker=nullptr)
 Paints / blends a bounding box into a given frame. More...
 
static bool alignFramesHomography (const Frame &fixedFrame, const Frame &dynamicFrame, const SquareMatrix3 &dynamic_H_fixed, Frame &result, const bool blend, Worker *worker=nullptr)
 Aligns two frames connected by a given homography into one frame while the resulting frame covers the area of one given frame only (the fixed frame). More...
 
static bool alignFramesHomographyFullCoverage (const Frame &fixedFrame, const Frame &dynamicFrame, const SquareMatrix3 &dynamic_H_fixed, Frame &result, const bool blend, Worker *worker=nullptr, unsigned int maximalWidth=16384u, const unsigned int maximalHeight=16384u, unsigned int *fixedFrameLeft=nullptr, unsigned int *fixedFrameTop=nullptr, Scalar *dynamicFrameLeft=nullptr, Scalar *dynamicFrameTop=nullptr, Frame *fullFixedFrame=nullptr, Frame *fullDynamicFrame=nullptr)
 Aligns two frames connected by a given homography into one frame entirely covering the frame content of both images. More...
 
static void visualizeDatabase (const Database &database, const Index32 poseId, Frame &frame, const uint8_t *colorImagePoints, const uint8_t *colorImagePointsInstable, const uint8_t *colorImagePointsStable, const unsigned int maximalPathLength=20u, const unsigned int stablePathLength=100u, const SquareMatrix3 &transformation=SquareMatrix3(true), Worker *worker=nullptr)
 Visualizes image point information of a tracking database for a specific pose id. More...
 
static bool writeCamera (const PinholeCamera &pinholeCamera, IO::OutputBitstream &outputStream)
 Writes a camera profile to a binary output stream. More...
 
static bool readCamera (IO::InputBitstream &inputStream, PinholeCamera &pinholeCamera)
 Reads a camera profile from a binary input stream. More...
 
static bool writeDatabase (const Database &database, IO::OutputBitstream &outputStream)
 Writes the information of a database to a given output stream as binary information. More...
 
static bool readDatabase (IO::InputBitstream &inputStream, Database &database)
 Reads a database information from a binary input stream. More...
 
static Maintenance::Buffer encodeEnvironment (const Frame &frame, const Vectors2 &frameImagePoints, const Vectors3 &frameObjectPoints, const HomogenousMatrix4 &framePose, const Vectors3 &objectPoints)
 Encodes the tracking environment composes of a frame mesh (a frame with correspondences of 2D image points and 3D object points), a camera pose from which the frame has been captured and an independent set of 3D object points. More...
 

Static Protected Member Functions

static void paintLinesSubset (Frame *frame, const Vector2 *startPositions, const Vector2 *stopPositions, const uint8_t *color, const bool subPixel, const Vector2 *offsetStartPositions, const Vector2 *offsetStopPositions, const unsigned int firstLine, const unsigned int numberLines)
 Paints a subset of a set of lines into a given frame. More...
 
template<unsigned int tSize>
static void paintLinesSubset (Frame *frame, const Vector2 *startPositions, const Vector2 *stopPositions, const uint8_t *color, const unsigned int firstLine, const unsigned int numberLines)
 Paints a subset of a set of lines into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tSizeForeground, unsigned int tSizeBackground>
static void paintLinesSubset (Frame *frame, const Vector2 *startPositions, const Vector2 *stopPositions, const uint8_t *colorForeground, const uint8_t *colorBackground, const unsigned int firstLine, const unsigned int numberLines)
 Paints a subset of a set of lines into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tSize>
static void paintPathsSubset (Frame *frame, const Vectors2 *paths, const uint8_t *color, const unsigned int firstPath, const unsigned int numberPaths)
 Paints a subset of several paths into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tSize>
static void paintPathsAdvancedSubset (Frame *frame, const Vectors2 *paths, const uint8_t *color0, const uint8_t *color1, const Scalar *factors, const unsigned int firstPath, const unsigned int numberPaths)
 Paints a subset of several paths into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tSize = 1u>
static void paintTrianglesSubset (Frame *frame, const Triangle2 *triangles, const uint8_t *color, const unsigned int firstTriangle, const unsigned int numberTriangles)
 Paints a subset of 2D triangles into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tSize = 1u>
static void paintTrianglesIFSubset (Frame *frame, const HomogenousMatrix4 *flippedCamera_T_world, const AnyCamera *anyCamera, const Triangle3 *triangles, const uint8_t *color, const unsigned int firstTriangle, const unsigned int numberTriangles)
 Projects and paints a subset of 3D triangles into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tPointSize>
static void paintImagePointsSubset (Frame *frame, const Vector2 *imagePoints, const uint8_t *color, const unsigned int firstImagePoint, const unsigned int numberImagePoints)
 Paints subset of a set of 2D image points into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tPointSize>
static void paintObjectPointsSubset (Frame *frame, const AnyCamera *anyCamera, const HomogenousMatrix4 *flippedCamera_T_world, const Vector3 *objectPoints, const uint8_t *color, const unsigned int firstObjectPoint, const unsigned int numberObjectPoints)
 Paints a subset of set of 3D object points (rather their projected 2D counterparts respectively) into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tChannels>
static void paintFeaturePoints8BitPerChannelSubset (uint8_t *frame, const unsigned int width, const unsigned int height, const Vector2 *positions, const Scalar *radii, const Scalar *orientations, const uint8_t *color, const uint8_t *shadowColor, const Scalar offsetX, const Scalar offsetY, const unsigned int framePaddingElements, const unsigned int firstFeaturePoint, const unsigned int numberFeaturePoints)
 Paints a subset of feature points having a radius (a scale) and orientation. More...
 
template<unsigned int tObjectPointSize, unsigned int tImagePointSize>
static void paintCorrespondencesSubset (Frame *frame, const AnyCamera *camera, const HomogenousMatrix4 *flippedCamera_T_model, const Vector3 *objectPoints, const Vector2 *imagePoints, const Scalar maxSqrError, const uint8_t *colorValidObjectPoints, const uint8_t *colorValidImagePoints, const uint8_t *colorInvalidObjectPoints, const uint8_t *colorInvalidImagePoints, const bool drawObjectPoints, const bool drawImagePoints, const bool drawConnections, const unsigned int firstCorrespondence, const unsigned int numberCorrespondences)
 Paints a subset of a set of correspondences between 2D image points and 3D object points (rather their projected 2D counterparts respectively) into a given frame with sub-pixel accuracy. More...
 
template<unsigned int tBlendChannel, unsigned int tChannels>
static void blendPixel (uint8_t *pixel, const uint8_t blendFactor)
 Paints / blends a binary 8 bit mask pixel into a given pixel with 8 bit per channel. More...
 

Detailed Description

This class implements utility functions allowing e.g., for a more comfortable visualization of tracking data.

Member Function Documentation

◆ alignFramesHomography()

static bool Ocean::Tracking::Utilities::alignFramesHomography ( const Frame fixedFrame,
const Frame dynamicFrame,
const SquareMatrix3 dynamic_H_fixed,
Frame result,
const bool  blend,
Worker worker = nullptr 
)
static

Aligns two frames connected by a given homography into one frame while the resulting frame covers the area of one given frame only (the fixed frame).

Parameters
fixedFrameThe fixed frame which will be untouched while the dynamic frame will be transformed by application of the homography and aligned to this frame, must be valid
dynamicFrameThe dynamic frame which will be transformed and then aligned to the fixed frame, with same pixel format and pixel orientation as the fixed frame
dynamic_H_fixedThe homography transforming points defined in the fixed frame to points defined in the dynamic frame, must be valid
resultThe resulting frame with aligned frames, the frame type will be adjusted/set internally
blendTrue, to blend both frames; False, to overwrite each pixel for which a corresponding pixel in the dynamic frame exist
workerOptional worker object to distribute the computation
Returns
True, if succeeded

◆ alignFramesHomographyFullCoverage()

static bool Ocean::Tracking::Utilities::alignFramesHomographyFullCoverage ( const Frame fixedFrame,
const Frame dynamicFrame,
const SquareMatrix3 dynamic_H_fixed,
Frame result,
const bool  blend,
Worker worker = nullptr,
unsigned int  maximalWidth = 16384u,
const unsigned int  maximalHeight = 16384u,
unsigned int *  fixedFrameLeft = nullptr,
unsigned int *  fixedFrameTop = nullptr,
Scalar dynamicFrameLeft = nullptr,
Scalar dynamicFrameTop = nullptr,
Frame fullFixedFrame = nullptr,
Frame fullDynamicFrame = nullptr 
)
static

Aligns two frames connected by a given homography into one frame entirely covering the frame content of both images.

Parameters
fixedFrameThe fixed frame which will be untouched while the dynamic frame will be transformed by application of the homography and aligned to this frame, must be valid
dynamicFrameThe dynamic frame which will be transformed and then aligned to the fixed frame, with same pixel format and pixel orientation as the fixed frame
dynamic_H_fixedThe homography transforming points defined in the fixed frame to points defined in the dynamic frame, must be valid
resultThe resulting frame with aligned frames converting the image content of both frames, the frame type will be adjusted/set internally
blendTrue, to blend both frames; False, to overwrite each pixel for which a corresponding pixel in the dynamic frame exist
workerOptional worker object to distribute the computation
maximalWidthThe maximal width of the resulting frame to ensure that an extreme homography does not create an extreme large result, in pixel with range [1, infinity)
maximalHeightThe maximal height of the resulting frame to ensure that an extreme homography does not create an extreme large result, in pixel with range [1, infinity)
fixedFrameLeftOptional resulting horizontal location of the top left pixel of the fixed frame in the resulting aligned frame, with range [0, result.width() - fixedFrame.width()]
fixedFrameTopOptional resulting vertical location of the top left pixel of the fixed frame in the resulting aligned frame, with range [0, result.height() - fixedFrame.height()]
dynamicFrameLeftOptional resulting horizontal location of the top left pixel of the dynamic frame in relation to 'fixedFrameLeft', with range (-infinity, infinity)
dynamicFrameTopOptional resulting horizontal location of the top left pixel of the dynamic frame in relation to 'fixedFrameTop', with range (-infinity, infinity)
fullFixedFrameOptional resulting frame covering the fixed frame only, but with same frame dimension as the resulting aligned frame
fullDynamicFrameOptional resulting frame covering the transformed dynamic frame only, but with same frame dimension as the resulting aligned frame
Returns
True, if succeeded

◆ blendFrames() [1/2]

static Frame Ocean::Tracking::Utilities::blendFrames ( const Frame frame0,
const Frame frame1,
Vector2 offset0,
Vector2 offset1,
const FrameType::PixelFormat  pixelFormat = FrameType::FORMAT_UNDEFINED,
Worker worker = nullptr 
)
static

Blends two given frames with same pixel origin.

In case the image resolution varies, both images will be aligned at the image center and missing image content is added at the border. The resulting frame holds pixel intensity values of fifty percent of each frame.

Parameters
frame0The first frame that will be blended, must be valid
frame1The second frame that will be blended, with same frame type as the first frame, must be valid
offset0The location of the top-left corner of the first frame within the blended frame, with range [0, 0]x(infinity, infinity)
offset1The location of the top-left corner of the second frame within the blended frame, with range [0, 0]x(infinity, infinity)
pixelFormatThe pixel format the resulting blended image will have, FORMAT_UNDEFINED to use the pixel format of the given images (which must be identical in that case)
workerOptional worker object to distribute the computation
Returns
The resulting blended frame

◆ blendFrames() [2/2]

static Frame Ocean::Tracking::Utilities::blendFrames ( const Frame frame0,
const Frame frame1,
Worker worker = nullptr 
)
static

Blends two given frames having the same frame type.

The resulting frame holds pixel intensity values of fifty percent of each frame.

Parameters
frame0The first frame that will be blended, must be valid
frame1The second frame that will be blended, with same frame type as the first frame, must be valid
workerOptional worker object to distribute the computation
Returns
The resulting blended frame

◆ blendPixel()

template<unsigned int tBlendChannel, unsigned int tChannels>
void Ocean::Tracking::Utilities::blendPixel ( uint8_t *  pixel,
const uint8_t  blendFactor 
)
inlinestaticprotected

Paints / blends a binary 8 bit mask pixel into a given pixel with 8 bit per channel.

Parameters
pixelThe pixel data which will receive the mask
blendFactorThe blend factor for the given pixel
Template Parameters
tBlendChannelThe index of the data channel which will be blended, with range [0, tChannels)
tChannelsThe number of data channels of the given pixel

◆ encodeEnvironment()

static Maintenance::Buffer Ocean::Tracking::Utilities::encodeEnvironment ( const Frame frame,
const Vectors2 frameImagePoints,
const Vectors3 frameObjectPoints,
const HomogenousMatrix4 framePose,
const Vectors3 objectPoints 
)
static

Encodes the tracking environment composes of a frame mesh (a frame with correspondences of 2D image points and 3D object points), a camera pose from which the frame has been captured and an independent set of 3D object points.


Parameters
frameThe frame to encode
frameImagePointsThe image points located in the given frame
frameObjectPointsThe object points, one object point for each image point
framePoseThe camera pose to encode
objectPointsThe independent object points to encode
Returns
The encoded buffer

◆ paintBoundingBox()

static Frame Ocean::Tracking::Utilities::paintBoundingBox ( const Frame frame,
const CV::PixelBoundingBox boundingBox,
Worker worker = nullptr 
)
static

Paints / blends a bounding box into a given frame.

Parameters
frameThe frame in which the bounding box will be painted, must be valid
boundingBoxThe bounding box, must be valid and must be defined inside the frame
workerOptional worker object to distribute the computation
Returns
The resulting frame with blended mask

◆ paintBoundingBoxIF()

static void Ocean::Tracking::Utilities::paintBoundingBoxIF ( Frame frame,
const HomogenousMatrix4 flippedCamera_T_world,
const AnyCamera anyCamera,
const Box3 boundingBox,
const uint8_t *  foregroundColor,
const uint8_t *  backgroundColor,
const bool  edgesOnly = true 
)
static

Paints a (projected) 3D axis aligned bounding box into a given frame.

Parameters
frameThe frame receiving the points, must be valid
flippedCamera_T_worldThe transformation between world and the flipped camera, must be valid
anyCameraThe camera profile defining the projection, with dimension equal to the frame dimension
boundingBoxThe bounding box that will be painted, defined in world
foregroundColorThe foreground color of the plane, nullptr to skip the painting with the foreground color
backgroundColorThe background color of the plane, nullptr to skip the painting with the background color
edgesOnlyTrue, to paint the edges of the bounding box only; False, to paint also the diagonal connections

◆ paintCoordinateSystemIF()

static void Ocean::Tracking::Utilities::paintCoordinateSystemIF ( Frame frame,
const HomogenousMatrix4 flippedCamera_T_world,
const AnyCamera anyCamera,
const HomogenousMatrix4 world_T_coordinateSystem,
const Scalar  length 
)
static

Paints a 3D coordinate system (projected) into a frame.

If the frame in an RGB 24bit frame, than the axis are painted in red (x), green (y), and blue (z); otherwise axis with color zero are.

Parameters
frameThe frame in which the coordinate system is painted, must be valid
flippedCamera_T_worldThe camera posed converting world to the flipped camera coordinate system (a camera coordinate system pointing towards the positive z-space), must be valid
anyCameraThe camera profile that is used to render the coordinate system
world_T_coordinateSystemThe transformation of the coordinate system which transformed points defined in the local coordinate system (which will be rendered) into points defined in the world coordinate system, must be valid
lengthThe length of the three axis of the coordinate system, defined in the units of the local coordinate system (coordinateSystem)

◆ paintCorrespondences()

template<unsigned int tObjectPointSize, unsigned int tImagePointSize>
void Ocean::Tracking::Utilities::paintCorrespondences ( Frame frame,
const AnyCamera camera,
const HomogenousMatrix4 model_T_camera,
const Vector3 objectPoints,
const Vector2 imagePoints,
const size_t  correspondences,
const Scalar  maxSqrError,
const uint8_t *  colorValidObjectPoints,
const uint8_t *  colorValidImagePoints,
const uint8_t *  colorInvalidObjectPoints,
const uint8_t *  colorInvalidImagePoints,
const bool  drawObjectPoints = true,
const bool  drawImagePoints = true,
const bool  drawConnections = true,
Worker worker = nullptr 
)
inlinestatic

Paints a set of correspondences between 2D image points and 3D object points (rather their projected 2D counterparts respectively) into a given frame with sub-pixel accuracy.

The projected object points will be painted first, followed by their corresponding image points.
Further, a connection between the projected object points and the corresponding image points can be painted, which can be helpful if the given pose is not accurate.

Parameters
frameThe frame in which the projected object points and image points will be painted
cameraThe camera profile defining the projection between 3D object points and camera plane
model_T_cameraThe camera pose transforming the camera coordinate system to the coordinate system of the object points (with viewing direction along the negative z-axis and y-axis as up vector), must be valid
objectPointsThe object points which will be projected into the camera frame
imagePointsThe image points corresponding to the given object points, the smaller the distance between image points and projected object points the more accurate the camera pose
correspondencesThe number of given 2D/3D point correspondences, with range [0, infinity)
maxSqrErrorThe maximal square pixel error between a projected object point and the corresponding image point to count as valid, with range [0, infinity)
colorValidObjectPointsThe color for valid object points
colorValidImagePointsThe color for valid object points
colorInvalidObjectPointsThe color for invalid object points
colorInvalidImagePointsThe color for invalid image points
drawObjectPointsTrue, to draw the object points
drawImagePointsTrue, to draw the image points
drawConnectionsTrue, to draw the connections between projected object points and the corresponding image points
workerOptional worker object to distribute the computation
Template Parameters
tObjectPointSizeThe radius of the object points, must be odd with range [tImagePointSize, infinity)
tImagePointSizeThe radius of the image points, must be odd, with range [1, infinity)

◆ paintCorrespondencesBlend()

static Frame Ocean::Tracking::Utilities::paintCorrespondencesBlend ( const Frame frame0,
const Frame frame1,
const Vector2 points0,
const Vector2 points1,
const size_t  numberPoints,
const uint8_t *  rgbColor = nullptr,
Worker worker = nullptr 
)
static

Blends two corresponding frames each with a ratio of fifty percent and paints a set of given feature correspondences.

Both frames must have the same pixel origin, while internally both images will be converted to FORMAT_RGB24 images.

Parameters
frame0The first frame, must be valid
frame1The second frame, with same frame type as the first frame
points0The positions of the feature correspondences in the first frame
points1The positions of the feature correspondences in the second frame, each point as a corresponding point in the first frame
numberPointsThe number of given feature correspondences, with range [0, infinity)
rgbColorThe color that will be used to paint the points, ensure that three values are provided (with order: R, G, B), otherwise nullptr to use black
workerOptional worker object to distribute the computation
Returns
Returns the resulting blend frame showing the feature correspondences, with pixel format FORMAT_RGB24

◆ paintCorrespondencesHomography()

static bool Ocean::Tracking::Utilities::paintCorrespondencesHomography ( const Frame frame0,
const Frame frame1,
const SquareMatrix3 points1_H_points0,
const Vector2 points0,
const Vector2 points1,
const size_t  numberPoints,
const bool  fullCoverage,
Frame result,
const uint8_t *  foregroundColor = nullptr,
const uint8_t *  backgroundColor = nullptr,
const uint8_t *  startColor = nullptr,
Worker worker = nullptr 
)
static

Joins two corresponding frames by application of a homography and paints a set of given feature correspondences.

The second frame will be aligned so that it matches with the first frame (by application of the homography).
Both frame can have individual frame dimensions.

Parameters
frame0The first frame, must be valid
frame1The second frame, with pixel origin as the first frame, must be valid
points1_H_points0The homography transforming points defined in the first frame to points defined in the second frame, must be valid
points0The positions of the feature correspondences in the first frame, with range [0, frame0.width())x[0, frame0.height())
points1The positions of the feature correspondences in the second frame, each point as a corresponding point in the first frame, with range [0, frame1.width())x[0, frame1.height())
numberPointsThe number of given feature correspondences, with range [0, infinity)
fullCoverageTrue, to create a frame fully covering both frames; False, to create a frame covering the first frame only
resultReturns the resulting joined frame showing the feature correspondences
foregroundColorThe foreground color that will be used to paint the lines, ensure that one value is provided for each frame channel, nullptr to use black
backgroundColorOptional background color that will used for each line, nullptr to avoid the usage of a background color
startColorOptional color of the start points of each line, nullptr to avoid the usage of a color for the start point
workerOptional worker object to distribute the computation
Returns
True, if succeeded

◆ paintCorrespondencesHorizontal()

static Frame Ocean::Tracking::Utilities::paintCorrespondencesHorizontal ( const Frame frame0,
const Frame frame1,
const Vector2 points0,
const Vector2 points1,
const size_t  numberPoints,
const uint8_t *  color = nullptr,
Worker worker = nullptr 
)
static

Joins two corresponding frames horizontally and paints a set of given feature correspondences.

Both frame can have individual frame dimensions (as long as the pixel origin is identical).
Internally both images will be converted to FORMAT_RGB24 images.

Parameters
frame0The first frame, must be valid
frame1The second frame, with same pixel origin as the first frame, must be valid
points0The positions of the feature correspondences in the first frame
points1The positions of the feature correspondences in the second frame, each point as a corresponding point in the first frame
numberPointsThe number of given feature correspondences, with range [0, infinity)
colorThe color that will be used to paint the points, ensure that three values are provided (with order R, G, B), otherwise nullptr to use black
workerOptional worker object to distribute the computation
Returns
Returns the resulting joined frame showing the feature correspondences, with pixel format FORMAT_RGB24

◆ paintCorrespondencesOrientations()

static bool Ocean::Tracking::Utilities::paintCorrespondencesOrientations ( const PinholeCamera pinholeCamera,
const Frame frame0,
const Frame frame1,
const SquareMatrix3 orientation0,
const SquareMatrix3 orientation1,
const Vector2 points0,
const Vector2 points1,
const size_t  numberPoints,
Frame result,
const uint8_t *  foregroundColor = nullptr,
const uint8_t *  backgroundColor = nullptr,
const uint8_t *  startColor = nullptr,
Worker worker = nullptr 
)
static

Joins two corresponding frames by application of their orientations and paints a set of given feature correspondences.

Parameters
pinholeCameraThe pinhole camera profile defining the project, must be valid
frame0The first frame with frame dimension as the camera dimension, must be valid
frame1The second frame, with frame type as the first frame, must be valid
orientation0The orientation of the first frame, must be valid
orientation1The orientation of the second frame, must be valid
points0The positions of the feature correspondences in the first frame, with range [0, frame0.width())x[0, frame0.height())
points1The positions of the feature correspondences in the second frame, each point as a corresponding point in the first frame, with range [0, frame1.width())x[0, frame1.height())
numberPointsThe number of given feature correspondences, with range [0, infinity)
resultReturns the resulting joined frame showing the feature correspondences
foregroundColorThe foreground color that will be used to paint the lines, ensure that one value is provided for each frame channel, nullptr to use black
backgroundColorOptional background color that will used for each line, nullptr to avoid the usage of a background color
startColorOptional color of the start points of each line, nullptr to avoid the usage of a color for the start point
workerOptional worker object to distribute the computation
Returns
True, if succeeded

◆ paintCorrespondencesSubset()

template<unsigned int tObjectPointSize, unsigned int tImagePointSize>
void Ocean::Tracking::Utilities::paintCorrespondencesSubset ( Frame frame,
const AnyCamera camera,
const HomogenousMatrix4 flippedCamera_T_model,
const Vector3 objectPoints,
const Vector2 imagePoints,
const Scalar  maxSqrError,
const uint8_t *  colorValidObjectPoints,
const uint8_t *  colorValidImagePoints,
const uint8_t *  colorInvalidObjectPoints,
const uint8_t *  colorInvalidImagePoints,
const bool  drawObjectPoints,
const bool  drawImagePoints,
const bool  drawConnections,
const unsigned int  firstCorrespondence,
const unsigned int  numberCorrespondences 
)
staticprotected

Paints a subset of a set of correspondences between 2D image points and 3D object points (rather their projected 2D counterparts respectively) into a given frame with sub-pixel accuracy.

The projected object points will be painted first, followed by their corresponding image points.
Further, a connection between the projected object points and the corresponding image points can be painted, which can be helpful if the given pose is not accurate.

Parameters
frameThe frame in which the projected object points and image points will be painted
cameraThe camera profile defining the projection between 3D object points and camera plane
flippedCamera_T_modelThe inverted and flipped camera pose transforming points located in coordinate system of the model to points located in the coordinate system of the flipped camera, must be valid
objectPointsThe object points which will be projected into the camera frame
imagePointsThe image points corresponding to the given object points, the smaller the distance between image points and projected object points the more accurate the camera pose
maxSqrErrorThe maximal square pixel error between a projected object point and the corresponding image point to count as valid, with range [0, infinity)
colorValidObjectPointsThe color for valid object points
colorValidImagePointsThe color for valid object points
colorInvalidObjectPointsThe color for invalid object points
colorInvalidImagePointsThe color for invalid image points
drawObjectPointsTrue, to draw the object points
drawImagePointsTrue, to draw the image points
drawConnectionsTrue, to draw the connections between projected object points and the corresponding image points
firstCorrespondenceThe first correspondence to handle
numberCorrespondencesThe number of correspondences to handle
Template Parameters
tObjectPointSizeThe radius of the object points, must be odd with range [tImagePointSize, infinity)
tImagePointSizeThe radius of the image points, must be odd, with range [1, infinity)
See also
paintCorrespondences().

◆ paintCorrespondencesVertical()

static Frame Ocean::Tracking::Utilities::paintCorrespondencesVertical ( const Frame frame0,
const Frame frame1,
const Vector2 points0,
const Vector2 points1,
const size_t  numberPoints,
const uint8_t *  color = nullptr,
Worker worker = nullptr 
)
static

Joins two corresponding frames vertically and paints a set of given feature correspondences.

Both frame can have individual frame dimensions, while internally both images will be converted to FORMAT_RGB24 images.

Parameters
frame0The first frame, must be valid
frame1The second frame, with pixel origin as the first frame, must be valid
points0The positions of the feature correspondences in the first frame
points1The positions of the feature correspondences in the second frame, each point as a corresponding point in the first frame
numberPointsThe number of given feature correspondences, with range [0, infinity)
colorThe color that will be used to paint the points, ensure that three values are provided (with order: R, G, B), otherwise nullptr to use black
workerOptional worker object to distribute the computation
Returns
Returns the resulting joined frame showing the feature correspondences, with pixel format FORMAT_RGB24

◆ paintFeaturePoint()

static void Ocean::Tracking::Utilities::paintFeaturePoint ( Frame frame,
const Vector2 position,
const Scalar  radius,
const Scalar  orientation,
const uint8_t *  color,
const uint8_t *  shadowColor 
)
static

Paints a feature point having a radius (a scale) and orientation.

Parameters
frameThe frame in which the projected object points will be painted, must be valid
positionThe position of the feature point defined in the pixel domain of the given frame, with range (-infinity, infinity)x(-infinity, infinity)
radiusThe radius (scale) of the feature point in pixel, with range (0, infinity)
orientationThe orientation of the feature point as CCW angle in radian, with range [0, 2PI)
colorThe color for the feature point, one value for each frame data channel
shadowColorThe outer color for the object points, one value for each frame data channel or nullptr to skip painting the shadow

◆ paintFeaturePoint8BitPerChannel()

template<unsigned int tChannels>
void Ocean::Tracking::Utilities::paintFeaturePoint8BitPerChannel ( uint8_t *  frame,
const unsigned int  width,
const unsigned int  height,
const Vector2 position,
const Scalar  radius,
const Scalar  orientation,
const uint8_t *  color,
const uint8_t *  shadowColor,
const unsigned int  framePaddingElements = 0u 
)
static

Paints a feature point having a radius (a scale) and orientation.

Parameters
frameThe frame in which the feature points will be painted, must be valid
widthThe width of the frame in pixel, with range (0, infinity)
heightThe height of the frame in pixel, with range (0, infinity)
positionThe position of the feature point defined in the pixel domain of the given frame, with range (-infinity, infinity)x(-infinity, infinity)
radiusThe radius (scale) of the feature point in pixel, with range (0, infinity)
orientationThe orientation of the feature point as CCW angle in radian, with range [0, 2PI)
colorThe color for the feature point, one value for each frame data channel
shadowColorThe outer color for the object points, one value for each frame data channel or nullptr to skip painting the shadow
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
Template Parameters
tChannelsThe number of data channels, with range [1, infinity)

◆ paintFeaturePoints()

static void Ocean::Tracking::Utilities::paintFeaturePoints ( Frame frame,
const Vector2 positions,
const Scalar radii,
const Scalar orientations,
const size_t  size,
const uint8_t *  color,
const uint8_t *  shadowColor,
const Vector2 explicitOffset = Vector2(0, 0),
Worker worker = nullptr 
)
static

Paints feature points having a radius (a scale) and orientation.

Parameters
frameThe frame in which the projected object points will be painted, must be valid
positionsThe positions of the feature points defined in the pixel domain of the given frame, with range (-infinity, infinity)x(-infinity, infinity), can be nullptr if size is 0
radiiThe radii (scale) of the feature points in pixel, with range (0, infinity), one for each position, can be nullptr if size is 0
orientationsThe orientations of the feature points as CCW angle in radian, with range [0, 2PI), one for each position, can be nullptr if size is 0
sizeThe number of feature points to be painted, with range [0, infinity)
colorThe color for the feature point, one value for each frame data channel
shadowColorThe outer color for the object points, one value for each frame data channel or nullptr to skip painting the shadow
explicitOffsetOptional explicit offset which will be added to every feature point location before the point is painted, with range (-infinity, infinity)x(-infinity, infinity)
workerOptional worker object to distribute the computation

◆ paintFeaturePoints8BitPerChannel()

template<unsigned int tChannels>
void Ocean::Tracking::Utilities::paintFeaturePoints8BitPerChannel ( uint8_t *  frame,
const unsigned int  width,
const unsigned int  height,
const Vector2 positions,
const Scalar radii,
const Scalar orientations,
const size_t  size,
const uint8_t *  color,
const uint8_t *  shadowColor,
const Vector2 explicitOffset,
const unsigned int  framePaddingElements,
Worker worker = nullptr 
)
inlinestatic

Paints feature points having a radius (a scale) and orientation.

Parameters
frameThe frame in which the feature points will be painted, must be valid
widthThe width of the frame in pixel, with range (0, infinity)
heightThe height of the frame in pixel, with range (0, infinity)
positionsThe positions of the feature points defined in the pixel domain of the given frame, with range (-infinity, infinity)x(-infinity, infinity), can be nullptr if size is 0
radiiThe radii (scale) of the feature points in pixel, with range (0, infinity), one for each position, can be nullptr if size is 0
orientationsThe orientations of the feature points as CCW angle in radian, with range [0, 2PI), one for each position, can be nullptr if size is 0
sizeThe number of feature points to be painted, with range [0, infinity)
colorThe color for the feature point, one value for each frame data channel
shadowColorThe outer color for the object points, one value for each frame data channel or nullptr to skip painting the shadow
explicitOffsetOptional explicit offset which will be added to every feature point location before the point is painted, with range (-infinity, infinity)x(-infinity, infinity)
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
workerOptional worker object to distribute the computation
Template Parameters
tChannelsThe number of data channels, with range [1, infinity)

◆ paintFeaturePoints8BitPerChannelSubset()

template<unsigned int tChannels>
void Ocean::Tracking::Utilities::paintFeaturePoints8BitPerChannelSubset ( uint8_t *  frame,
const unsigned int  width,
const unsigned int  height,
const Vector2 positions,
const Scalar radii,
const Scalar orientations,
const uint8_t *  color,
const uint8_t *  shadowColor,
const Scalar  offsetX,
const Scalar  offsetY,
const unsigned int  framePaddingElements,
const unsigned int  firstFeaturePoint,
const unsigned int  numberFeaturePoints 
)
inlinestaticprotected

Paints a subset of feature points having a radius (a scale) and orientation.

Parameters
frameThe frame in which the feature points will be painted, must be valid
widthThe width of the frame in pixel, with range (0, infinity)
heightThe height of the frame in pixel, with range (0, infinity)
positionsThe positions of the feature points defined in the pixel domain of the given frame, with range (-infinity, infinity)x(-infinity, infinity)
radiiThe radii (scale) of the feature points in pixel, with range (0, infinity), one for each position
orientationsThe orientations of the feature points as CCW angle in radian, with range [0, 2PI), one for each position
colorThe color for the feature point, one value for each frame data channel
shadowColorThe outer color for the object points, one value for each frame data channel or nullptr to skip painting the shadow
offsetXExplicit horizontal offset which will be added to every feature point location before the point is painted, with range (-infinity, infinity)
offsetYExplicit vertical offset which will be added to every feature point location before the point is painted, with range (-infinity, infinity)
framePaddingElementsThe number of padding elements at the end of each frame row, in elements, with range [0, infinity)
firstFeaturePointThe first feature point to be handled, with range [0, 'size')
numberFeaturePointsThe number of feature points to be handled, with range [1, 'size']
Template Parameters
tChannelsThe number of data channels, with range [1, infinity)

◆ paintImagePoints()

template<unsigned int tPointSize>
void Ocean::Tracking::Utilities::paintImagePoints ( Frame frame,
const Vector2 imagePoints,
const size_t  size,
const uint8_t *  color,
Worker worker = nullptr 
)
inlinestatic

Paints a set of 2D image points into a given frame with sub-pixel accuracy.

Parameters
frameThe frame in which the image points will be painted
imagePointsThe image points which will be painted
sizeThe number of given 2D points, with range [0, infinity)
colorThe color for the image points
workerOptional worker object to distribute the computation
Template Parameters
tPointSizeThe radius of the image points, must be odd with range [1, infinity)

◆ paintImagePointsSubset()

template<unsigned int tPointSize>
void Ocean::Tracking::Utilities::paintImagePointsSubset ( Frame frame,
const Vector2 imagePoints,
const uint8_t *  color,
const unsigned int  firstImagePoint,
const unsigned int  numberImagePoints 
)
inlinestaticprotected

Paints subset of a set of 2D image points into a given frame with sub-pixel accuracy.

Parameters
frameThe frame in which the image points will be painted
imagePointsThe image points which will be painted
colorThe color for the image points
firstImagePointThe first image point to handle
numberImagePointsThe number of image points to handle
Template Parameters
tPointSizeThe radius of the image points, must be odd with range [1, infinity)

◆ paintLine()

void Ocean::Tracking::Utilities::paintLine ( Frame frame,
const Vector2 startPosition,
const Vector2 stopPosition,
const uint8_t *  color = nullptr,
const bool  subPixel = true 
)
inlinestatic

Paints a line into a given frame.

Parameters
frameThe frame in which is drawn
startPositionStart position of line
stopPositionStop position of line
colorThe color that will be used to paint the points, ensure that one value is provided for each frame channel, otherwise black is used
subPixelTrue, to paint the line with sub-pixel accuracy; False, to paint the line with pixel accuracy

◆ paintLineIF()

static void Ocean::Tracking::Utilities::paintLineIF ( Frame frame,
const HomogenousMatrix4 flippedCamera_T_world,
const AnyCamera anyCamera,
const Vector3 objectPoint0,
const Vector3 objectPoint1,
const unsigned int  segments,
const uint8_t *  foregroundColor,
const uint8_t *  backgroundColor 
)
static

Paints a (projected) 3D line into a given frame.

Parameters
frameThe frame in which the triangle will be painted, must be valid
flippedCamera_T_worldThe transformation transforming world to the flipped camera, the flipped camera points towards the positive z-space with y-axis down, must be valid
anyCameraThe camera profile defining the projection, must be valid
objectPoint0The start 3D object point of the 3D line, defined in world
objectPoint1The end 3D object point of the 3D line, defined in world
segmentsThe number of segments in which the line will be separated, with range [1, infinity), the more segments the better the adjustment to the camera distortion (if any)
foregroundColorThe foreground color of the plane, nullptr to skip the painting with the foreground color
backgroundColorThe background color of the plane, nullptr to skip the painting with the background color

◆ paintLines() [1/3]

template<unsigned int tSize>
void Ocean::Tracking::Utilities::paintLines ( Frame frame,
const Vector2 startPositions,
const Vector2 stopPositions,
const size_t  numberLines,
const uint8_t *  color = nullptr,
Worker worker = nullptr 
)
inlinestatic

Paints a set of lines into a given frame with sub-pixel accuracy.

Parameters
frameThe frame in which is drawn, must be valid
startPositionsStart positions of the lines
stopPositionsStop positions of the lines, each end position must have a corresponding start position
numberLinesThe number of lines, with range [0, infinity)
colorThe color that will be used to paint the points, ensure that one value is provided for each frame channel, nullptr to apply black
workerOptional worker object to distribute the computation
Template Parameters
tSizeThe thickness of the lines in pixel, must be odd with range [1, infinity)

◆ paintLines() [2/3]

void Ocean::Tracking::Utilities::paintLines ( Frame frame,
const Vector2 startPositions,
const Vector2 stopPositions,
const size_t  numberLines,
const uint8_t *  color = nullptr,
Worker worker = nullptr,
const bool  subPixel = true,
const Vector2 offsetStartPositions = Vector2(0, 0),
const Vector2 offsetStopPositions = Vector2(0, 0) 
)
inlinestatic

Paints a set of lines into a given frame.

Parameters
frameThe frame in which is drawn
startPositionsStart positions of the lines
stopPositionsStop positions of the lines, each end position must have a corresponding start position
numberLinesThe number of lines, with range [0, infinity)
colorThe color that will be used to paint the points, ensure that one value is provided for each frame channel, nullptr to apply black
workerOptional worker object to distribute the computation
subPixelTrue, to paint the lines with sub-pixel accuracy; False, to paint the lines with pixel accuracy
offsetStartPositionsThe offset which will be added to each start position before painting the line, with range (-infinity, infinity)x(-infinity, infinity)
offsetStopPositionsThe offset which will be added to each stop position before painting the line, with range (-infinity, infinity)x(-infinity, infinity)

◆ paintLines() [3/3]

template<unsigned int tSizeForeground, unsigned int tSizeBackground>
void Ocean::Tracking::Utilities::paintLines ( Frame frame,
const Vector2 startPositions,
const Vector2 stopPositions,
const size_t  numberLines,
const uint8_t *  colorForeground = nullptr,
const uint8_t *  colorBackground = nullptr,
Worker worker = nullptr 
)
inlinestatic

Paints a set of lines with (foreground and) background color into a given frame with sub-pixel accuracy.

Parameters
frameThe frame in which is drawn, must be valid
startPositionsStart positions of the lines
stopPositionsStop positions of the lines, each end position must have a corresponding start position
numberLinesThe number of lines, with range [0, infinity)
colorForegroundForeground color that will be used to paint the points, ensure that one value is provided for each frame channel, nullptr to use black
colorBackgroundBackground color that will be used to paint the points, ensure that one value is provided for each frame channel, nullptr to use black
workerOptional worker object to distribute the computation
Template Parameters
tSizeForegroundThe thickness of the foreground lines in pixel, must be odd with range [1, infinity)
tSizeBackgroundThe thickness of the background lines in pixel, must be odd with range (tSizeForeground, infinity)

◆ paintLinesSubset() [1/3]

void Ocean::Tracking::Utilities::paintLinesSubset ( Frame frame,
const Vector2 startPositions,
const Vector2 stopPositions,
const uint8_t *  color,
const bool  subPixel,
const Vector2 offsetStartPositions,
const Vector2 offsetStopPositions,
const unsigned int  firstLine,
const unsigned int  numberLines 
)
inlinestaticprotected

Paints a subset of a set of lines into a given frame.

Parameters
frameThe frame in which is drawn
startPositionsStart positions of the lines
stopPositionsStop positions of the lines, each end position must have a corresponding start position
colorThe color that will be used to paint the lines, ensure that one value is provided for each frame channel, nullptr to use black
subPixelTrue, to paint the lines with sub-pixel accuracy; False, to paint the lines with pixel accuracy
offsetStartPositionsThe offset which will be added to each start position before painting the line, with range (-infinity, infinity)x(-infinity, infinity)
offsetStopPositionsThe offset which will be added to each stop position before painting the line, with range (-infinity, infinity)x(-infinity, infinity)
firstLineFirst line to be handled
numberLinesThe number of lines to be handled

◆ paintLinesSubset() [2/3]

template<unsigned int tSize>
void Ocean::Tracking::Utilities::paintLinesSubset ( Frame frame,
const Vector2 startPositions,
const Vector2 stopPositions,
const uint8_t *  color,
const unsigned int  firstLine,
const unsigned int  numberLines 
)
inlinestaticprotected

Paints a subset of a set of lines into a given frame with sub-pixel accuracy.

Parameters
frameThe frame in which is drawn, must be valid
startPositionsStart positions of the lines
stopPositionsStop positions of the lines, each end position must have a corresponding start position
colorThe color that will be used to paint the lines, ensure that one value is provided for each frame channel, nullptr to use black
firstLineFirst line to be handled
numberLinesThe number of lines to be handled
Template Parameters
tSizeThe thickness of the lines in pixel, must be odd with range [1, infinity)

◆ paintLinesSubset() [3/3]

template<unsigned int tSizeForeground, unsigned int tSizeBackground>
void Ocean::Tracking::Utilities::paintLinesSubset ( Frame frame,
const Vector2 startPositions,
const Vector2 stopPositions,
const uint8_t *  colorForeground,
const uint8_t *  colorBackground,
const unsigned int  firstLine,
const unsigned int  numberLines 
)
inlinestaticprotected

Paints a subset of a set of lines into a given frame with sub-pixel accuracy.

Parameters
frameThe frame in which is drawn, must be valid
startPositionsStart positions of the lines
stopPositionsStop positions of the lines, each end position must have a corresponding start position
colorForegroundForeground color that will be used to paint the points, ensure that one value is provided for each frame channel, nullptr to use black
colorBackgroundBackground color that will be used to paint the points, ensure that one value is provided for each frame channel, nullptr to use black
firstLineFirst line to be handled
numberLinesThe number of lines to be handled
Template Parameters
tSizeForegroundThe thickness of the foreground lines in pixel, must be odd with range [1, infinity)
tSizeBackgroundThe thickness of the background lines in pixel, must be odd with range (tSizeForeground, infinity)

◆ paintMask()

static Frame Ocean::Tracking::Utilities::paintMask ( const Frame frame,
const Frame mask,
const uint8_t  maskValue = uint8_t(0xFFu),
Worker worker = nullptr 
)
static

Paints / blends a binary 8 bit mask into a given frame with identical frame dimension.

Parameters
frameThe frame in which the mask will be painted, must be valid
maskThe binary mask frame, with frame dimension matching with the given frame, must be valid
maskValueThe mask value defining pixels which will be painted as masked, may be 0x00 or 0xFF
workerOptional worker object to distribute the computation
Returns
The resulting frame with blended mask

◆ paintObjectPoints()

template<unsigned int tPointSize>
void Ocean::Tracking::Utilities::paintObjectPoints ( Frame frame,
const AnyCamera anyCamera,
const HomogenousMatrix4 world_T_camera,
const Vector3 objectPoints,
const size_t  size,
const uint8_t *  color,
Worker worker = nullptr 
)
inlinestatic

Paints a set of 3D object points (rather their projected 2D counterparts respectively) into a given frame with sub-pixel accuracy.

Parameters
frameThe frame in which the projected object points will be painted
anyCameraThe camera profile defining the projection between 3D object points and camera plane
world_T_cameraThe camera pose from which the 3D object points are observed with default viewing direction towards the negative z-space and y-axis as up vector, transforming camera to world, must be valid
objectPointsThe object points which will be projected into the camera frame, defined in world
sizeThe number of given 3D points, with range [0, infinity)
colorThe color for the object points
workerOptional worker object to distribute the computation
Template Parameters
tPointSizeThe radius of the object points, must be odd with range [1, infinity)

◆ paintObjectPointsSubset()

template<unsigned int tPointSize>
void Ocean::Tracking::Utilities::paintObjectPointsSubset ( Frame frame,
const AnyCamera anyCamera,
const HomogenousMatrix4 flippedCamera_T_world,
const Vector3 objectPoints,
const uint8_t *  color,
const unsigned int  firstObjectPoint,
const unsigned int  numberObjectPoints 
)
inlinestaticprotected

Paints a subset of set of 3D object points (rather their projected 2D counterparts respectively) into a given frame with sub-pixel accuracy.

Parameters
frameThe frame in which the projected object points will be painted
anyCameraThe camera profile defining the projection between 3D object points and camera plane, must be valid
flippedCamera_T_worldThe inverted and flipped camera pose from which the 3D object points are observed, with default camera pointing towards the positive z-space with y-axis down, must be valid
objectPointsThe object points which will be projected into the camera frame
colorThe color for the object points
firstObjectPointThe first object point to handle
numberObjectPointsThe number of object points to handle
Template Parameters
tPointSizeThe radius of the object points, must be odd with range [1, infinity)

◆ paintPaths() [1/2]

template<unsigned int tSize>
void Ocean::Tracking::Utilities::paintPaths ( Frame frame,
const Vectors2 paths,
const size_t  size,
const uint8_t *  color0,
const uint8_t *  color1,
const Scalar factors,
Worker worker = nullptr 
)
inlinestatic

Paints several paths into a given frame with sub-pixel accuracy.

A path is a chain of connected image points with arbitrary length (start and end point are not connected).
The colors of the paths are determined by an interpolation between two separate color values.

Parameters
frameThe frame in which the paths will be painted
pathsThe individual paths to be painted
sizeThe number of given paths, with range [0, infinity)
color0The first color value, ensure that one value is provided for each frame channel
color1The second color value, ensure that one value is provided for each frame channel
factorsThe interpolation factor, one factor for each path, with range [0, 1]
workerOptional worker object to distribute the computation
Template Parameters
tSizeThe thickness of the paths in pixel, must be odd with range [1, infinity)

◆ paintPaths() [2/2]

template<unsigned int tSize>
void Ocean::Tracking::Utilities::paintPaths ( Frame frame,
const Vectors2 paths,
const size_t  size,
const uint8_t *  color = nullptr,
Worker worker = nullptr 
)
inlinestatic

Paints several paths into a given frame with sub-pixel accuracy.

A path is a chain of connected image points with arbitrary length (start and end point are not connected).

Parameters
frameThe frame in which the paths will be painted
pathsThe individual paths to be painted
sizeThe number of given paths, with range [0, infinity)
colorThe color that will be used to paint the points, ensure that one value is provided for each frame channel, nullptr to apply black
workerOptional worker object to distribute the computation
Template Parameters
tSizeThe thickness of the paths in pixel, must be odd with range [1, infinity)

◆ paintPathsAdvancedSubset()

template<unsigned int tSize>
void Ocean::Tracking::Utilities::paintPathsAdvancedSubset ( Frame frame,
const Vectors2 paths,
const uint8_t *  color0,
const uint8_t *  color1,
const Scalar factors,
const unsigned int  firstPath,
const unsigned int  numberPaths 
)
inlinestaticprotected

Paints a subset of several paths into a given frame with sub-pixel accuracy.

The colors of the paths are determined by an interpolation between two separate color values.

Parameters
frameThe frame in which the paths will be painted
pathsThe individual paths to be painted
color0The first color value, ensure that one value is provided for each frame channel
color1The second color value, ensure that one value is provided for each frame channel
factorsThe interpolation factor, one factor for each path, with range [0, 1]
firstPathThe first path to handled
numberPathsThe number of paths to handle
Template Parameters
tSizeThe thickness of the paths in pixel, must be odd with range [1, infinity)
See also
paintPaths().

◆ paintPathsSubset()

template<unsigned int tSize>
void Ocean::Tracking::Utilities::paintPathsSubset ( Frame frame,
const Vectors2 paths,
const uint8_t *  color,
const unsigned int  firstPath,
const unsigned int  numberPaths 
)
inlinestaticprotected

Paints a subset of several paths into a given frame with sub-pixel accuracy.

Parameters
frameThe frame in which the paths will be painted
pathsThe individual paths to be painted
colorThe color that will be used to paint the points, ensure that one value is provided for each frame channel, nullptr to apply black
firstPathThe first path to handled
numberPathsThe number of paths to handle
Template Parameters
tSizeThe thickness of the paths in pixel, must be odd with range [1, infinity)
See also
paintPaths().

◆ paintPlane()

static bool Ocean::Tracking::Utilities::paintPlane ( Frame frame,
const HomogenousMatrix4 world_T_camera,
const AnyCamera camera,
const HomogenousMatrix4 planeTransformation,
const unsigned int  bins,
const uint8_t *  foregroundColor,
const uint8_t *  backgroundColor,
Scalar expansion = nullptr 
)
static

Paints a 3D plane into the frame, further the origin of the plane is painted.

This function determines a worthwhile expansion of the plane best matching with the scene.

Parameters
frameThe frame in which the plane is painted
world_T_cameraThe camera pose from which the 3D object points are observed with default viewing direction towards the negative z-space and y-axis as up vector, transforming camera to world, must be valid
cameraThe camera profile defining the project, must be valid
planeTransformationThe transformation having the origin on the plane and the z-axis parallel to the plane's normal
binsThe number of bins in both direction that will be painted, with range [1, infinity)
foregroundColorThe foreground color of the plane, nullptr to skip the painting with the foreground color
backgroundColorThe background color of the plane, nullptr to skip the painting with the background color
expansionOptional resulting plane's expansion in the scene in x-axis and y-axis defined in world coordinates, with range (0, infinity)
Returns
True, if the plane is perpendicular to the given camera frame

◆ paintPlaneIF()

static bool Ocean::Tracking::Utilities::paintPlaneIF ( Frame frame,
const HomogenousMatrix4 flippedCamera_T_world,
const AnyCamera camera,
const HomogenousMatrix4 planeTransformation,
const Scalar  expansion,
const unsigned int  bins,
const uint8_t *  foregroundColor,
const uint8_t *  backgroundColor 
)
static

Paints a 3D plane into the frame, further the origin of the plane is painted.

Parameters
frameThe frame in which the plane is painted
flippedCamera_T_worldThe camera posed converting world to the flipped camera coordinate system (a camera coordinate system pointing towards the positive z-space), must be valid
cameraThe camera profile defining the project, must be valid
planeTransformationThe transformation having the origin on the plane and the z-axis parallel to the plane's normal
expansionThe plane's expansion for the scene in x-axis and y-axis defined in world coordinates, with range (0, infinity)
binsThe number of bins in both direction that will be painted, with range [1, infinity)
foregroundColorThe foreground color of the plane, nullptr to skip the painting with the foreground color
backgroundColorThe background color of the plane, nullptr to skip the painting with the background color
Returns
True, if the plane is perpendicular to the given camera frame

◆ paintPoints() [1/2]

void Ocean::Tracking::Utilities::paintPoints ( Frame frame,
const HomogenousMatrix4 world_T_camera,
const PinholeCamera pinholeCamera,
const Vector3 objectPoints,
const size_t  numberObjectPoints,
const Vector2 imagePoints,
const size_t  numberImagePoints,
const bool  distortProjectedObjectPoints,
const unsigned int  radiusObjectPoints,
const unsigned int  radiusImagePoints,
const uint8_t *  colorObjectPoints = nullptr,
const uint8_t *  colorImagePoints = nullptr 
)
inlinestatic

Paints (projected) object points and image points into a given frame.

Parameters
frameThe frame receiving the points
world_T_cameraThe transformations between camera and the world, must be valid
pinholeCameraThe pinhole camera profile defining the projection, with dimension equal to the frame dimension
objectPointsThe object points that will be painted, defined in world
numberObjectPointsNumber of provided object points, with range [0, infinity)
imagePointsImage points that will be painted
numberImagePointsNumber of provided image points, with range [0, infinity)
distortProjectedObjectPointsTrue, to apply the distortion parameters of the camera to the projected object points
radiusObjectPointsRadius of the object point paintings in pixel
radiusImagePointsRadius of the image point paintings in pixel
colorObjectPointsColor that will be used to paint the object points, ensure that one value is provided for each frame channel, otherwise white is used
colorImagePointsColor that will be used to paint the image points, ensure that one value is provided for each frame channel, otherwise white is used

◆ paintPoints() [2/2]

static void Ocean::Tracking::Utilities::paintPoints ( Frame frame,
const Vector2 imagePoints,
const size_t  number,
const unsigned int  radius,
const uint8_t *  colorInner = nullptr,
const uint8_t *  colorOuter = nullptr 
)
static

Paints a set of image points into a given frame.

Parameters
frameThe frame receiving the points
imagePointsImage points that will be painted
numberThe number of provided image points, with range [0, infinity)
radiusThe radius of the paintings in pixel, with range [0, infinity)
colorInnerInner color that will be used, ensure that one value is provided for each frame channel, otherwise white is used
colorOuterOuter color that will be used, ensure that one value is provided for each frame channel, otherwise black is used

◆ paintPointsIF()

static void Ocean::Tracking::Utilities::paintPointsIF ( Frame frame,
const HomogenousMatrix4 flippedCamera_T_world,
const PinholeCamera pinholeCamera,
const Vector3 objectPoints,
const size_t  numberObjectPoints,
const Vector2 imagePoints,
const size_t  numberImagePoints,
const bool  distortProjectedObjectPoints,
const unsigned int  radiusObjectPoints,
const unsigned int  radiusImagePoints,
const uint8_t *  colorObjectPoints = nullptr,
const uint8_t *  colorImagePoints = nullptr 
)
static

Paints (projected) object points and image points into a given frame.

Parameters
frameThe frame receiving the points, must be valid
flippedCamera_T_worldThe transformation between the world and the flipped camera, must be valid
pinholeCameraThe pinhole camera profile defining the projection, with dimension equal to the frame dimension
objectPointsThe object points that will be painted, defined in world
numberObjectPointsNumber of provided object points, with range [0, infinity)
imagePointsImage points that will be painted
numberImagePointsNumber of provided image points, with range [0, infinity)
distortProjectedObjectPointsTrue, to apply the distortion parameters of the camera to the projected object points
radiusObjectPointsRadius of the object point paintings in pixel
radiusImagePointsRadius of the image point paintings in pixel
colorObjectPointsColor that will be used to paint the object points, ensure that one value is provided for each frame channel, otherwise white is used
colorImagePointsColor that will be used to paint the image points, ensure that one value is provided for each frame channel, otherwise white is used

◆ paintQuads()

void Ocean::Tracking::Utilities::paintQuads ( Frame frame,
const HomogenousMatrix4 world_T_camera,
const AnyCamera camera,
const Vector3 quadOrigin,
const Vector3 quadHorizontal,
const Vector3 quadVertical,
const unsigned int  horizontalBins,
const unsigned int  verticalBins,
const uint8_t *  color = nullptr 
)
inlinestatic

Paints quads that are located on a 3D plane into a given frame.

Parameters
frameThe frame receiving the points
world_T_cameraThe camera pose from which the 3D object points are observed with default viewing direction towards the negative z-space and y-axis as up vector, transforming camera to world, must be valid
cameraThe camera profile defining the projection, with dimension equal to the frame dimension
quadOriginOrigin of the upper left quad position, defined in world
quadHorizontalVector starting at the quad origin and defining the horizontal direction of the quads, defined in world
quadVerticalVector starting at the quad origin and defining the vertical direction of the quads, defined in world
horizontalBinsNumber of horizontal bins that will be painted
verticalBinsNumber of vertical bins that will be painted
colorThe color that will be used to paint the points, ensure that one value is provided for each frame channel, otherwise black is used

◆ paintQuadsIF()

static void Ocean::Tracking::Utilities::paintQuadsIF ( Frame frame,
const HomogenousMatrix4 flippedCamera_T_world,
const AnyCamera camera,
const Vector3 quadOrigin,
const Vector3 quadHorizontal,
const Vector3 quadVertical,
const unsigned int  horizontalBins,
const unsigned int  verticalBins,
const uint8_t *  color = nullptr 
)
static

Paints quads that are located on a 3D plane into a given frame.

See also
paintQuads().

◆ paintTriangle()

template<unsigned int tSize>
void Ocean::Tracking::Utilities::paintTriangle ( Frame frame,
const Triangle2 triangle,
const uint8_t *  color = nullptr 
)
static

Paints a 2D triangle into a given frame with sub-pixel accuracy.

Parameters
frameThe frame receiving the triangles
triangleThe triangle that will be painted, must be valid
colorThe color that will be used to paint the triangle edges, ensure that one value is provided for each frame channel, otherwise black is used
Template Parameters
tSizeThe thickness of the triangle edges in pixels, must be odd with range [1, infinity)

◆ paintTriangleIF()

template<unsigned int tSize>
void Ocean::Tracking::Utilities::paintTriangleIF ( Frame frame,
const HomogenousMatrix4 flippedCamera_T_world,
const AnyCamera anyCamera,
const Triangle3 triangle,
const uint8_t *  color = nullptr 
)
inlinestatic

Paints a (projected) 3D triangle into a given frame.

Parameters
frameThe frame in which the triangle will be painted, must be valid
flippedCamera_T_worldThe transformation transforming world to the flipped camera, the flipped camera points towards the positive z-space with y-axis down, must be valid
anyCameraThe camera profile defining the projection, must be valid
triangleThe triangle that will be painted
colorThe color to be used to paint the triangle edges, nullptr to use black
Template Parameters
tSizeThe thickness of the triangle edges in pixels, must be odd with range [1, infinity)

◆ paintTriangles()

template<unsigned int tSize>
void Ocean::Tracking::Utilities::paintTriangles ( Frame frame,
const Triangles2 triangles,
const uint8_t *  color = nullptr,
Worker worker = nullptr 
)
static

Paints a set of 2D triangles into a given frame with sub-pixel accuracy.

Parameters
frameThe frame receiving the triangles
trianglesThe triangles that will be painted
colorThe color that will be used to paint the triangle edges, ensure that one value is provided for each frame channel, otherwise black is used
workerOptional worker to distribute the computation
Template Parameters
tSizeThe thickness of the triangle edges in pixels, must be odd with range [1, infinity)

◆ paintTrianglesIF()

template<unsigned int tSize>
void Ocean::Tracking::Utilities::paintTrianglesIF ( Frame frame,
const HomogenousMatrix4 flippedCamera_T_world,
const AnyCamera anyCamera,
const Triangle3 triangles,
const size_t  numberTriangles,
const uint8_t *  color = nullptr,
Worker worker = nullptr 
)
static

Paints (projected) 3D triangles into a given frame.

Parameters
frameThe frame in which the triangles will be painted, must be valid
flippedCamera_T_worldThe transformation transforming world to the flipped camera, the flipped camera points towards the positive z-space with y-axis down, must be valid
anyCameraThe camera profile defining the projection, must be valid
trianglesThe 3D triangles that will be painted, defined in world, can be nullptr if 'numberTriangles == 0'
numberTrianglesNumber of triangles that will be painted, with range [0, infinity)
colorThe color to be used to paint the triangle edges, nullptr to use black
workerOptional worker to distribute the computation
Template Parameters
tSizeThe thickness of the triangle edges in pixels, must be odd with range [1, infinity)

◆ paintTrianglesIFSubset()

template<unsigned int tSize>
void Ocean::Tracking::Utilities::paintTrianglesIFSubset ( Frame frame,
const HomogenousMatrix4 flippedCamera_T_world,
const AnyCamera anyCamera,
const Triangle3 triangles,
const uint8_t *  color,
const unsigned int  firstTriangle,
const unsigned int  numberTriangles 
)
inlinestaticprotected

Projects and paints a subset of 3D triangles into a given frame with sub-pixel accuracy.

Parameters
frameThe frame in which the triangle will be painted, must be valid
flippedCamera_T_worldThe transformation transforming world to the flipped camera, the flipped camera points towards the positive z-space with y-axis down, must be valid
anyCameraThe camera profile defining the projection, must be valid
trianglesThe triangles that will be painted, defined in world, must be valid
colorThe color to be used to paint the triangle edges, nullptr to use black
firstTriangleThe first triangle to handled
numberTrianglesThe number of triangle to handle
Template Parameters
tSizeThe thickness of the triangle edges in pixels, must be odd with range [1, infinity)

◆ paintTrianglesSubset()

template<unsigned int tSize>
void Ocean::Tracking::Utilities::paintTrianglesSubset ( Frame frame,
const Triangle2 triangles,
const uint8_t *  color,
const unsigned int  firstTriangle,
const unsigned int  numberTriangles 
)
inlinestaticprotected

Paints a subset of 2D triangles into a given frame with sub-pixel accuracy.

Parameters
frameThe frame receiving the triangles
trianglesThe triangles that will be painted
colorThe color that will be used to paint the triangle points, ensure that one value is provided for each frame channel, otherwise black is used
firstTriangleThe first triangle to handled
numberTrianglesThe number of triangle to handle
Template Parameters
tSizeThe thickness of the triangle edges in pixels, must be odd with range [1, infinity)

◆ paintWireframeConeIF()

static void Ocean::Tracking::Utilities::paintWireframeConeIF ( Frame frame,
const HomogenousMatrix4 flippedCamera_T_cone,
const PinholeCamera pinholeCamera,
const Cone3 cone,
const bool  distortProjectedObjectPoints = true,
Worker worker = nullptr,
const uint8_t *  color = CV::Canvas::yellow(),
const unsigned int  numCircles = 6u,
const unsigned int  numVerticalLines = 4u,
const unsigned int  numSamples = 72u 
)
static

Paints a (projected) wire-frame cone into a given frame.

Parameters
frameThe frame being drawn to, must be valid
flippedCamera_T_coneInverted and flipped pose of the camera w.r.t the cone
pinholeCameraThe pinhole camera profile defining the projection, with dimension equal to the frame dimension
coneThe cone that will be painted
distortProjectedObjectPointsTrue, to apply the distortion parameters of the camera to the projected object points
workerOptional worker to distribute the computation
colorThe color for the drawn lines
numCirclesNumber of axis-slicing circles to draw along the cone's vertical span, with range [2, infinity)
numVerticalLinesNumber axis-parallel lines to draw around the cone, with range [0, infinity)
numSamplesNumber of lines to draw to approximate the projection of each circle, with range [3, infinity)

◆ paintWireframeCylinderIF()

static void Ocean::Tracking::Utilities::paintWireframeCylinderIF ( Frame frame,
const HomogenousMatrix4 flippedCamera_T_cylinder,
const PinholeCamera pinholeCamera,
const Cylinder3 cylinder,
const bool  distortProjectedObjectPoints = true,
Worker worker = nullptr,
const uint8_t *  color = CV::Canvas::yellow(),
const unsigned int  numCircles = 6u,
const unsigned int  numVerticalLines = 4u,
const unsigned int  numSamples = 72u 
)
static

Paints a (projected) wire-frame cylinder into a given frame.

Parameters
frameThe frame being drawn to, must be valid
flippedCamera_T_cylinderInverted and flipped pose of the camera w.r.t the cylinder
pinholeCameraThe pinhole camera profile defining the projection, with dimension equal to the frame dimension
cylinderThe cylinder that will be painted
distortProjectedObjectPointsTrue, to apply the distortion parameters of the camera to the projected object points
workerOptional worker to distribute the computation
colorThe color for the drawn lines
numCirclesNumber of axis-slicing circles to draw along the cylinder's vertical span, with range [2, infinity)
numVerticalLinesNumber axis-parallel lines to draw around the cylinder, with range [0, infinity)
numSamplesNumber of lines to draw to approximate the projection of each circle, with range [3, infinity)

◆ readCamera()

static bool Ocean::Tracking::Utilities::readCamera ( IO::InputBitstream inputStream,
PinholeCamera pinholeCamera 
)
static

Reads a camera profile from a binary input stream.

Parameters
inputStreamThe input stream providing the information
pinholeCameraThe resulting pinhole camera profile
See also
writeCamera().

◆ readDatabase()

static bool Ocean::Tracking::Utilities::readDatabase ( IO::InputBitstream inputStream,
Database database 
)
static

Reads a database information from a binary input stream.

Parameters
inputStreamThe input stream providing the information
databaseThe database receiving the information, the given database will cleared before the information is assigned
Returns
True, if succeeded
See also
writeDatabase(), readCamera().

◆ visualizeDatabase()

static void Ocean::Tracking::Utilities::visualizeDatabase ( const Database database,
const Index32  poseId,
Frame frame,
const uint8_t *  colorImagePoints,
const uint8_t *  colorImagePointsInstable,
const uint8_t *  colorImagePointsStable,
const unsigned int  maximalPathLength = 20u,
const unsigned int  stablePathLength = 100u,
const SquareMatrix3 transformation = SquareMatrix3(true),
Worker worker = nullptr 
)
static

Visualizes image point information of a tracking database for a specific pose id.

Parameters
databaseThe database holding the tracking information to be visualized
poseIdThe id of the pose for which the visualization will be created
frameThe frame receiving the visualization of the database
colorImagePointsThe color for feature points, ensure that one value is provided for each frame channel
colorImagePointsInstableThe color for instable paths, ensure that one value is provided for each frame channel
colorImagePointsStableThe color for stable paths, ensure that one value is provided for each frame channel
maximalPathLengthThe maximal length (number of concurrent frames) of paths of feature points that will be visualized, with range [0, infinity)
stablePathLengthThe length (number of concurrent frames) of paths so that they count as stable, with range [1, infinity)
transformationThe transformation matrix which will be applied to each feature point position before the position is visualized
workerOptional worker to distribute the computation

◆ writeCamera()

static bool Ocean::Tracking::Utilities::writeCamera ( const PinholeCamera pinholeCamera,
IO::OutputBitstream outputStream 
)
static

Writes a camera profile to a binary output stream.

Parameters
pinholeCameraThe pinhole camera profile to be written
outputStreamThe output stream receiving the information
Returns
True, if succeeded
See also
readCamera().

◆ writeDatabase()

static bool Ocean::Tracking::Utilities::writeDatabase ( const Database database,
IO::OutputBitstream outputStream 
)
static

Writes the information of a database to a given output stream as binary information.

Parameters
databaseThe database to be written
outputStreamThe output stream receiving the information
Returns
True, if succeeded
See also
readDatabase(), writeCamera().

The documentation for this class was generated from the following file: