8 #ifndef META_OCEAN_TRACKING_MAPTEXTURING_NEW_TEXTURE_GENERATOR_H
9 #define META_OCEAN_TRACKING_MAPTEXTURING_NEW_TEXTURE_GENERATOR_H
30 namespace MapTexturing
46 class OCEAN_TRACKING_MAPTEXTURING_EXPORT
Keyframe
61 inline bool needsToBeStored()
const;
63 inline bool isValid()
const;
87 bool needsToBeStored_ =
true;
96 textureCoordinates_(meshes),
189 inline bool readyToProcessMeshes()
const;
282 return camera_ !=
nullptr;
286 vertices_(std::move(vertices)),
287 textureCoordinates_(std::move(textureCoordinates))
This class implements the abstract base class for all AnyCamera objects.
Definition: AnyCamera.h:130
This class implements Ocean's image class.
Definition: Frame.h:1792
This class implements a recursive lock object.
Definition: Lock.h:31
This class implements a scoped lock object for recursive lock objects.
Definition: Lock.h:135
This class implements a thread.
Definition: Thread.h:115
Definition: NewTextureGenerator.h:47
Frame depth_
The depth frame of this keyframe.
Definition: NewTextureGenerator.h:79
bool needsToBeStored_
Definition: NewTextureGenerator.h:87
TriangleVoteMap triangleVoteMap_
The map mapping triangle ids to their corresponding usage votes for this keyframe.
Definition: NewTextureGenerator.h:82
Frame frame_
The color frame of this keyframe.
Definition: NewTextureGenerator.h:76
bool needsToBeStored() const
Definition: NewTextureGenerator.h:275
SharedAnyCamera camera_
The camera profile of this keyframe.
Definition: NewTextureGenerator.h:70
UnorderedIndexSet64 acceptableTrianglesSet_
The set holding the ids of all triangles which could be textured with this keyfame.
Definition: NewTextureGenerator.h:85
HomogenousMatrix4 world_T_camera_
The camera pose of this keyframe.
Definition: NewTextureGenerator.h:73
bool isValid() const
Definition: NewTextureGenerator.h:280
static Scalar determineTriangleVote(const AnyCamera &anyCamera, const HomogenousMatrix4 &world_T_camera, const HomogenousMatrix4 &flippedCamera_T_world, const Triangle3 &triangle, const Frame &depth)
Keyframe(SharedAnyCamera anyCamera, const HomogenousMatrix4 &camera_T_world, Frame &&frame, Frame &&depth)
Creates a new keyframe object.
bool updateVotes(const BlockedMeshes &blockedMeshes)
This class holds the relevant information for a textured mesh.
Definition: NewTextureGenerator.h:117
UnorderedIndexSet32 usedKeyframeIds_
The ids of the keyframes which are associated with this textured mesh.
Definition: NewTextureGenerator.h:141
Vectors3 vertices_
The vertices of this mesh.
Definition: NewTextureGenerator.h:135
Vectors2 textureCoordinates_
The per-vertex texture coordinates of this mesh, one for each vertex.
Definition: NewTextureGenerator.h:138
TexturedMesh()=default
Default constructor.
Definition: NewTextureGenerator.h:91
std::vector< Vectors2 > textureCoordinates_
Definition: NewTextureGenerator.h:108
TexturedRegion(const size_t meshes)
Definition: NewTextureGenerator.h:94
std::vector< Indices32 > islandIds_
Definition: NewTextureGenerator.h:110
std::vector< Vectors3 > vertices_
Definition: NewTextureGenerator.h:106
CV::PixelBoundingBoxes islandBoundingBoxes_
Definition: NewTextureGenerator.h:104
Definition: NewTextureGenerator.h:38
static TriangleVoteMap determineBestVotesAcrossKeyframes(const KeyframeMap &keyframeMap)
void convertToTexture(const TexturedRegionMap &texturedRegionMap, TexturedMeshMap &texturedMeshMap, Frame &textureFrame)
static void spreadBestVotesAcrossKeyframes(KeyframeMap &keyframeMap, const TriangleVoteMap &bestVoteMap, const Scalar acceptanceRatio=Scalar(0.2))
std::unordered_set< VectorI3, VectorI3 > BlockCoordinateSet
Definition of an unordered set holding block ids.
Definition: NewTextureGenerator.h:179
uint64_t memoryUsage() const
Returns the current memory usage of this texture generator.
std::unordered_map< VectorI3, UnorderedIndexSet32, VectorI3 > UsedKeyframeIdsPerMeshMap
Definition: NewTextureGenerator.h:169
std::unordered_map< VectorI3, TexturedMesh, VectorI3 > TexturedMeshMap
Definition: NewTextureGenerator.h:146
std::unordered_map< Index32, Keyframe > KeyframeMap
Definition: NewTextureGenerator.h:150
Rendering::TriangleFaces activeTriangleFaces_
The triangle faces of the meshes which are currently processed.
Definition: NewTextureGenerator.h:244
static TexturedRegion extractRegionsFromKeyframe(const Keyframe &keyframe, const BlockedMeshes &blockedMeshes)
bool processMeshes(Frustums &&cameraFrustums, Vectors3 &&vertices, Rendering::TriangleFaces &&triangleFaces, Keyframes &&newKeyframes)
void threadRun() override
The thread run function.
bool latestTexturedMeshes(TexturedMeshMap &texturedMeshMap, Frame &textureFrame)
Returns the latest textured meshes.
Definition: NewTextureGenerator.h:299
std::unordered_map< Index64, Scalar > TriangleVoteMap
Definition of an unordered map mapping triangle ids to votes.
Definition: NewTextureGenerator.h:44
std::vector< TexturedMesh > TexturedMeshes
Definition: NewTextureGenerator.h:144
static Frame downsampleDepthFrame(const Frame &depthFrame, const unsigned int iterations=2u)
Down-samples a given depth frame by taking the minimal depth value of a 4-neighborhood.
BlockedMeshes extractVisibleMeshes(const Frustums &cameraFrustums, const Vectors3 &vertices, const Rendering::TriangleFaces &triangleFaces) const
std::vector< Keyframe > Keyframes
Definition: NewTextureGenerator.h:148
BlockedMeshes blockedMeshes_
Definition: NewTextureGenerator.h:249
UsedKeyframeIdsPerMeshMap usedKeyframeIdsPerMeshMap_
Definition: NewTextureGenerator.h:260
ExecutionMode executionMode_
The current execution mode.
Definition: NewTextureGenerator.h:238
static bool extractRegionsFromKeyframes(KeyframeMap &keyframeMap, const BlockedMeshes &blockMeshes, TexturedRegionMap &texturedRegionMap)
Frame latestTextureFrame_
The latest texture associated with the latest textured meshes.
Definition: NewTextureGenerator.h:269
TexturedMeshMap latestTexturedMeshMap_
The map holding the latest textured meshes.
Definition: NewTextureGenerator.h:266
std::unordered_map< Index32, TexturedRegion > TexturedRegionMap
Definition: NewTextureGenerator.h:152
bool readyToProcessMeshes() const
Returns whether the generator is ready to process new meshes.
Definition: NewTextureGenerator.h:292
KeyframeIdCounterMap keyframeIdCounterMap_
The map mapping ids of keyframes to usage counters.
Definition: NewTextureGenerator.h:263
std::unordered_map< Index32, Index32 > KeyframeIdCounterMap
Definition of an unordered map mapping ids of keyframes to usage counters.
Definition: NewTextureGenerator.h:174
BlockCoordinateSet blockCoordinateSet_
The set holding the ids of all currently existing blocks.
Definition: NewTextureGenerator.h:258
Lock lock_
The generator's lock.
Definition: NewTextureGenerator.h:272
Frustums activeCameraFrustums_
The frustums of the cameras which have been used to determine vertices which are currently processed.
Definition: NewTextureGenerator.h:247
static bool extractRegionsFromMostVotedKeyframe(UnorderedIndexSet32 &candidateKeyframeIds, KeyframeMap &keyframeMap, const BlockedMeshes &blockMeshes, TexturedRegionMap &texturedRegionMap)
ExecutionMode
Definition of individual execution modes.
Definition: NewTextureGenerator.h:160
@ EM_IDLE
The generator is currently idling and can process new meshes.
Definition: NewTextureGenerator.h:162
@ EM_PROCESSING_MESHES
The generator is currently processing new meshes.
Definition: NewTextureGenerator.h:164
@ EM_MESES_PROCESSED
The generator has processed new meshes which can be received/accessed.
Definition: NewTextureGenerator.h:166
KeyframeMap keyframeMap_
The map mapping keyframe ids to keyframes.
Definition: NewTextureGenerator.h:255
Vectors3 activeVertices_
The vertices of the meshes which are currently processed.
Definition: NewTextureGenerator.h:241
This class implements a 3D triangle.
Definition: Triangle3.h:80
std::unordered_set< Index32 > UnorderedIndexSet32
Definition of an unordered_set holding 32 bit indices.
Definition: Base.h:126
std::unordered_set< Index64 > UnorderedIndexSet64
Definition of an unordered_set holding 64 bit indices.
Definition: Base.h:132
uint32_t Index32
Definition of a 32 bit index value.
Definition: Base.h:84
std::vector< PixelBoundingBox > PixelBoundingBoxes
Definition of a vector holding bounding box objects with only positive coordinate values.
Definition: PixelBoundingBox.h:42
std::vector< Frustum > Frustums
Definition of a vector holding Frustum objects.
Definition: Frustum.h:59
float Scalar
Definition of a scalar type.
Definition: Math.h:128
std::shared_ptr< AnyCamera > SharedAnyCamera
Definition of a shared pointer holding an AnyCamera object with Scalar precision.
Definition: AnyCamera.h:60
std::vector< Vector2 > Vectors2
Definition of a vector holding Vector2 objects.
Definition: Vector2.h:64
std::vector< Vector3 > Vectors3
Definition of a vector holding Vector3 objects.
Definition: Vector3.h:65
std::vector< TriangleFace > TriangleFaces
Definition of a vector holding triangle faces.
Definition: TriangleFace.h:23
std::vector< BlockedMesh > BlockedMeshes
Definition of a vector holding BlockedMesh objects.
Definition: BlockedMesh.h:31
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15