FlowEngine 8.011
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"
39#include "OrthophotoInterface.h"
40#include "LicenseManager.h"
41#include "ImageIO.h"
42#include "Equirectangular.h"
43#include "MarkerPrinter.h"
48#include "Utilities.h"
49
50namespace FlowEngine
51{
54 {
55 public:
56
58 FLE_DLL virtual ~FlowEngineInterface() = default;
59
60 public:
61
78 FLE_DLL virtual Result computeStructureAndMotion( const SettingsInterface &settings,
79 ProgressBarInterface &progressBar,
80 LogListenerInterface &logListener,
81 Buffer< CameraInterface * > inOutCameras,
82 SparsePointCloudInterface &outPointCloud ) = 0;
83
103 ProgressBarInterface &progressBar,
104 LogListenerInterface &logListener,
105 Buffer< CameraInterface * > inOutCameras,
108 SparsePointCloudInterface &outPointCloud ) = 0;
109
127
147 FLE_DLL virtual Result performBundleAdjustment( const SettingsInterface &inSettings,
148 ProgressBarInterface &inProgressBar,
149 LogListenerInterface &inLogListener,
153 Buffer< CameraInterface * > inOutCameras,
154 SparsePointCloudInterface &inOutPointCloud,
155 Buffer< unsigned char > inOutCamerasStatus ) = 0;
156
174 FLE_DLL virtual Result computeDensePointCloud( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const BoundingBoxInterface &boundingBox, Buffer< CameraInterface * > cameras, const SparsePointCloudInterface &pointCloud, StereoPointCloudInterface &outPointCloud ) = 0;
175
195 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;
196
214 FLE_DLL virtual Result computeMesh( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const BoundingBoxInterface &boundingBox, Buffer< CameraInterface * > cameras, const StereoPointCloudInterface &inStereoPointCloud, StereoMeshInterface &outStereoMesh ) = 0;
215
228 FLE_DLL virtual Result computePhotoconsistency( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, StereoMeshInterface &inoutStereoMesh ) = 0;
229
247 FLE_DLL virtual Result adaptMeshWithControlPoints( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< ControlPointConstraintInterface * > inStartingConstraints, Buffer< ControlPointConstraintInterface * > inDestinationConstraints, const StereoMeshInterface &inDestinationMesh, StereoMeshInterface &inoutStartingMesh ) = 0;
248
257 FLE_DLL virtual Result adaptMeshWithOpticalFlow( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, const StereoMeshInterface &inPivotMesh, const StereoMeshInterface &inDestinationMesh, StereoMeshInterface &inoutStartingMesh ) = 0;
258
265 FLE_DLL virtual Result morphMesh( const SettingsInterface &settings,
266 ProgressBarInterface &progressBar,
267 LogListenerInterface &logListener,
268 const StereoMeshInterface &dataMesh,
269 StereoMeshInterface &inoutTemplateMesh ) = 0;
270
289 FLE_DLL virtual Result computeTexturedMesh( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, const StereoMeshInterface &mesh, StereoTexturedMeshInterface &outStereoTexturedMesh ) = 0;
290
312 FLE_DLL virtual Result computeTexturedMesh( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, const StereoMeshInterface &mesh, ConstBuffer< TexCoords > uvCoords, StereoTexturedMeshInterface &outStereoTexturedMesh ) = 0;
313
328 FLE_DLL virtual Result computeOrthophoto( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, const StereoMeshInterface &mesh, ConstBuffer< double > transform, OrthophotoInterface &outOrthophoto ) = 0;
329
343 FLE_DLL virtual Result computeOrthophotoFromPoints( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const StereoPointCloudInterface &pointCloud, ConstBuffer< double > transform, OrthophotoInterface &outOrthophoto ) = 0;
344
370 FLE_DLL virtual Result detectMarkers( const SettingsInterface &settings,
371 ProgressBarInterface &progressBar,
372 LogListenerInterface &logListener,
374 ConstStringBuffer tagFamily,
375 double subsampling,
376 double blur,
377 int *minimumPoints,
378 double *maximumReprojectionError,
379 double *minimumAngle,
381
401 FLE_DLL virtual Result recomputeVisibility( const SettingsInterface &settings,
402 ProgressBarInterface &progressBar,
403 LogListenerInterface &logListener,
405 bool updateProperties,
406 Index seedPoints,
407 bool keepOnlySeedPoints,
408 StereoPointCloudInterface &inOutPoints ) = 0;
409
427 FLE_DLL virtual Result recomputeVisibility( const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, Buffer< CameraInterface * > cameras, bool updateProperties, StereoMeshInterface &inOutMesh ) = 0;
428
469 ProgressBarInterface &progressBar,
470 LogListenerInterface &logListener,
471 const StereoMeshInterface &mesh,
472 ConstStringBuffer outputDirectory,
473 ConstStringBuffer format,
474 ConstStringBuffer textureFormat,
475 int numberOfTiles,
476 int targetMaxVerticesPerTile,
477 int numberOfLevels,
478 double decimationFactor,
479 double textureDecimationFactor,
480 bool useLocalCoordinates ) = 0;
481
498 FLE_DLL virtual Result computePointClassification( const SettingsInterface &settings,
499 ProgressBarInterface &progressBar,
500 LogListenerInterface &logListener,
501 const StereoPointCloudInterface &pointCloud,
502 std::uint32_t categories,
503 Buffer< PointClassification > outClassifications ) = 0;
504
506 FLE_DLL virtual Result computePointClassification( const SettingsInterface &settings,
507 ProgressBarInterface &progressBar,
508 LogListenerInterface &logListener,
509 const StereoMeshInterface &mesh,
510 std::uint32_t categories,
511 Buffer< PointClassification > outClassifications ) = 0;
512
513 public:
514
520 FLE_DLL virtual Result abort() = 0;
521
527 FLE_DLL virtual Result pause() = 0;
528
533 FLE_DLL virtual Result resume() = 0;
534
542 FLE_DLL virtual Result getVersion( StringBuffer outVersion ) const = 0;
543
546 FLE_DLL virtual void getVersion( Version &outVersion ) const = 0;
547
550 FLE_DLL virtual Size getVersionLength() const = 0;
551
559 FLE_DLL virtual Result isLatestVersion() const = 0;
560
562 FLE_DLL virtual bool isFreeVersion() const = 0;
563
564 public:
565
567 FLE_DLL virtual Index getGraphicsDeviceCount() const = 0;
568
571 FLE_DLL virtual GraphicsDeviceID getGraphicsDevice( Index index ) const = 0;
572
580 GraphicsDeviceInfo &outInfo ) const = 0;
581
589 ConstBuffer< GraphicsDeviceID > devices ) const = 0;
590
591 public:
592
596 FLE_DLL virtual void setMaxNumberOfCores( Size numberOfCores ) = 0;
597
603 FLE_DLL virtual void setMemoryLimit( Size memoryLimit ) = 0;
604
605 public:
606
610 FLE_DLL virtual void setLogTimestamp( bool logTimeStamp ) = 0;
611 };
612
616
620
624
625 namespace Detail
626 {
627 template< >
628 struct Destroyer< FlowEngineInterface >
629 {
630 static void destroy( FlowEngineInterface *flowEngine )
631 {
632 DestroyFlowEngineObject( flowEngine );
633 }
634 };
635 }
636
638 using UniqueFlowEnginePtr = Detail::UniquePtr< FlowEngineInterface >;
639}
640
641#endif
#define FLOWENGINE_FACTORY
Definition: CommonDef.h:32
An oriented bounding box.
Definition: BoundingBoxInterface.h:35
FlowEngine main computation interface.
Definition: FlowEngine.h:54
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 morphMesh(const SettingsInterface &settings, ProgressBarInterface &progressBar, LogListenerInterface &logListener, const StereoMeshInterface &dataMesh, StereoMeshInterface &inoutTemplateMesh)=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 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 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 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)=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 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
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:38
Stores a simple Dense Point Cloud object for the FlowEngine interface.
Definition: StereoPointCloudInterface.h:38
Stores a simple textured mesh object for the FlowEngine interface.
Definition: StereoTexturedMeshInterface.h:36
Definition: BoundingBoxInterface.cpp:26
std::ptrdiff_t Index
Index type.
Definition: CommonDef.h:100
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:638
FLE_DLL void DestroyFlowEngineObject(FlowEngineInterface *flowEngine)
Definition: FlowEngine.cpp:26
std::size_t Size
Size type.
Definition: CommonDef.h:103
Result
Enumerates possible results generated by FlowEngine.
Definition: CommonDef.h:45
Specialization for a Buffer of characters.
Definition: CommonDef.h:255
Holds a (mutable) non_owning pointer and a size Used to marshal memory buffers as arguments in a safe...
Definition: CommonDef.h:118
Specialization for a const buffer characters.
Definition: CommonDef.h:296
Holds a (non mutable) non_owning pointer and a count Used to marshal memory buffers as arguments in a...
Definition: CommonDef.h:191
Represents a logical graphics device.
Definition: CommonDef.h:567
Basic information about a GPU device.
Definition: CommonDef.h:588
Represents a version in the major.minor categories format.
Definition: CommonDef.h:347