Template Class GaussianAccumulator

Class Documentation

template<class T>
class GaussianAccumulator

This is the base class of the Gaussian Accumulator. GaussianAccumulatorKD, GaussianAccumulatorOpt, and GaussianAccumulatorS2 will derive from this class. Unfortunately those classes have small differences causing some unnecessary members in here that basically occurred as these classes were created and changed over time. Eventually I will rewrite this whole thing such that only the bare essentials are in this class.

Template Parameters
  • T:

Public Functions

GaussianAccumulator()
GaussianAccumulator(const int level = 1, const double max_phi = 180.0)

Construct a new Gaussian Accumulator Object.

Parameters
  • level: The refinement level. Iterations of recursive subdivision.

  • max_phi: Latitude degrees from north pole to south pole to include cells in the mesh. Leave at default which includes all of the mesh.

MatX3d GetBucketNormals(const bool mesh_order = false)

Gets the surface normals of the buckets in the histogram. The order by default is sorted by the space filling curve value attached to each cell.

Return

MatX3d

Parameters
  • mesh_order: If true will return in the actual order of triangles of the underlying original mesh object. Useful for visualization.

std::vector<double> GetNormalizedBucketCounts(const bool mesh_order = false)

Get the normalized bucket counts in the histogram. The order by default is sorted by the space filling curve value attached to each cell.

Return

std::vector<double>

Parameters
  • mesh_order: If true will return in the actual order of triangles of the underlying original mesh object. Useful for visualization.

std::vector<double> GetNormalizedBucketCountsByVertex(const bool mesh_order = false)

Average the normalized buckets counts (triangles) into the vertices of the mesh. The order by default is sorted by the space filling curve value attached to each cell.

Return

std::vector<double>

Parameters
  • mesh_order: If true will return in the actual order of vertices of the underlying original mesh object. Useful for visualization.

std::vector<T> GetBucketSFCValues()

Get the space filling curve values of each bucket. Will be sorted low to high.

Return

std::vector<T>

MatX2d GetBucketProjection()

Only useful for GaussianAccumulatorOpt. Return the XY projection of each bucket.

Return

MatX2d

Ico::IcoMesh CopyIcoMesh(const bool mesh_order = false)

Creates a copy of the ico mesh.

Return

Ico::IcoMesh

Parameters
  • mesh_order: If true will return in the original ico mesh before any sortign occurred.

void ClearCount()

Clears all the histogram counts for each cell. Useful to call after peak detection to “reset” the mesh.

Public Members

Ico::IcoMesh mesh

The underlying sphere-like mesh of the Gaussian Accumulator.

std::vector<Bucket<T>> buckets

The buckets in the histogram, corresponding to cells/triangles on the mesh.

std::vector<uint8_t> mask

A mask which indicates which triangles in the mesh are included in the buckets By default its every one (mask = ones). This was added because I thought a user might want to limit the histogram to only include triangles a max_phi from the north pole.

Helper::BBOX projected_bbox

Only a valid member for GaussianAccumulatorOpt, ignore for everthing else.

size_t num_buckets

The number of buckets in histogram, size(buckets)

Protected Functions

void SortBucketsByIndices()

Protected Attributes

std::vector<size_t> sort_idx

This member variable keeps track of any sorting that occurred on the mesh and buckets. It basically allows us to reverse any sorting performed.