Basic Image AlgorithmS Library
2.8.0
|
Create and represent a 3D triangle mesh. More...
#include <Utils/TriangleMesh.hh>
Public Member Functions | |
int | ChangeTexture (const BIAS::Image< unsigned char > &texture) |
Replace the texture of this mesh. More... | |
int | GenerateDenseMesh (const BIAS::Image< float > &DenseDepthMap, const BIAS::Image< unsigned char > &Texture) |
Calculate a triangle mesh from dense depth map without PMatrix. More... | |
int | GenerateDenseMesh (const BIAS::Image< float > &DenseDepthMap, BIAS::PMatrix &P, const BIAS::Image< unsigned char > &Texture) |
Calculate a triangle mesh from dense depth map. More... | |
int | GenerateDenseMesh (const BIAS::Image< float > &DenseDepthMap, BIAS::Projection &P, const BIAS::Image< unsigned char > &Texture, BIAS::Projection &TexP, bool reduce, double reduceValue) |
int | GenerateDenseMesh (const BIAS::Image< float > &DenseDepthMap, BIAS::PMatrix &P, const BIAS::Image< unsigned char > &Texture, const ROI &cutout) |
Calculate a triangle mesh only using the given cutout recalculates depthmap, image and p and calls generic interface. More... | |
int | GenerateDenseMesh (const BIAS::Image< float > &DenseDepthMap, BIAS::Projection &P, const BIAS::Image< unsigned char > &Texture, BIAS::Projection &TexP, const unsigned int distBetweenPoints=1) |
Calculate a triangle mesh from dense depth map. More... | |
int | GenerateDenseMesh (const BIAS::Image< float > &DenseDepthMap, BIAS::Projection &P, const BIAS::Image< unsigned char > &Texture, const unsigned int distBetweenPoints=1) |
old interface without a projection for the texture More... | |
int | GenerateDenseMesh (const BIAS::Image< float > &DenseDepthMap, BIAS::Projection &DepthP, const BIAS::Image< unsigned char > &Texture, BIAS::Projection &TexP, const unsigned int x0, const unsigned int y0, const unsigned int width, const unsigned int height, const unsigned int distBetweenPoints=1) |
calculates trianglemesh but only for given part of depth map (can be used for tile mode)! Generated texture coordinates reference are relative to the full depth map size! If distBetweenPoints > 1, the intermediate point are simply ignored, when combining point to triangles More... | |
int | GenerateDenseMesh (const BIAS::Image< float > &DenseDepthMap, BIAS::Projection &DepthP, const BIAS::Image< unsigned char > &Texture, const unsigned int x0, const unsigned int y0, const unsigned int width, const unsigned int height, const unsigned int distBetweenPoints=1) |
old interface without a projection for the texture More... | |
int | GenerateImagePlane (const BIAS::Projection &P, const BIAS::Image< unsigned char > &Texture, const double &w=1.0) |
backproject image onto a plane in space so far only implemented for perspective cameras More... | |
int | GenerateSimplifiedMesh (const Image< float > &DenseDepthMap, const Projection &P, const Image< unsigned char > &Texture, const unsigned int x0, const unsigned int y0, const unsigned int width, const unsigned int height, double minCosAngle=0.8, double maxDiagRatio=3.0) |
int | GenerateSimplifiedMesh (const Image< float > &DenseDepthMap, const Projection &P, const Image< unsigned char > &Texture, const Projection &TexP, const unsigned int x0, const unsigned int y0, const unsigned int width, const unsigned int height, double minCosAngle=0.8, double maxDiagRatio=3.0) |
void | GenerateTexturedCamera (const ProjectionParametersBase *PPB, Image< unsigned char > &rgbtexture, const double &scale=1.0, const double &opacity=1.0, const double &resolution=1.0) |
generates the sensor plane / cylinder / sphere in 3D space More... | |
int | GenerateTexturedQuad (const Image< unsigned char > &Texture, const Vector3< double > &UL, const Vector3< double > &UR, const Vector3< double > &LL, const Vector3< double > &LR, const Vector2< double > &ul, const Vector2< double > &ur, const Vector2< double > &ll, const Vector2< double > &lr, const Vector3< double > &normal=Vector3< double >(0, 0, 0)) |
Generate planar quad in 3D space with given texture coordinates. More... | |
int | GenerateTexturedQuad (PMatrix P, const Image< unsigned char > &Texture, const Vector3< double > &UL, const Vector3< double > &UR, const Vector3< double > &LL, const Vector3< double > &LR, const Vector3< double > &normal=Vector3< double >(0, 0, 0)) |
Generate planar quad in 3D space with texture projection using projection matrix P. More... | |
int | GenerateTexturedQuadStrip (const Image< unsigned char > &Texture, const std::vector< Vector3< double > > &X, const std::vector< Vector2< double > > &x) |
Generate a strip of planar quads in 3D space using the given texture coordinates. More... | |
int | GenerateTexturedQuadStrip (const Projection &P, const Image< unsigned char > &Texture, const std::vector< Vector3< double > > &X) |
Generate a strip of planar quads in 3D space. More... | |
void | GenerateVertexNormals (bool leftHanded=true, Vector3< double > normalForUnusedVertices=Vector3< double >(-1.0, 0.0, 0.0)) |
Computes the normals for the vertices by averaging the normals of adjacent triangles. More... | |
void | GetBiggestConnectedSegment (TriangleMesh &biggestSegment) const |
Returns the biggest connected segment of this triangle mesh. More... | |
void | GetBoundingBox (Vector3< double > &minPoint, Vector3< double > &maxPoint) const |
Returns the minimal and maximal point of the axis-aligned bounding box of this triangle mesh. More... | |
void | GetNormals (std::vector< BIAS::Vector3< double > > &normals) const |
const std::vector < BIAS::Vector3< double > > & | GetNormalsRef () const |
void | GetTexCoords (std::vector< BIAS::Vector2< float > > &texCoo) const |
const std::vector < BIAS::Vector2< float > > & | GetTexCoordsRef () const |
void | GetTexture (Image< unsigned char > &img) const |
const BIAS::Image< unsigned char > & | GetTextureRef () const |
void | GetTriangleIndices (std::vector< BIAS::Vector< int > > &triangleIndices) const |
const std::vector < BIAS::Vector< int > > & | GetTriangleIndicesRef () const |
void | GetVertexColors (std::vector< BIAS::Vector4< unsigned char > > &colors) const |
void | GetVertices (std::vector< BIAS::Vector3< double > > &vertices) const |
const std::vector < BIAS::Vector3< double > > & | GetVerticesRef () const |
void | SetMesh (BIAS::Image< unsigned char > texture, std::vector< BIAS::Vector3< double > > meshVertices, std::vector< BIAS::Vector3< double > > vertexNormals, std::vector< BIAS::Vector2< float > > textureCoords, std::vector< BIAS::Vector< int > > triangleIndices) |
void | SetMesh (std::vector< BIAS::Vector3< double > > meshVertices, std::vector< BIAS::Vector3< double > > vertexNormals, std::vector< BIAS::Vector2< float > > textureCoords, std::vector< BIAS::Vector< int > > triangleIndices, BIAS::Image< unsigned char > texture=Image< unsigned char >()) |
void | SetMesh (std::vector< BIAS::Vector3< double > > meshVertices, std::vector< BIAS::Vector3< double > > vertexNormals, std::vector< BIAS::Vector4< unsigned char > > vertexColors, std::vector< BIAS::Vector< int > > triangleIndices) |
void | SetParams (const double &minCornerAngle=M_PI *5.0/180.0, const double &maxAngle=M_PI *60.0/180.0, const double depthScale=1.0) |
TriangleMesh (const double &minCornerAngle=M_PI *5.0/180.0, const double &maxAngle=M_PI *60.0/180.0, const double depthScale=1.0) | |
Protected Member Functions | |
void | GetNeighbours_ (int v1, int v2, std::vector< int > &dead_triangles, std::vector< int > &moved_triangles, int &moved_pivot) |
get the neighbours of the contracted points and returns two list that contains the triangles to remove from the model and triangles that have to be moved to one of the vertices More... | |
bool | MakeTriangles_ (const Projection &P, const Projection &TexP, const BIAS::Image< unsigned char > &Texture, std::vector< Image< float > > &depthmaps, float x, float y, float offset, float minoffset, double minCosAngle, double maxDiagRatio, bool simulateOnly) |
bool | SimplifyMeshSurface_ (const BIAS::Image< unsigned char > &Texture, BIAS::Projection &TexP, double reduceValue) |
Simplifies a TriangleMesh to a desired percentage of triangles of the original mesh. More... | |
void | TestContraction (int v1, int v2, int edge, bool init=false) |
Tests if a triangle that is involved in the contraction changes direction or overlapps. More... | |
double | ThreePointsToPlane_ (Vector3< double > v1, Vector3< double > v2, Vector3< double > v3, Vector4< double > &erg) |
calculates a plan of three points and returns it area More... | |
Protected Attributes | |
int | currentIndex_ |
double | depthScale_ |
apply this scale to depth values. More... | |
double | maxAngle_ |
maximum angle between triangle normal and viewing ray More... | |
std::vector< BIAS::Vector3 < double > > | meshVertices_ |
double | minCornerAngle_ |
minimum angle of any corner to accept a triangle More... | |
std::vector< std::set< int > > | neighboursOfVertex_ |
a set with all neighbours of a vertex v More... | |
std::multiset< BIAS::Edge, BIAS::Edge > | sorted |
BIAS::Image< unsigned char > | texture_ |
std::vector< BIAS::Vector2 < float > > | textureCoords_ |
std::vector< BIAS::Vector< int > > | triangleIndices_ |
std::vector< BIAS::Edge > | validPairs_ |
std::vector< BIAS::Vector4 < unsigned char > > | vertexColors_ |
std::vector< std::set< int > > | vertexIsInThisPairs_ |
a set with pairs that contain the vertex v More... | |
std::vector< std::set< int > > | vertexIsInTriangles_ |
a set with triangles that contain the vertex v More... | |
std::vector< BIAS::Vector3 < double > > | vertexNormals_ |
Create and represent a 3D triangle mesh.
The parameter minCornerAngle defines a lower bound on the allowed angle in each triangle. If a triangle contains an angle smaller than this threshold, it is dropped. The parameter maxAngle defines an upper bound on the angle between the viewing ray and the normal of the triangle. If the angle if bigger than the threshold, it is dropped. The parameter depthScale can be used to scale the model prior to triangle generation.
Definition at line 84 of file TriangleMesh.hh.
TriangleMesh::TriangleMesh | ( | const double & | minCornerAngle = M_PI * 5.0 / 180.0 , |
const double & | maxAngle = M_PI * 60.0 / 180.0 , |
||
const double | depthScale = 1.0 |
||
) |
Definition at line 46 of file TriangleMesh.cpp.
int TriangleMesh::ChangeTexture | ( | const BIAS::Image< unsigned char > & | texture | ) |
Replace the texture of this mesh.
Definition at line 51 of file TriangleMesh.cpp.
References BIAS::ImageBase::SamePixelAndChannelCount().
int TriangleMesh::GenerateDenseMesh | ( | const BIAS::Image< float > & | DenseDepthMap, |
const BIAS::Image< unsigned char > & | Texture | ||
) |
Calculate a triangle mesh from dense depth map without PMatrix.
That's a 3D representation of an Image. All entries in depth map are simply combined to little triangles, if neighboring pixels are set.
Definition at line 140 of file TriangleMesh.cpp.
References BIAS::HomgPoint3D::GetEuclidean(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), BIAS::HomgPoint3D, BIAS::Vector3< T >::Set(), and BIAS::Vector2< T >::Set().
Referenced by BIAS::CylindricDepthTrackingPanorama::GetTriangleMesh(), BIAS::SphericalDepthPanorama::GetTriangleMesh(), and BIAS::CylindricDepthPanorama::GetTriangleMesh().
int TriangleMesh::GenerateDenseMesh | ( | const BIAS::Image< float > & | DenseDepthMap, |
BIAS::PMatrix & | P, | ||
const BIAS::Image< unsigned char > & | Texture | ||
) |
Calculate a triangle mesh from dense depth map.
No triangles are discarded, hence no smoothing.
Definition at line 266 of file TriangleMesh.cpp.
References BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), BIAS::ProjectionParametersBase::SetImageSize(), and BIAS::ProjectionParametersPerspective::SetP().
int TriangleMesh::GenerateDenseMesh | ( | const BIAS::Image< float > & | DenseDepthMap, |
BIAS::Projection & | P, | ||
const BIAS::Image< unsigned char > & | Texture, | ||
BIAS::Projection & | TexP, | ||
bool | reduce, | ||
double | reduceValue | ||
) |
Definition at line 250 of file TriangleMesh.cpp.
References SimplifyMeshSurface_().
int TriangleMesh::GenerateDenseMesh | ( | const BIAS::Image< float > & | DenseDepthMap, |
BIAS::PMatrix & | P, | ||
const BIAS::Image< unsigned char > & | Texture, | ||
const ROI & | cutout | ||
) |
Calculate a triangle mesh only using the given cutout recalculates depthmap, image and p and calls generic interface.
Definition at line 457 of file TriangleMesh.cpp.
References BIAS::PMatrix::Compose(), BIAS::PMatrix::GetC(), BIAS::ImageBase::GetCopyOfROI(), BIAS::ROI::GetCorners(), BIAS::PMatrix::GetK(), BIAS::PMatrix::GetR(), BIAS::ImageBase::GetROI(), BIAS::PMatrix::InvalidateDecomposition(), BIAS::PMatrix::IsMetric(), BIAS::MatrixIdentity, and BIAS::ImageBase::SetROICorners().
int TriangleMesh::GenerateDenseMesh | ( | const BIAS::Image< float > & | DenseDepthMap, |
BIAS::Projection & | P, | ||
const BIAS::Image< unsigned char > & | Texture, | ||
BIAS::Projection & | TexP, | ||
const unsigned int | distBetweenPoints = 1 |
||
) |
Calculate a triangle mesh from dense depth map.
No triangles are discarded, hence no smoothing.
Definition at line 276 of file TriangleMesh.cpp.
References BIAS::ImageBase::GetHeight(), and BIAS::ImageBase::GetWidth().
|
inline |
old interface without a projection for the texture
Definition at line 180 of file TriangleMesh.hh.
References BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), and BIAS::ImageBase::IsEmpty().
int TriangleMesh::GenerateDenseMesh | ( | const BIAS::Image< float > & | DenseDepthMap, |
BIAS::Projection & | DepthP, | ||
const BIAS::Image< unsigned char > & | Texture, | ||
BIAS::Projection & | TexP, | ||
const unsigned int | x0, | ||
const unsigned int | y0, | ||
const unsigned int | width, | ||
const unsigned int | height, | ||
const unsigned int | distBetweenPoints = 1 |
||
) |
calculates trianglemesh but only for given part of depth map (can be used for tile mode)! Generated texture coordinates reference are relative to the full depth map size! If distBetweenPoints > 1, the intermediate point are simply ignored, when combining point to triangles
Definition at line 294 of file TriangleMesh.cpp.
References BIAS::Projection::DoesPointProjectIntoImage(), BIAS::Projection::GetC(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), BIAS::HomgPoint2D, BIAS::Vector3< T >::NormL2(), BIAS::Vector3< T >::Set(), BIAS::Vector2< T >::Set(), and BIAS::Projection::UnProjectToPoint().
|
inline |
old interface without a projection for the texture
Definition at line 212 of file TriangleMesh.hh.
References BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), and BIAS::ImageBase::IsEmpty().
int TriangleMesh::GenerateImagePlane | ( | const BIAS::Projection & | P, |
const BIAS::Image< unsigned char > & | Texture, | ||
const double & | w = 1.0 |
||
) |
backproject image onto a plane in space so far only implemented for perspective cameras
Definition at line 509 of file TriangleMesh.cpp.
References BIAS::HomgPoint3D::GetEuclidean(), BIAS::ImageBase::GetHeight(), BIAS::Projection::GetParameters(), BIAS::ImageBase::GetWidth(), BIAS::HomgPoint2D, BIAS::Vector3< T >::Set(), and BIAS::ProjectionParametersBase::UnProjectToImagePlane().
|
inline |
Definition at line 301 of file TriangleMesh.hh.
References BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), and BIAS::ImageBase::IsEmpty().
int TriangleMesh::GenerateSimplifiedMesh | ( | const Image< float > & | DenseDepthMap, |
const Projection & | P, | ||
const Image< unsigned char > & | Texture, | ||
const Projection & | TexP, | ||
const unsigned int | x0, | ||
const unsigned int | y0, | ||
const unsigned int | width, | ||
const unsigned int | height, | ||
double | minCosAngle = 0.8 , |
||
double | maxDiagRatio = 3.0 |
||
) |
Definition at line 900 of file TriangleMesh.cpp.
References BIAS::Gauss< InputStorageType, OutputStorageType >::Filter7x7GreyIgnoreBelowThreshold(), BIAS::Projection::GetC(), BIAS::ImageBase::GetHeight(), BIAS::ProjectionParametersBase::GetImageSize(), BIAS::Projection::GetParameters(), BIAS::ImageBase::GetWidth(), and BIAS::Gauss< InputStorageType, OutputStorageType >::SetSigma().
void TriangleMesh::GenerateTexturedCamera | ( | const ProjectionParametersBase * | PPB, |
Image< unsigned char > & | rgbtexture, | ||
const double & | scale = 1.0 , |
||
const double & | opacity = 1.0 , |
||
const double & | resolution = 1.0 |
||
) |
generates the sensor plane / cylinder / sphere in 3D space
texture | orignal image, must be rgb !!! |
Definition at line 553 of file TriangleMesh.cpp.
References BIAS::ProjectionParametersBase::Clone(), BIAS::ImageBase::CM_RGBA, BIAS::ProjectionParametersBase::GetC(), BIAS::ImageBase::GetChannelCount(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ProjectionParametersBase::GetImageSize(), BIAS::HomgPoint3D, BIAS::Vector4< T >::NormL2(), BIAS::ProjectionParametersBase::Rescale(), BIAS::ImageBase::SetColorModel(), BIAS::ImageBase::SetZero(), and BIAS::ProjectionParametersBase::UnProjectToImagePlane().
Referenced by BIAS::ImageBlender::BlendImages(), and BIAS::ImageBlenderIncremental::BlendImages().
int TriangleMesh::GenerateTexturedQuad | ( | const Image< unsigned char > & | Texture, |
const Vector3< double > & | UL, | ||
const Vector3< double > & | UR, | ||
const Vector3< double > & | LL, | ||
const Vector3< double > & | LR, | ||
const Vector2< double > & | ul, | ||
const Vector2< double > & | ur, | ||
const Vector2< double > & | ll, | ||
const Vector2< double > & | lr, | ||
const Vector3< double > & | normal = Vector3<double>(0,0,0) |
||
) |
Generate planar quad in 3D space with given texture coordinates.
The quad will be represented by two triangles.
Definition at line 1049 of file TriangleMesh.cpp.
References BIAS::Equal(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), and BIAS::Vector3< T >::NormL2().
int TriangleMesh::GenerateTexturedQuad | ( | PMatrix | P, |
const Image< unsigned char > & | Texture, | ||
const Vector3< double > & | UL, | ||
const Vector3< double > & | UR, | ||
const Vector3< double > & | LL, | ||
const Vector3< double > & | LR, | ||
const Vector3< double > & | normal = Vector3<double>(0,0,0) |
||
) |
Generate planar quad in 3D space with texture projection using projection matrix P.
Will be represented by two triangles.
Definition at line 1100 of file TriangleMesh.cpp.
References BIAS::HomgPoint2D::GetEuclidean(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), BIAS::HomgPoint3D, BIAS::HomgPoint2D::Homogenize(), BIAS::Matrix< T >::NormFrobenius(), and BIAS::HomgPoint2D::Set().
int TriangleMesh::GenerateTexturedQuadStrip | ( | const Image< unsigned char > & | Texture, |
const std::vector< Vector3< double > > & | X, | ||
const std::vector< Vector2< double > > & | x | ||
) |
Generate a strip of planar quads in 3D space using the given texture coordinates.
Each quad will be represented by two triangles.
Definition at line 1136 of file TriangleMesh.cpp.
References BIAS::ImageBase::GetHeight(), and BIAS::ImageBase::GetWidth().
int TriangleMesh::GenerateTexturedQuadStrip | ( | const Projection & | P, |
const Image< unsigned char > & | Texture, | ||
const std::vector< Vector3< double > > & | X | ||
) |
Generate a strip of planar quads in 3D space.
Projection of the texture onto the quad is done by the given projection matrix P. Each quad will be represented by two triangles.
Definition at line 1187 of file TriangleMesh.cpp.
References BIAS::Equal(), BIAS::HomgPoint2D::GetEuclidean(), BIAS::HomgPoint3D, BIAS::HomgPoint2D::Homogenize(), and BIAS::Projection::Project().
void TriangleMesh::GenerateVertexNormals | ( | bool | leftHanded = true , |
Vector3< double > | normalForUnusedVertices = Vector3<double>(-1.0, 0.0, 0.0) |
||
) |
Computes the normals for the vertices by averaging the normals of adjacent triangles.
leftHanded | determines direction of normals. true = compute in left-handed fashion, false = compute in right-handed fashion |
normalForUnusedVertices | normal to assign to vertices that do not occur in any triangle |
Definition at line 2026 of file TriangleMesh.cpp.
References BIAS::Vector3< T >::CrossProduct(), BIAS::Vector3< T >::Normalize(), and BIAS::Vector3< T >::NormL2().
void TriangleMesh::GetBiggestConnectedSegment | ( | TriangleMesh & | biggestSegment | ) | const |
Returns the biggest connected segment of this triangle mesh.
[out] | biggestSegment | the biggest subsegment of this triangle mesh |
Definition at line 1852 of file TriangleMesh.cpp.
References SetMesh(), and TNT::Vector< T >::size().
void TriangleMesh::GetBoundingBox | ( | Vector3< double > & | minPoint, |
Vector3< double > & | maxPoint | ||
) | const |
Returns the minimal and maximal point of the axis-aligned bounding box of this triangle mesh.
[out] | minPoint | point with minimal values in each dimension |
[out] | maxPoint | point with maximal values in each dimension |
Definition at line 1994 of file TriangleMesh.cpp.
References BIAS::Vector3< T >::Set().
|
protected |
get the neighbours of the contracted points and returns two list that contains the triangles to remove from the model and triangles that have to be moved to one of the vertices
Definition at line 1728 of file TriangleMesh.cpp.
|
inline |
Definition at line 289 of file TriangleMesh.hh.
Referenced by BIAS::ThreeDOut::AddTriangleMesh().
|
inline |
Definition at line 295 of file TriangleMesh.hh.
|
inline |
Definition at line 266 of file TriangleMesh.hh.
Referenced by BIAS::ThreeDOut::AddTriangleMesh().
|
inline |
Definition at line 276 of file TriangleMesh.hh.
Referenced by BIAS::OpenSceneGraphHelper::CreateBranchIndexedFaceSets().
|
inline |
Definition at line 247 of file TriangleMesh.hh.
Referenced by BIAS::ThreeDOut::AddTriangleMesh().
|
inline |
Definition at line 252 of file TriangleMesh.hh.
Referenced by BIAS::OpenSceneGraphHelper::CreateBranchIndexedFaceSets().
|
inline |
Definition at line 280 of file TriangleMesh.hh.
Referenced by BIAS::ThreeDOut::AddTriangleMesh().
|
inline |
Definition at line 285 of file TriangleMesh.hh.
Referenced by BIAS::OpenSceneGraphHelper::CreateBranchIndexedFaceSets().
|
inline |
Definition at line 271 of file TriangleMesh.hh.
Referenced by BIAS::ThreeDOut::AddTriangleMesh().
|
inline |
Definition at line 257 of file TriangleMesh.hh.
Referenced by BIAS::ThreeDOut::AddTriangleMesh().
|
inline |
Definition at line 262 of file TriangleMesh.hh.
Referenced by BIAS::OpenSceneGraphHelper::CreateBranchIndexedFaceSets().
|
protected |
Definition at line 609 of file TriangleMesh.cpp.
References BIAS::Projection::DoesPointProjectIntoImage(), BIAS::Projection::GetC(), BIAS::HomgPoint3D::GetEuclidean(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::HomgPlane3D::GetLineIntersection(), BIAS::Projection::GetParameters(), BIAS::ImageBase::GetWidth(), BIAS::HomgPoint2D, BIAS::HomgPoint3D, BIAS::Vector3< T >::Normalize(), BIAS::Vector3< T >::NormL2(), BIAS::Vector4< T >::NormL2(), BIAS::Vector3< T >::ScalarProduct(), BIAS::Vector3< T >::Set(), BIAS::HomgPlane3D::SetFromPoints(), BIAS::ProjectionParametersBase::UnProjectToPoint(), and BIAS::Projection::UnProjectToRay().
|
inline |
Definition at line 97 of file TriangleMesh.hh.
Referenced by BIAS::ThreeDOut::AddPlane(), and GetBiggestConnectedSegment().
|
inline |
texture | set to empty image to ignore and use texture that was set before |
Definition at line 115 of file TriangleMesh.hh.
|
inline |
Definition at line 131 of file TriangleMesh.hh.
void TriangleMesh::SetParams | ( | const double & | minCornerAngle = M_PI * 5.0 / 180.0 , |
const double & | maxAngle = M_PI * 60.0 / 180.0 , |
||
const double | depthScale = 1.0 |
||
) |
Definition at line 60 of file TriangleMesh.cpp.
|
protected |
Simplifies a TriangleMesh to a desired percentage of triangles of the original mesh.
The method uses the algorithm described by Garland and Heckbert in "Surface Simplification Using Quadric Error Metrics"
Texture | the texture of the mesh |
TexP | the |
reduce | reduces the triangles in the generated mesh to "reduce" percent of the original mesh |
Definition at line 1221 of file TriangleMesh.cpp.
References BIAS::Vector3< T >::AddIP(), BIAS::Projection::DoesPointProjectIntoImage(), BIAS::Quadric3::Evaluate(), BIAS::Quadric3::GetArea(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), BIAS::Edge_s::IDv1, BIAS::Edge_s::IDv2, BIAS::Edge_s::newV, BIAS::Quadric3::Optimize(), BIAS::Vector2< T >::Set(), BIAS::Vector2< T >::size(), and BIAS::Vector3< T >::Sub().
Referenced by GenerateDenseMesh().
|
protected |
Tests if a triangle that is involved in the contraction changes direction or overlapps.
Definition at line 1762 of file TriangleMesh.cpp.
References BIAS::Vector< T >::IsZero(), BIAS::Vector< T >::NormL2(), and BIAS::Vector< T >::SetZero().
|
protected |
calculates a plan of three points and returns it area
v1 | first vector of plane |
v2 | second vector of plane |
v3 | third vector of plane |
erg | vector in which the plane is stored |
Definition at line 1697 of file TriangleMesh.cpp.
References BIAS::Vector3< T >::CrossProduct(), BIAS::Vector3< T >::Normalize(), BIAS::Vector3< T >::NormL2(), and BIAS::Vector3< T >::ScalarProduct().
|
protected |
Definition at line 466 of file TriangleMesh.hh.
|
protected |
apply this scale to depth values.
Definition at line 464 of file TriangleMesh.hh.
|
protected |
maximum angle between triangle normal and viewing ray
Definition at line 461 of file TriangleMesh.hh.
|
protected |
Definition at line 441 of file TriangleMesh.hh.
|
protected |
minimum angle of any corner to accept a triangle
Definition at line 459 of file TriangleMesh.hh.
|
protected |
a set with all neighbours of a vertex v
Definition at line 448 of file TriangleMesh.hh.
|
protected |
Definition at line 454 of file TriangleMesh.hh.
|
protected |
Definition at line 440 of file TriangleMesh.hh.
|
protected |
Definition at line 444 of file TriangleMesh.hh.
|
protected |
Definition at line 445 of file TriangleMesh.hh.
|
protected |
Definition at line 456 of file TriangleMesh.hh.
|
protected |
Definition at line 443 of file TriangleMesh.hh.
|
protected |
a set with pairs that contain the vertex v
Definition at line 452 of file TriangleMesh.hh.
|
protected |
a set with triangles that contain the vertex v
Definition at line 450 of file TriangleMesh.hh.
|
protected |
Definition at line 442 of file TriangleMesh.hh.