gramods
Classes | Public Member Functions | Static Public Attributes | List of all members
gramods::gmTrack::ProjectionTextureGenerator Class Reference

The ProjectionTextureGenerator is a utility for generating a projection texture for gmGraphics::TextureProjectedView. More...

#include <ProjectionTextureGenerator.hh>

Inheritance diagram for gramods::gmTrack::ProjectionTextureGenerator:
Inheritance graph
[legend]
Collaboration diagram for gramods::gmTrack::ProjectionTextureGenerator:
Collaboration graph
[legend]

Classes

struct  Impl
 

Public Member Functions

void setResolution (gmCore::size2 res)
 Set the resolution of the output image. More...
 
void addRegion (size_t order=1)
 Creates a new region for the following calls to addBufferPosition, and optionally also sets its polynomial order. More...
 
void addBufferPosition (Eigen::Vector2f p)
 Adds a known calibration point, in room coordinates. More...
 
void addHullIndex (size_t idx)
 Adds a point, referenced by index, from the buffer position list to the list of hull points for the current region. More...
 
void addHullPosition (Eigen::Vector2f p)
 Adds a point to the list of hull points for the current region. More...
 
void setFile (std::filesystem::path file)
 Sets the file path to save the view to. More...
 
void saveImage ()
 Save the final image to the specified file. More...
 
Eigen::Vector3f getOffset ()
 Returns the offset needed to convert the image pixel values in the last generated image to their respective 3D position. More...
 
Eigen::Vector3f getScale ()
 Returns the scale needed to convert the image pixel values in the last generated image to their respective 3D position. More...
 
- Public Member Functions inherited from gramods::gmTrack::SampleCollector
 SampleCollector (Impl *impl=nullptr)
 
void update (clock::time_point time, size_t frame)
 Updates the internal states. More...
 
void setController (std::shared_ptr< Controller > controller)
 Sets the controller to use for reading tracker samples. More...
 
void addTrackerPosition (Eigen::Vector3f p)
 Adds a tracker position. More...
 
void addTrackerOrientation (Eigen::Quaternionf o)
 Adds a tracker orientation. More...
 
void setSamplesPerSecond (float n)
 Sets the frequency at which samples are collected when the controller button is pressed. More...
 
void setWarningThreshold (float d)
 Sets the data offset required to trigger a warning. More...
 
void setInlierThreshold (float r)
 Set the maximum positional distance from the average allowed for a sample to be included in the average. More...
 
void setOrientationWarningThreshold (float d)
 Sets the data offset required to trigger a warning. More...
 
void setOrientationInlierThreshold (float r)
 Set the maximum orientational distance (in radians) from the average allowed for a sample to be included in the average. More...
 
const std::vector< Eigen::Vector3f > & getTrackerPositions () const
 Returns the current list of tracker positions. More...
 
const std::vector< Eigen::Quaternionf > & getTrackerOrientations () const
 Returns the current list of tracker orientations. More...
 
void traverse (Visitor *visitor) override
 Propagates the specified visitor. More...
 
- Public Member Functions inherited from gramods::gmCore::Object
 Object ()
 Initializes internal data. More...
 
virtual ~Object ()
 Cleaning up internal data. More...
 
virtual void initialize ()
 Called to initialize the Object. More...
 
virtual void accept (Visitor *visitor)
 Calls the visitors apply method with this as argument. More...
 
virtual std::string getDefaultKey ()
 Returns the default key for the Object when automatically instantiated in a Configuration, i.e. More...
 
bool isInitialized ()
 Returns true if the Object is initialized. More...
 
- Public Member Functions inherited from gramods::gmCore::Updateable
 Updateable (int priority=0)
 Configures the Updateable properties to the specified priority. More...
 

Static Public Attributes

static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 
- Static Public Attributes inherited from gramods::gmTrack::SampleCollector
static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 

Additional Inherited Members

