Ocean
|
This class implements the basic data of an planar grid. More...
Public Member Functions | |
Grid () | |
Creates a new invalid grid element. More... | |
Grid (const HomogenousMatrix4 &plane2worldTransformation, const HomogenousMatrix4 &virtualGrid2planeTransformation=HomogenousMatrix4(true), const Vector2 &lowerCorner=Vector2(-0.5, -0.5), const Vector2 &upperCorner=Vector2(0.5, 0.5)) | |
Creates a new Grid by a plane2world transformation. More... | |
Grid (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const Vectors2 &imagePoints, const HomogenousMatrix4 &plane2worldTransformation, const HomogenousMatrix4 &virtualGrid2planeTransformation=HomogenousMatrix4(true), const bool clipBoundingBox=false) | |
Creates a new Grid by a plane2world transformation and four image points defining a rectangle. More... | |
Grid (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const Vectors2 &imagePoints, const Vector2 *gridCoordinates=nullptr, const HomogenousMatrix4 *previousPlane2worldTransformation=nullptr, const bool clipBoundingBox=false) | |
Creates a new Grid by four given image points using vanishing projection. More... | |
Grid (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const HomogenousMatrix4 &plane2worldTransformation, const Vectors2 &imagePoints, const bool clipBoundingBox=false) | |
Creates a new Grid by a given transformation that transforms points defined in a coordinate system of the plane into points defined in the world coordinate system. More... | |
const HomogenousMatrix4 & | plane2worldTransformation () const |
Returns the transformation that transforms points defined in a coordinate system of the plane into points defined in the world coordinate system. More... | |
const HomogenousMatrix4 & | grid2planeTransformation () const |
Returns the transformation that transforms points defined in a coordinate system of the grid into points defined in the plane coordinate system. More... | |
const HomogenousMatrix4 & | virtualGrid2planeTransformation () const |
Returns the transformation that transform points defined in a coordinate system of the virtual grid into points defined in the plane coordinate system. More... | |
HomogenousMatrix4 | virtualPlane2worldTransformation () const |
Returns a transformation that transforms points defined in a coordinate system of the virtual plane into points defined in the world coordinate system. More... | |
HomogenousMatrix4 | grid2worldTransformation () const |
Returns the transformation that transform points defined in a coordinate system of the grid into points defined in the world coordinate system. More... | |
HomogenousMatrix4 | virtualGrid2worldTransformation () const |
Returns the transformation that transform points defined in a coordinate system of the virtual grid into points defined in the world coordinate system. More... | |
const Vector2 & | lowerGridCorner () const |
Returns the lower grid corner defined in the grid coordinate system of the visualization bounding box of the grid. More... | |
const Vector2 & | upperGridCorner () const |
Returns the upper grid corner defined in the grid coordinate system of the visualization bounding box of the grid. More... | |
void | setPlane2worldTransformation (const HomogenousMatrix4 &newTransformation) |
Sets the transformation that transforms points defined in a coordinate system of the plane into points defined in the world coordinate system. More... | |
void | setGrid2planeTransformation (const HomogenousMatrix4 &newTransformation) |
Sets the transformation that transforms points defined in a coordinate system of the grid into points defined in the plane coordinate system. More... | |
bool | setVirtualGrid2planeTransformation (const HomogenousMatrix4 &newTransformation) |
Sets the transformation that transform points defined in a coordinate system of the virtual grid into points defined in the plane coordinate system. More... | |
void | setLowerGridCorner (const Vector2 &newCorner) |
Sets the lower grid corner defined in the plane coordinate system of the visualization bounding box of the grid. More... | |
void | setUpperGridCorner (const Vector2 &newCorner) |
Sets the upper grid corner defined in the plane coordinate system of the visualization bounding box of the grid. More... | |
bool | isValid () const |
Returns whether the grid is valid. More... | |
void | setInvalid () |
Sets the grid to invalid. More... | |
bool | areVirtualAndPhysicalGridIdentical () const |
Returns whether the physical and virtual grid transformations are identical. More... | |
void | clipByImageBoundingBox (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const Scalar borderSizeFactor=Scalar(2.0), const Vectors2 &insideGridCoordinates=Vectors2()) |
Clips the grid bounding box and adjusts the lower and upper grid corner by an image bounding box. More... | |
bool | image2world (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const Vector2 &imageCoordinate, Vector3 &worldCoordinate) const |
Convert an point defined in a coordinate system of the camera image into an point on the plane defined in the world coordinate system. More... | |
bool | image2plane (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const Vector2 &imageCoordinate, Vector3 &planeCoordinate) const |
Convert an point defined in a coordinate system of the camera image into an point on the plane defined in the plane coordinate system. More... | |
template<bool tVirtual> | |
bool | image2grid (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const Vector2 &imageCoordinate, Vector2 &gridCoordinate) const |
Convert an point defined in a coordinate system of the camera image into an point on the plane defined in the grid coordinate system. More... | |
Vector2 | world2image (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const Vector3 &worldCoordinate) const |
Convert an point on the plane defined in a coordinate system of the world into an point defined in the camera image coordinate system. More... | |
Vector2 | world2imageIF (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &poseIF, const Vector3 &worldCoordinate) const |
Convert an point on the plane defined in a coordinate system of the world into an point defined in the camera image coordinate system. More... | |
Vector3 | world2plane (const Vector3 &worldCoordinate) const |
Convert an point on the plane defined in a coordinate system of the world into an point defined in the plane coordinate system. More... | |
template<bool tVirtual> | |
Vector2 | world2grid (const Vector3 &worldCoordinate) const |
Convert an point on the plane defined in a coordinate system of the world into an point defined in the grid coordinate system. More... | |
Vector2 | plane2image (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const Vector3 &planeCoordinate) const |
Convert an point on the plane defined in a coordinate system of the plane into an point defined in the camera image coordinate system. More... | |
Vector2 | plane2imageIF (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &poseIF, const Vector3 &planeCoordinate) const |
Convert an point on the plane defined in a coordinate system of the plane into an point defined in the camera image coordinate system. More... | |
Vector3 | plane2world (const Vector3 &planeCoordinate) const |
Convert an point on the plane defined in a coordinate system of the plane into an point defined in the world coordinate system. More... | |
template<bool tVirtual> | |
Vector2 | plane2grid (const Vector3 &planeCoordinate) const |
Convert an point on the plane defined in a coordinate system of the plane into an point defined in the grid coordinate system. More... | |
template<bool tVirtual> | |
Vector2 | grid2image (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const Vector2 &gridCoordinate) const |
Convert an point on the plane defined in a coordinate system of the grid into an point defined in the camera image coordinate system. More... | |
template<bool tVirtual> | |
Vector2 | grid2imageIF (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &poseIF, const Vector2 &gridCoordinate) const |
Convert an point on the plane defined in a coordinate system of the grid into an point defined in the camera image coordinate system. More... | |
template<bool tVirtual> | |
Vector3 | grid2world (const Vector2 &gridCoordinate) const |
Convert an point on the plane defined in a coordinate system of the grid into an point defined in the world coordinate system. More... | |
template<bool tVirtual> | |
Vector3 | grid2plane (const Vector2 &gridCoordinate) const |
Convert an point on the plane defined in a coordinate system of the grid into an point defined in the plane coordinate system. More... | |
bool | operator== (const Grid &grid) const |
Returns whether two grids are identical. More... | |
bool | operator!= (const Grid &grid) const |
Returns whether two grids are not identical. More... | |
Static Public Member Functions | |
static bool | determineVirtualGridTransformationsByFourImagePoints (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const Vector2 *imagePoints, const Vector2 *gridCoordinates=nullptr, const HomogenousMatrix4 *previousPlane2worldTransformation=nullptr, HomogenousMatrix4 *plane2worldTransformation=nullptr, HomogenousMatrix4 *virtualGrid2planeTransformation=nullptr) |
Determine the transformation that transforms points defined in a coordinate system of the plane into points defined in the world coordinate system. More... | |
static bool | determineVirtualGridTransformationByPlane2WorldTransformation (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const Vectors2 &imagePoints, const HomogenousMatrix4 &previousPlane2worldTransformation, HomogenousMatrix4 &plane2worldTransformation, HomogenousMatrix4 &virtualGrid2planeTransformation) |
Determines a virtualGrid2plane transformation by a plane2world transformation and four given image points. More... | |
static Vector2 | grid2nearestNode (const Vector2 &gridCoordinate) |
Determine the nearest integer grid node from a given grid coordinate. More... | |
static bool | hasTransformationShearComponent (const HomogenousMatrix4 &transformation) |
Returns whether a given transformation has shear component in x/y direction. More... | |
static bool | determineTransformationWithoutShearComponent (const HomogenousMatrix4 &transformationWithShearComponent, HomogenousMatrix4 &resultTransformation) |
Determines a transformation without a shear component from a given transformation with shear component. More... | |
static bool | isInFrontOfCamera (const HomogenousMatrix4 &pose, const Vector3 &worldCoordinate) |
Returns whether a given world coordinate is in front of the camera. More... | |
static bool | isInFrontOfCameraIF (const HomogenousMatrix4 &poseIF, const Vector3 &worldCoordinate) |
Returns whether a given world coordinate is in front of the camera. More... | |
Protected Member Functions | |
void | adjustGridCornersInXDirectionByImageLines (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const FiniteLine2 &gridBoundingBoxEdgeImageCoordinate, const FiniteLine2 &imageBoundingBoxEdgeImageCoordinate) |
Adjust the lower and upper grid corner in x direction by a given finite image line that is a projected grid edge in x direction and a finite image line of an image bounding box edge that clips the grid. More... | |
void | adjustGridCornersInYDirectionByImageLines (const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &pose, const FiniteLine2 &gridBoundingBoxEdgeImageCoordinate, const FiniteLine2 &imageBoundingBoxEdgeImageCoordinate) |
Adjust the lower and upper grid corner in y direction by a given finite image line that is a projected grid edge in y direction and a finite image line of an image bounding box edge that clips the grid. More... | |
Static Protected Member Functions | |
static bool | clipWorldLineInFrontOfCameraBinarySearchIF (const HomogenousMatrix4 &poseIF, const FiniteLine3 &lineToClip, FiniteLine3 &resultingLine) |
Clips a finite line in world coordinates, that the start and end point lie in front of the camera. More... | |
Protected Attributes | |
HomogenousMatrix4 | worldTplane |
Transformation that transforms points defined in a coordinate system of the plane into points defined in the world coordinate system. More... | |
HomogenousMatrix4 | planeTgrid |
Transformation that transforms points defined in a coordinate system of the grid into points defined in the plane coordinate system. More... | |
HomogenousMatrix4 | planeTvirtualGrid |
Transformation that transform points defined in a coordinate system of the virtual grid into points defined in the plane coordinate system. More... | |
Vector2 | gridLowerCorner |
Lower grid corner of the visualization bounding box of the grid defined in the grid coordinate system. More... | |
Vector2 | gridUpperCorner |
Upper grid corner of the visualization bounding box of the grid defined in the grid coordinate system . More... | |
This class implements the basic data of an planar grid.
There are 3 coordinate systems: (1) world coordinates:
y ^ | o - o - o - o - o | | | | | | | o - o - o - p - o | | | | | | | o - o - c - o - o | | | | | | | o - o - o - o - o | | | | | | | o - o - o - o - o | z---------------------> x
This class holds 3 transformations: (1) plane2world transformation:
The grid holds an visualization bounding box defined in plane coordinates.
This class implements convert functions to convert point from one coordinate system to an other.
|
inline |
Creates a new invalid grid element.
|
inlineexplicit |
Creates a new Grid by a plane2world transformation.
Whether the virtualGrid2plane transformation is set, the grid2plane transformation is set to the same matrix. If the grid2plane transformation should be set, the virtualGrid2plane transformation can be set to the appropriate matrix.
plane2worldTransformation | Transformation that transforms points defined in a coordinate system of the plane into points defined in the world coordinate system |
virtualGrid2planeTransformation | Optional transformation that transforms points defined in a coordinate system of the virtual grid into points defined in the plane coordinate system |
lowerCorner | Optional lower corner of the grid bounding box for visualization in plane coordinates |
upperCorner | Optional upper corner of the grid bounding box for visualization in plane coordinates |
Ocean::Geometry::Grid::Grid | ( | const PinholeCamera & | pinholeCamera, |
const HomogenousMatrix4 & | pose, | ||
const Vectors2 & | imagePoints, | ||
const HomogenousMatrix4 & | plane2worldTransformation, | ||
const HomogenousMatrix4 & | virtualGrid2planeTransformation = HomogenousMatrix4(true) , |
||
const bool | clipBoundingBox = false |
||
) |
Creates a new Grid by a plane2world transformation and four image points defining a rectangle.
The bounding box is adjusted, so the rectangle plus a border lies inside. The border has a size of the half average length of two neighboring projected plane points. If the virtualGrid2plane transformation is set, the grid2plane transformation is set to the same matrix. If the grid2plane transformation should be set, the virtualGrid2plane transformation can be set to the appropriate matrix.
pinholeCamera | The pinhole camera profile to be applied |
pose | The pose to be applied |
imagePoints | The image points to adjust the bounding box, size must be four |
plane2worldTransformation | Transformation that transforms points defined in a coordinate system of the plane into points defined in the world coordinate system |
virtualGrid2planeTransformation | Optional transformation that transforms points defined in a coordinate system of the virtual grid into points defined in the plane coordinate system |
clipBoundingBox | Optional flag to clip the grid lower and upper grid corners by an image bounding box around the camera frame |
Ocean::Geometry::Grid::Grid | ( | const PinholeCamera & | pinholeCamera, |
const HomogenousMatrix4 & | pose, | ||
const Vectors2 & | imagePoints, | ||
const Vector2 * | gridCoordinates = nullptr , |
||
const HomogenousMatrix4 * | previousPlane2worldTransformation = nullptr , |
||
const bool | clipBoundingBox = false |
||
) |
Creates a new Grid by four given image points using vanishing projection.
The four image points must define a convex polygon. If additionally four grid coordinates are given, the virtualGrid2plane transformation is set, too. The four grid coordinates must be given in the same order (clockwise or counter clockwise) like the four image points! The grid coordinates are only used for determine the shear of the virtualGrid2plane transformation, the lower and upper grid corners are not adjust! If no grid could be determined from the four image points, a invalid grid is create.
pinholeCamera | The pinhole camera profile to be applied |
pose | The pose to be applied |
imagePoints | The four image points (must be in clockwise or counterclockwise order) |
gridCoordinates | Optional four grid coordinates (must be in clockwise or counterclockwise order) |
previousPlane2worldTransformation | Optional Transformation that transforms points defined in a coordinate system of the plane into points defined in the world coordinate system to adapt the plane translation |
clipBoundingBox | Optional flag to clip the grid lower and upper grid corners by an image bounding box around the camera frame |
Ocean::Geometry::Grid::Grid | ( | const PinholeCamera & | pinholeCamera, |
const HomogenousMatrix4 & | pose, | ||
const HomogenousMatrix4 & | plane2worldTransformation, | ||
const Vectors2 & | imagePoints, | ||
const bool | clipBoundingBox = false |
||
) |
Creates a new Grid by a given transformation that transforms points defined in a coordinate system of the plane into points defined in the world coordinate system.
The virtualGrid2plane transformation is adjusted by four given image points. The virtual grid is sheared that the four points define a rectangle on the virtual grid in the best case.
pinholeCamera | The pinhole camera profile to be applied |
pose | The pose to be applied |
plane2worldTransformation | Transformation that transforms points defined in a coordinate system of the plane into points defined in the world coordinate system |
imagePoints | The four image points (must be in clockwise or counterclockwise order) |
clipBoundingBox | Optional flag to clip the grid lower and upper grid corners by an image bounding box around the camera frame |
|
protected |
Adjust the lower and upper grid corner in x direction by a given finite image line that is a projected grid edge in x direction and a finite image line of an image bounding box edge that clips the grid.
Beware: The grid edge must be have a orientation of (1, 0) in grid coordinates
pinholeCamera | The pinhole camera profile to be applied |
pose | The pose to be applied |
gridBoundingBoxEdgeImageCoordinate | The finite image line of a grid edge in x direction |
imageBoundingBoxEdgeImageCoordinate | The finite image line of image bounding box edge that clips the grid |
|
protected |
Adjust the lower and upper grid corner in y direction by a given finite image line that is a projected grid edge in y direction and a finite image line of an image bounding box edge that clips the grid.
Beware: The grid edge must be have a orientation of (0, 1) in grid coordinates
pinholeCamera | The pinhole camera profile to be applied |
pose | The pose to be applied |
gridBoundingBoxEdgeImageCoordinate | The finite image line of a grid edge in y direction |
imageBoundingBoxEdgeImageCoordinate | The finite image line of image bounding box edge that clips the grid |
bool Ocean::Geometry::Grid::areVirtualAndPhysicalGridIdentical | ( | ) | const |
Returns whether the physical and virtual grid transformations are identical.
void Ocean::Geometry::Grid::clipByImageBoundingBox | ( | const PinholeCamera & | pinholeCamera, |
const HomogenousMatrix4 & | pose, | ||
const Scalar | borderSizeFactor = Scalar(2.0) , |
||
const Vectors2 & | insideGridCoordinates = Vectors2() |
||
) |
Clips the grid bounding box and adjusts the lower and upper grid corner by an image bounding box.
This bounding box is defined by a given camera, a pose and a border size factor. The image bounding box will have the following bounds: Left: -width * factor Right width + width * factor Top: -height * factor Bottom: height + height * factor
pinholeCamera | The pinhole camera profile to be applied |
pose | The pose to be applied |
borderSizeFactor | the factor for the width and height for the border around the camera frame, Range [0, infinity) |
insideGridCoordinates | Optional grid coordinates that must lie inside the new clipped grid |
|
staticprotected |
Clips a finite line in world coordinates, that the start and end point lie in front of the camera.
A binary search is determine the possible start and end point who are in front of the camera. If both points lie behind the camera, the line is not adjusted.
poseIF | Inverted flipped pose to be applied |
lineToClip | The finite line to clip |
resultingLine | The resulting clipped line if succeeded |
|
static |
Determines a transformation without a shear component from a given transformation with shear component.
The x and y axes of the given transformation with shear component must be orthogonal to the z axis. The resulting transformation has the same z axis and translation like the given transformation.
transformationWithShearComponent | Transformation with shear component |
resultTransformation | Resulting transformation without a shear component |
|
static |
Determines a virtualGrid2plane transformation by a plane2world transformation and four given image points.
Furthermore an adjusted plane2world transformation is determined which is the previous plane2world transformation rotated around the plane normal that the bisection of the x and y axis of the virtual and non virtual grid transformation have the same orientation.
pinholeCamera | The pinhole camera profile to be applied |
pose | The pose to be applied |
imagePoints | The four image points to determine the transformations (must be in clockwise or counterclockwise order) |
previousPlane2worldTransformation | Previous plane2world transformation |
plane2worldTransformation | The new plane2world transformation that is a rotation of the previous plane2world transformation around the plane normal |
virtualGrid2planeTransformation | The determined virtualGrid2plane transformation |
|
static |
Determine the transformation that transforms points defined in a coordinate system of the plane into points defined in the world coordinate system.
If additionally four grid coordinates are given, the transformation that transforms points defined in a coordinate system of the grid/virtual grid into points defined in the plane coordinate system by four given image points are determined, too. The four grid coordinates must be given in the same order (clockwise or counter clockwise) like the four image points! If no grid coordinates are given, the resulting virtualGrid2plane transformation equals to the grid2plane transformation. If a previous plane2world transformation is given, the new one will be oriented at the same translation, otherwise the origin of the new plane2world transformation will be set to a distance of 1 from the camera.
pinholeCamera | The pinhole camera profile to be applied |
pose | The pose to be applied |
imagePoints | The four image points to determine the transformations (must be in clockwise or counterclockwise order) |
gridCoordinates | Optional four grid coordinates (must be in clockwise or counterclockwise order) |
previousPlane2worldTransformation | Optional previous plane2world transformation |
plane2worldTransformation | Optional resulting plane2world transformation |
virtualGrid2planeTransformation | Optional resulting virtualGrid2plane transformation |
|
inline |
Convert an point on the plane defined in a coordinate system of the grid into an point defined in the camera image coordinate system.
The grid must be valid!
pinholeCamera | The pinhole camera profile to be applied |
pose | The pose to be applied |
gridCoordinate | Grid coordinate which will be converted |
tVirtual | Indicate whether the virtual grid is used |
|
inline |
Convert an point on the plane defined in a coordinate system of the grid into an point defined in the camera image coordinate system.
The grid must be valid!
pinholeCamera | The pinhole camera profile to be applied |
poseIF | Inverted flipped pose to be applied |
gridCoordinate | Grid coordinate which will be converted |
tVirtual | Indicate whether the virtual grid is used |
Determine the nearest integer grid node from a given grid coordinate.
An x or y value from >= 2.5 to < 3.5 is rounded to 3.0.
gridCoordinate | Grid coordinate to get the nearest node from |
|
inline |
Convert an point on the plane defined in a coordinate system of the grid into an point defined in the plane coordinate system.
The grid must be valid!
gridCoordinate | Grid coordinate which will be converted |
tVirtual | Indicate whether the virtual grid is used |
|
inline |
Returns the transformation that transforms points defined in a coordinate system of the grid into points defined in the plane coordinate system.
|
inline |
Convert an point on the plane defined in a coordinate system of the grid into an point defined in the world coordinate system.
The grid must be valid!
gridCoordinate | Grid coordinate which will be converted |
tVirtual | Indicate whether the virtual grid is used |
|
inline |
Returns the transformation that transform points defined in a coordinate system of the grid into points defined in the world coordinate system.
|
inlinestatic |
Returns whether a given transformation has shear component in x/y direction.
The x and y axes of the given transformation must be orthogonal to the z axis.
transformation | The transformation to check |
bool Ocean::Geometry::Grid::image2grid | ( | const PinholeCamera & | pinholeCamera, |
const HomogenousMatrix4 & | pose, | ||
const Vector2 & | imageCoordinate, | ||
Vector2 & | gridCoordinate | ||
) | const |
Convert an point defined in a coordinate system of the camera image into an point on the plane defined in the grid coordinate system.
The grid must be valid!
pinholeCamera | The pinhole camera profile to be applied |
pose | The pose to be applied |
imageCoordinate | Image coordinate which will be converted |
gridCoordinate | resulting grid coordinate, if the conversion was successful |
tVirtual | Indicate whether the virtual grid is used |
bool Ocean::Geometry::Grid::image2plane | ( | const PinholeCamera & | pinholeCamera, |
const HomogenousMatrix4 & | pose, | ||
const Vector2 & | imageCoordinate, | ||
Vector3 & | planeCoordinate | ||
) | const |
Convert an point defined in a coordinate system of the camera image into an point on the plane defined in the plane coordinate system.
The grid must be valid!
pinholeCamera | The pinhole camera profile to be applied |
pose | The pose to be applied |
imageCoordinate | Image coordinate which will be converted |
planeCoordinate | resulting plane coordinate, if the conversion was successful |
bool Ocean::Geometry::Grid::image2world | ( | const PinholeCamera & | pinholeCamera, |
const HomogenousMatrix4 & | pose, | ||
const Vector2 & | imageCoordinate, | ||
Vector3 & | worldCoordinate | ||
) | const |
Convert an point defined in a coordinate system of the camera image into an point on the plane defined in the world coordinate system.
The grid must be valid!
pinholeCamera | The pinhole camera profile to be applied |
pose | The pose to be applied |
imageCoordinate | Image coordinate which will be converted |
worldCoordinate | resulting world coordinate, if the conversion was successful |
|
inlinestatic |
Returns whether a given world coordinate is in front of the camera.
pose | Current camera pose |
worldCoordinate | World coordinate to be checked |
|
inlinestatic |
Returns whether a given world coordinate is in front of the camera.
poseIF | Current inverted flipped camera pose |
worldCoordinate | World coordinate to be checked |
bool Ocean::Geometry::Grid::isValid | ( | ) | const |
Returns whether the grid is valid.
The grid is valid, whether the lower grid corner is smaller than the upper grid corner, the 3 transformation are valid matrices and: the x, y and z axis of the plane2world and grid2plane transformation are orthogonal to each other and the x and y axis of the virtualGrid2plane transformation are orthogonal to the z axis.
|
inline |
Returns the lower grid corner defined in the grid coordinate system of the visualization bounding box of the grid.
|
inline |
Returns whether two grids are not identical.
grid | Right grid |
|
inline |
Returns whether two grids are identical.
grid | Right grid |
|
inline |
Convert an point on the plane defined in a coordinate system of the plane into an point defined in the grid coordinate system.
The grid must be valid!
planeCoordinate | Plane coordinate which will be converted |
tVirtual | Indicate whether the virtual grid is used |
|
inline |
Convert an point on the plane defined in a coordinate system of the plane into an point defined in the camera image coordinate system.
The grid must be valid!
pinholeCamera | The pinhole camera profile to be applied |
pose | The pose to be applied |
planeCoordinate | Plane coordinate which will be converted |
|
inline |
Convert an point on the plane defined in a coordinate system of the plane into an point defined in the camera image coordinate system.
The grid must be valid!
pinholeCamera | The pinhole camera profile to be applied |
poseIF | inverted flipped pose to be applied |
planeCoordinate | Plane coordinate which will be converted |
Convert an point on the plane defined in a coordinate system of the plane into an point defined in the world coordinate system.
The grid must be valid!
planeCoordinate | Plane coordinate which will be converted |
|
inline |
Returns the transformation that transforms points defined in a coordinate system of the plane into points defined in the world coordinate system.
|
inline |
Sets the transformation that transforms points defined in a coordinate system of the grid into points defined in the plane coordinate system.
The transformation that transforms points defined in a coordinate system of the virtual grid into points defined in the plane coordinate system is also set to the same matrix.
newTransformation | New transformation to set |
void Ocean::Geometry::Grid::setInvalid | ( | ) |
Sets the grid to invalid.
All transformations will be set to invalid transformations. The upper grid corner will be set higher as the lower grid corner.
|
inline |
Sets the lower grid corner defined in the plane coordinate system of the visualization bounding box of the grid.
If the lower grid corner is set to a value higher than the upper corner, the grid will be invalid.
newCorner | New lower grid corner |
|
inline |
Sets the transformation that transforms points defined in a coordinate system of the plane into points defined in the world coordinate system.
newTransformation | New transformation to set |
|
inline |
Sets the upper grid corner defined in the plane coordinate system of the visualization bounding box of the grid.
If the upper grid corner is set to a value smaller than the lower corner, the grid will be invalid.
newCorner | New upper grid corner |
bool Ocean::Geometry::Grid::setVirtualGrid2planeTransformation | ( | const HomogenousMatrix4 & | newTransformation | ) |
Sets the transformation that transform points defined in a coordinate system of the virtual grid into points defined in the plane coordinate system.
The transformation that transforms points defined in a coordinate system of the grid into points defined in the plane coordinate system is also set: If the given matrix is not valid, the grid2plane transformation will also be invalid. If the given matrix is valid, the grid2plane transformation will be set without the shear of the virtual transformation and a scale which is an average of the x and y scale.
newTransformation | New transformation to set |
|
inline |
Returns the upper grid corner defined in the grid coordinate system of the visualization bounding box of the grid.
|
inline |
Returns the transformation that transform points defined in a coordinate system of the virtual grid into points defined in the plane coordinate system.
|
inline |
Returns the transformation that transform points defined in a coordinate system of the virtual grid into points defined in the world coordinate system.
HomogenousMatrix4 Ocean::Geometry::Grid::virtualPlane2worldTransformation | ( | ) | const |
Returns a transformation that transforms points defined in a coordinate system of the virtual plane into points defined in the world coordinate system.
The virtual plane has the orientation scale and depth of the normal plane while an optional shear component is extracted from the virtual grid if the virtual grid has a shear component.
|
inline |
Convert an point on the plane defined in a coordinate system of the world into an point defined in the grid coordinate system.
The grid must be valid!
worldCoordinate | World coordinate which will be converted |
tVirtual | Indicate whether the virtual grid is used |
|
inline |
Convert an point on the plane defined in a coordinate system of the world into an point defined in the camera image coordinate system.
The grid must be valid!
pinholeCamera | The pinhole camera profile to be applied |
pose | The pose to be applied |
worldCoordinate | World coordinate which will be converted |
|
inline |
Convert an point on the plane defined in a coordinate system of the world into an point defined in the camera image coordinate system.
The grid must be valid!
pinholeCamera | The pinhole camera profile to be applied |
poseIF | Inverted flipped pose to be applied |
worldCoordinate | World coordinate which will be converted |
Convert an point on the plane defined in a coordinate system of the world into an point defined in the plane coordinate system.
The grid must be valid!
worldCoordinate | World coordinate which will be converted |
|
protected |
Lower grid corner of the visualization bounding box of the grid defined in the grid coordinate system.
|
protected |
Upper grid corner of the visualization bounding box of the grid defined in the grid coordinate system .
|
protected |
Transformation that transforms points defined in a coordinate system of the grid into points defined in the plane coordinate system.
|
protected |
Transformation that transform points defined in a coordinate system of the virtual grid into points defined in the plane coordinate system.
|
protected |
Transformation that transforms points defined in a coordinate system of the plane into points defined in the world coordinate system.