FlowEngine 9.000
Photogrammetry Software Development Kit
Loading...
Searching...
No Matches
FlowEngine.h
Go to the documentation of this file.
1/*
2 *
3 * C@@o ____ _____ __ _
4 * oC8@@@@@@@o |___ \| __ \ / _| |
5 * o@@@@@@@@@@@@O __) | | | | |_| | _____ __
6 * O@O 8@@@@@@@@@O |__ <| | | | _| |/ _ \ \ /\ / /
7 * o@@@@@@@O OOOOOCo ___) | |__| | | | | (_) \ V V /
8 * C@@@@@@@@@@@@Oo |____/|_____/|_| |_|\___/ \_/\_/
9 * o8@@@@@@@@@@@@@@@@8OOCCCC
10 * oO@@@@@@@@@@@@@@@@@@@o 3Dflow s.r.l. - www.3dflow.net
11 * oO8@@@@@@@@@@@@o Copyright 2022
12 * oO88@@@@@@@@8OCo All Rights Reserved
13 * O@@@@@@@@@@@@@@@@@@@@@@@@@8OCCoooooooCCo
14 * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O
15 * @@@Oo oO8@@@@@@@@@@@@@@@@8
16 *
17 */
18
19#ifndef FLOWENGINE_H
20#define FLOWENGINE_H
21
22#pragma once
23
24#include "CommonDef.h"
27#include "CameraInterface.h"
28#include "SettingsInterface.h"
32#include "StereoMeshInterface.h"
40#include "OrthophotoInterface.h"
41#include "LicenseManager.h"
42#include "ImageIO.h"
43#include "Equirectangular.h"
44#include "MarkerPrinter.h"
49#include "Utilities.h"
50
51namespace FlowEngine
52{
55 {
56 public:
57
59 FLE_DLL virtual ~FlowEngineInterface() = default;
60
61 public:
62
79 FLE_DLL virtual Result computeStructureAndMotion( const SettingsInterface &settings,
80 ProgressBarInterface &progressBar,
81 LogListenerInterface &logListener,
82 Buffer< CameraInterface * > inOutCameras,
83 SparsePointCloudInterface &outPointCloud ) = 0;
84
104 ProgressBarInterface &progressBar,
105 LogListenerInterface &logListener,
106 Buffer< CameraInterface * > inOutCameras,
109 SparsePointCloudInterface &outPointCloud ) = 0;
110
128
148 FLE_DLL virtual Result performBundleAdjustment( const SettingsInterface &inSettings,
149 ProgressBarInterface &inProgressBar,
150 LogListenerInterface &inLogListener,
154 Buffer< CameraInterface * > inOutCameras,
155 SparsePointCloudInterface &inOutPointCloud,
156 Buffer< unsigned char > inOutCamerasStatus ) = 0;
157
175 FLE_DLL virtual Result computeDensePointCloud( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const BoundingBoxInterface &boundingBox, Buffer< CameraInterface * > cameras, const SparsePointCloudInterface &pointCloud, StereoPointCloudInterface &outPointCloud ) = 0;
176
196 FLE_DLL virtual Result computeDensePointCloudFromInputMesh( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const BoundingBoxInterface &boundingBox, Buffer< CameraInterface * > cameras, const SparsePointCloudInterface &pointCloud, const StereoMeshInterface &stereoMesh, StereoPointCloudInterface &outPointCloud ) = 0;
197
215 FLE_DLL virtual Result computeMesh( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const BoundingBoxInterface &boundingBox, Buffer< CameraInterface * > cameras, const StereoPointCloudInterface &inStereoPointCloud, StereoMeshInterface &outStereoMesh ) = 0;
216
229 FLE_DLL virtual Result computePhotoconsistency( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, StereoMeshInterface &inoutStereoMesh ) = 0;
230
248 FLE_DLL virtual Result adaptMeshWithControlPoints( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< ControlPointConstraintInterface * > inStartingConstraints, Buffer< ControlPointConstraintInterface * > inDestinationConstraints, const StereoMeshInterface &inDestinationMesh, StereoMeshInterface &inoutStartingMesh ) = 0;
249
258 FLE_DLL virtual Result adaptMeshWithOpticalFlow( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, const StereoMeshInterface &inPivotMesh, const StereoMeshInterface &inDestinationMesh, StereoMeshInterface &inoutStartingMesh ) = 0;
259
266 FLE_DLL virtual Result morphMesh( const SettingsInterface &settings,
267 ProgressBarInterface &progressBar,
268 LogListenerInterface &logListener,
269 const StereoMeshInterface &dataMesh,
270 StereoMeshInterface &inoutTemplateMesh ) = 0;
271
290 FLE_DLL virtual Result computeTexturedMesh( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, const StereoMeshInterface &mesh, StereoTexturedMeshInterface &outStereoTexturedMesh ) = 0;
291
313 FLE_DLL virtual Result computeTexturedMesh( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, const StereoMeshInterface &mesh, ConstBuffer< TexCoords > uvCoords, StereoTexturedMeshInterface &outStereoTexturedMesh ) = 0;
314
329 FLE_DLL virtual Result computeOrthophoto( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, const StereoMeshInterface &mesh, ConstBuffer< double > transform, OrthophotoInterface &outOrthophoto ) = 0;
330
344 FLE_DLL virtual Result computeOrthophotoFromPoints( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const StereoPointCloudInterface &pointCloud, ConstBuffer< double > transform, OrthophotoInterface &outOrthophoto ) = 0;
345
372 FLE_DLL virtual Result detectMarkers( const SettingsInterface &settings,
373 ProgressBarInterface &progressBar,
374 LogListenerInterface &logListener,
376 ConstStringBuffer tagFamily,
377 double subsampling,
378 double blur,
379 int *minimumPoints,
380 double *maximumReprojectionError,
381 double *minimumAngle,
383 Buffer< int > inOutIds ) = 0;
384
404 FLE_DLL virtual Result recomputeVisibility( const SettingsInterface &settings,
405 ProgressBarInterface &progressBar,
406 LogListenerInterface &logListener,
408 bool updateProperties,
409 Index seedPoints,
410 bool keepOnlySeedPoints,
411 StereoPointCloudInterface &inOutPoints ) = 0;
412
430 FLE_DLL virtual Result recomputeVisibility( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, bool updateProperties, StereoMeshInterface &inOutMesh ) = 0;
431
472 ProgressBarInterface &progressBar,
473 LogListenerInterface &logListener,
474 const StereoMeshInterface &mesh,
475 ConstStringBuffer outputDirectory,
476 ConstStringBuffer format,
477 ConstStringBuffer textureFormat,
478 int numberOfTiles,
479 int targetMaxVerticesPerTile,
480 int numberOfLevels,
481 double decimationFactor,
482 double textureDecimationFactor,
483 bool useLocalCoordinates ) = 0;
484
501 FLE_DLL virtual Result computePointClassification( const SettingsInterface &settings,
502 ProgressBarInterface &progressBar,
503 LogListenerInterface &logListener,
504 const StereoPointCloudInterface &pointCloud,
505 std::uint32_t categories,
506 Buffer< PointClassification > outClassifications ) = 0;
507
523 FLE_DLL virtual Result computePointClassification( const SettingsInterface &settings,
524 ProgressBarInterface &progressBar,
525 LogListenerInterface &logListener,
526 const StereoPointCloudInterface &pointCloud,
527 ConstStringBuffer modelFilePath,
528 Buffer< PointClassification > outClassifications ) = 0;
529
531 FLE_DLL virtual Result computePointClassification( const SettingsInterface &settings,
532 ProgressBarInterface &progressBar,
533 LogListenerInterface &logListener,
534 const StereoMeshInterface &mesh,
535 std::uint32_t categories,
536 Buffer< PointClassification > outClassifications ) = 0;
537
539 FLE_DLL virtual Result computePointClassification( const SettingsInterface &settings,
540 ProgressBarInterface &progressBar,
541 LogListenerInterface &logListener,
542 const StereoMeshInterface &mesh,
543 ConstStringBuffer modelFilePath,
544 Buffer< PointClassification > outClassifications ) = 0;
545
560 FLE_DLL virtual Result computeAutomaticMasking( const SettingsInterface &settings,
561 ProgressBarInterface &progressBar,
562 LogListenerInterface &logListener,
563 Buffer< CameraInterface * > inOutCameras,
564 ConstStringBuffer modelFilePath ) = 0;
565
585 FLE_DLL virtual Result computeDepthMaps( const SettingsInterface &settings,
586 ProgressBarInterface &progressBar,
587 LogListenerInterface &logListener,
589 StereoMeshInterface &targetMesh,
590 bool removeRadialDistortion,
591 bool autoFillUnknownRegions,
592 Buffer< Image > inOutDepthMaps ) = 0;
593
610 FLE_DLL virtual Result computeGaussianSplats( const SettingsInterface &settings,
611 ProgressBarInterface &progressBar,
612 LogListenerInterface &logListener,
613 const BoundingBoxInterface &inBoundingBox,
615 const StereoPointCloudInterface &stereoPointCloud,
616 GaussianSplatsInterface &outGaussianSplat ) = 0;
617
618 public:
619
625 FLE_DLL virtual Result abort() = 0;
626
632 FLE_DLL virtual Result pause() = 0;
633
638 FLE_DLL virtual Result resume() = 0;
639
647 FLE_DLL virtual Result getVersion( StringBuffer outVersion ) const = 0;
648
651 FLE_DLL virtual void getVersion( Version &outVersion ) const = 0;
652
655 FLE_DLL virtual Size getVersionLength() const = 0;
656
664 FLE_DLL virtual Result isLatestVersion() const = 0;
665
667 FLE_DLL virtual bool isFreeVersion() const = 0;
668
669 public:
670
672 FLE_DLL virtual Index getGraphicsDeviceCount() const = 0;
673
676 FLE_DLL virtual GraphicsDeviceID getGraphicsDevice( Index index ) const = 0;
677
685 GraphicsDeviceInfo &outInfo ) const = 0;
686
694 ConstBuffer< GraphicsDeviceID > devices ) const = 0;
695
696 public:
697
701 FLE_DLL virtual void setMaxNumberOfCores( Size numberOfCores ) = 0;
702
708 FLE_DLL virtual void setMemoryLimit( Size memoryLimit ) = 0;
709
710 public:
711
715 FLE_DLL virtual void setLogTimestamp( bool logTimeStamp ) = 0;
716 };
717
721
725
729
730 namespace Detail
731 {
732 template< >
733 struct Destroyer< FlowEngineInterface >
734 {
735 static void destroy( FlowEngineInterface *flowEngine )
736 {
737 DestroyFlowEngineObject( flowEngine );
738 }
739 };
740 }
741
743 using UniqueFlowEnginePtr = Detail::UniquePtr< FlowEngineInterface >;
744}
745
746#endif
#define FLOWENGINE_FACTORY
Definition: CommonDef.h:32
An oriented bounding box.
Definition: BoundingBoxInterface.h:35
FlowEngine main computation interface.
Definition: FlowEngine.h:55
virtual FLE_DLL Result abort()=0
virtual FLE_DLL Result recomputeVisibility(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, bool updateProperties, Index seedPoints, bool keepOnlySeedPoints, StereoPointCloudInterface &inOutPoints)=0
virtual FLE_DLL Result computePointClassification(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const StereoPointCloudInterface &pointCloud, std::uint32_t categories, Buffer< PointClassification > outClassifications)=0
virtual FLE_DLL GraphicsDeviceID getGraphicsDevice(Index index) const =0
virtual FLE_DLL void getVersion(Version &outVersion) const =0
virtual FLE_DLL Result computeAndExportLodTexturedMesh(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const StereoMeshInterface &mesh, ConstStringBuffer outputDirectory, ConstStringBuffer format, ConstStringBuffer textureFormat, int numberOfTiles, int targetMaxVerticesPerTile, int numberOfLevels, double decimationFactor, double textureDecimationFactor, bool useLocalCoordinates)=0
virtual FLE_DLL Result computeOrthophotoFromPoints(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const StereoPointCloudInterface &pointCloud, ConstBuffer< double > transform, OrthophotoInterface &outOrthophoto)=0
virtual FLE_DLL ~FlowEngineInterface()=default
Default virtual destructor.
virtual FLE_DLL Result computeAutomaticMasking(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > inOutCameras, ConstStringBuffer modelFilePath)=0
virtual FLE_DLL Result morphMesh(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const StereoMeshInterface &dataMesh, StereoMeshInterface &inoutTemplateMesh)=0
virtual FLE_DLL Result computePointClassification(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const StereoPointCloudInterface &pointCloud, ConstStringBuffer modelFilePath, Buffer< PointClassification > outClassifications)=0
virtual FLE_DLL Result detectMarkers(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, ConstStringBuffer tagFamily, double subsampling, double blur, int *minimumPoints, double *maximumReprojectionError, double *minimumAngle, Buffer< ControlPointConstraintInterface * > inOutPoints, Buffer< int > inOutIds)=0
virtual FLE_DLL void setLogTimestamp(bool logTimeStamp)=0
virtual FLE_DLL bool isFreeVersion() const =0
virtual FLE_DLL Result computeSparsePointCloudFromKnownPPM(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, SparsePointCloudInterface &outPointCloud)=0
virtual FLE_DLL Result getGraphicsDeviceInfo(GraphicsDeviceID device, GraphicsDeviceInfo &outInfo) const =0
virtual FLE_DLL Result computePointClassification(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const StereoMeshInterface &mesh, ConstStringBuffer modelFilePath, Buffer< PointClassification > outClassifications)=0
Classify the points of a mesh object using a custom model.
virtual FLE_DLL Result computeDensePointCloudFromInputMesh(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const BoundingBoxInterface &boundingBox, Buffer< CameraInterface * > cameras, const SparsePointCloudInterface &pointCloud, const StereoMeshInterface &stereoMesh, StereoPointCloudInterface &outPointCloud)=0
virtual FLE_DLL void setMemoryLimit(Size memoryLimit)=0
virtual FLE_DLL Result computeTexturedMesh(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, const StereoMeshInterface &mesh, StereoTexturedMeshInterface &outStereoTexturedMesh)=0
virtual FLE_DLL Result recomputeVisibility(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, bool updateProperties, StereoMeshInterface &inOutMesh)=0
virtual FLE_DLL Result computeGaussianSplats(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const BoundingBoxInterface &inBoundingBox, Buffer< CameraInterface * > cameras, const StereoPointCloudInterface &stereoPointCloud, GaussianSplatsInterface &outGaussianSplat)=0
virtual FLE_DLL Result computePointClassification(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const StereoMeshInterface &mesh, std::uint32_t categories, Buffer< PointClassification > outClassifications)=0
Classify the points of a mesh object.
virtual FLE_DLL Result computeStructureAndMotion(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > inOutCameras, SparsePointCloudInterface &outPointCloud)=0
virtual FLE_DLL Result computeStructureAndMotionConstrained(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > inOutCameras, ConstBuffer< ControlPointConstraintInterface * > inPointConstraints, ConstBuffer< CameraConstraintInterface * > inCameraConstraints, SparsePointCloudInterface &outPointCloud)=0
virtual FLE_DLL Result pause()=0
virtual FLE_DLL void setMaxNumberOfCores(Size numberOfCores)=0
virtual FLE_DLL Result computePhotoconsistency(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, StereoMeshInterface &inoutStereoMesh)=0
virtual FLE_DLL Result adaptMeshWithOpticalFlow(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, const StereoMeshInterface &inPivotMesh, const StereoMeshInterface &inDestinationMesh, StereoMeshInterface &inoutStartingMesh)=0
virtual FLE_DLL Result isLatestVersion() const =0
virtual FLE_DLL Result resume()=0
virtual FLE_DLL Result computeMesh(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const BoundingBoxInterface &boundingBox, Buffer< CameraInterface * > cameras, const StereoPointCloudInterface &inStereoPointCloud, StereoMeshInterface &outStereoMesh)=0
virtual FLE_DLL Result performBundleAdjustment(const SettingsInterface &inSettings, ProgressBarInterface &inProgressBar, LogListenerInterface &inLogListener, ConstBuffer< ControlPointConstraintInterface * > inPointConstraints, ConstBuffer< CameraConstraintInterface * > inCameraConstraints, ConstBuffer< DistanceConstraintInterface * > inDistanceConstraints, Buffer< CameraInterface * > inOutCameras, SparsePointCloudInterface &inOutPointCloud, Buffer< unsigned char > inOutCamerasStatus)=0
virtual FLE_DLL Result computeDepthMaps(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, StereoMeshInterface &targetMesh, bool removeRadialDistortion, bool autoFillUnknownRegions, Buffer< Image > inOutDepthMaps)=0
virtual FLE_DLL Result getVersion(StringBuffer outVersion) const =0
virtual FLE_DLL Result selectGraphicsDevices(SettingsInterface &settings, ConstBuffer< GraphicsDeviceID > devices) const =0
virtual FLE_DLL Result computeOrthophoto(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, const StereoMeshInterface &mesh, ConstBuffer< double > transform, OrthophotoInterface &outOrthophoto)=0
virtual FLE_DLL Result computeDensePointCloud(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const BoundingBoxInterface &boundingBox, Buffer< CameraInterface * > cameras, const SparsePointCloudInterface &pointCloud, StereoPointCloudInterface &outPointCloud)=0
virtual FLE_DLL Result adaptMeshWithControlPoints(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< ControlPointConstraintInterface * > inStartingConstraints, Buffer< ControlPointConstraintInterface * > inDestinationConstraints, const StereoMeshInterface &inDestinationMesh, StereoMeshInterface &inoutStartingMesh)=0
virtual FLE_DLL Size getVersionLength() const =0
virtual FLE_DLL Index getGraphicsDeviceCount() const =0
virtual FLE_DLL Result computeTexturedMesh(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, const StereoMeshInterface &mesh, ConstBuffer< TexCoords > uvCoords, StereoTexturedMeshInterface &outStereoTexturedMesh)=0
Stores a Gaussian Splat point cloud object for the FlowEngine interface.
Definition: GaussianSplatsInterface.h:34
Pure virtual Log Listener interface.
Definition: LogListenerInterface.h:41
Hold an Orthophoto object.
Definition: OrthophotoInterface.h:34
Pure virtual Progress Bar interface.
Definition: ProgressBarInterface.h:32
Stores the processing settings.
Definition: SettingsInterface.h:32
Stores a PointCloud object.
Definition: SparsePointCloudInterface.h:36
Stores a simple stereo mesh object for the FlowEngine interface.
Definition: StereoMeshInterface.h:40
Stores a simple Dense Point Cloud object for the FlowEngine interface.
Definition: StereoPointCloudInterface.h:40
Stores a simple textured mesh object for the FlowEngine interface.
Definition: StereoTexturedMeshInterface.h:38
Definition: BoundingBoxInterface.cpp:26
std::ptrdiff_t Index
Index type.
Definition: CommonDef.h:103
FLE_DLL void DestroyFlowEngine(FlowEngineInterface *flowEngine)
Definition: FlowEngine.cpp:31
FLE_DLL FlowEngineInterface * CreateFlowEngine()
Definition: FlowEngine.cpp:21
Detail::UniquePtr< FlowEngineInterface > UniqueFlowEnginePtr
Automatically manages the lifetime of a FlowEngine object.
Definition: FlowEngine.h:743
FLE_DLL void DestroyFlowEngineObject(FlowEngineInterface *flowEngine)
Definition: FlowEngine.cpp:26
std::size_t Size
Size type.
Definition: CommonDef.h:106
Result
Enumerates possible results generated by FlowEngine.
Definition: CommonDef.h:48
Specialization for a Buffer of characters.
Definition: CommonDef.h:264
Holds a (mutable) non_owning pointer and a size Used to marshal memory buffers as arguments in a safe...
Definition: CommonDef.h:127
Specialization for a const buffer characters.
Definition: CommonDef.h:305
Holds a (non mutable) non_owning pointer and a count Used to marshal memory buffers as arguments in a...
Definition: CommonDef.h:200
Represents a logical graphics device.
Definition: CommonDef.h:743
Basic information about a GPU device.
Definition: CommonDef.h:764
Represents a version in the major.minor categories format.
Definition: CommonDef.h:431