- Public Types inherited from gramods::gmCore::Updateable
typedef std::chrono::steady_clock clock
 
- Static Public Member Functions inherited from gramods::gmTrack::SampleCollector
static Eigen::Vector3f getAverage (std::vector< Eigen::Vector3f > samples, float *stddev=nullptr, float *maxdev=nullptr, float inlier_dist=-1.f, size_t *inlier_count=nullptr)
 Calculates and returns the average point of a set of samples. More...
 
static Eigen::Quaternionf getAverage (std::vector< Eigen::Quaternionf > samples, float *stddev=nullptr, float *maxdev=nullptr, float inlier_dist=-1.f, size_t *inlier_count=nullptr)
 Calculates and returns the average point of a set of samples. More...
 
- Static Public Member Functions inherited from gramods::gmCore::Updateable
static void updateAll (clock::time_point t=clock::now(), std::optional< size_t > frame=std::nullopt)
 Updates all currently instanciated updateable objects. More...
 
- Protected Attributes inherited from gramods::gmTrack::SampleCollector
std::unique_ptr< Impl_impl
 

Detailed Description

The ProjectionTextureGenerator is a utility for generating a projection texture for gmGraphics::TextureProjectedView.

The utility is used by marking, with the tracking device, the position of known, pre-specified positions in the room or display system.

Member Function Documentation

◆ addBufferPosition()

void gramods::gmTrack::ProjectionTextureGenerator::addBufferPosition ( Eigen::Vector2f  p)

Adds a known calibration point, in room coordinates.

If positions are added without first specifying polynomial order (see addRegion), then order 1 will be used.

XML-attribute: bufferPosition

◆ addHullIndex()

void gramods::gmTrack::ProjectionTextureGenerator::addHullIndex ( size_t  idx)

Adds a point, referenced by index, from the buffer position list to the list of hull points for the current region.

A list of hull points that enclose the region is necessary when more than one region is defined. This starts at zero for each region.

XML-attribute: hullPoint

◆ addHullPosition()

void gramods::gmTrack::ProjectionTextureGenerator::addHullPosition ( Eigen::Vector2f  p)

Adds a point to the list of hull points for the current region.

A list of hull points that enclose the region is necessary when more than one region is defined.

XML-attribute: hullPoint

◆ addRegion()

void gramods::gmTrack::ProjectionTextureGenerator::addRegion ( size_t  order = 1)

Creates a new region for the following calls to addBufferPosition, and optionally also sets its polynomial order.

Use the regions to separate between geometrically smooth projection areas with discontinuities in between. Typically projection surfaces are flat (order = 1) or spherical/cylindrical (order = 2). If positions are added without specifying polynomial order, then order 1 will be used.

Parameters
orderThe polynomial order of the region.

XML-attribute: region

◆ getOffset()

Eigen::Vector3f gramods::gmTrack::ProjectionTextureGenerator::getOffset ( )

Returns the offset needed to convert the image pixel values in the last generated image to their respective 3D position.

◆ getScale()

Eigen::Vector3f gramods::gmTrack::ProjectionTextureGenerator::getScale ( )

Returns the scale needed to convert the image pixel values in the last generated image to their respective 3D position.

◆ saveImage()

void gramods::gmTrack::ProjectionTextureGenerator::saveImage ( )

Save the final image to the specified file.

Since the RGB values of the image will be in the range 0-1, a scale and offset for these values will also be computed.

◆ setFile()

void gramods::gmTrack::ProjectionTextureGenerator::setFile ( std::filesystem::path  file)

Sets the file path to save the view to.

This generator will save the image in TIFF format (32 bit float RGB encoding XYZ) so if the specified path does not include a .tif suffix then one will be added.

XML-attribute: file

◆ setResolution()

void gramods::gmTrack::ProjectionTextureGenerator::setResolution ( gmCore::size2  res)

Set the resolution of the output image.


The documentation for this class was generated from the following files: