class mp2p_icp_filters::KeyframeOverlapGraph

Overview

A graph of keyframes (nodes) weighted by their shared content: the Jaccard similarity of their signatures. Nodes are added one at a time, each one compared at once with all previous nodes through an inverted index of voxels, so the cost of an insertion grows with the number of earlier nodes that saw each of its voxels, not with the number of nodes.

#include <keyframe_overlap.h>

class KeyframeOverlapGraph
{
public:
    // structs

    struct Parameters;

    // construction

    KeyframeOverlapGraph();
    KeyframeOverlapGraph(const Parameters& p);

    // methods

    uint32_t add_node(const KeyframeSignature& sig);
    std::vector<std::pair<uint32_t, double>> query(const KeyframeSignature& sig) const;
    std::size_t node_count() const;
    const std::vector<WeightedEdge>& edges() const;
    const std::vector<std::size_t>& signature_sizes() const;
};

Methods

uint32_t add_node(const KeyframeSignature& sig)

Adds a node and its edges to earlier nodes. Returns its index.

std::vector<std::pair<uint32_t, double>> query(const KeyframeSignature& sig) const

Similarity of a signature with every node it shares content with, at least Parameters::min_similarity, sorted by node index. Does not modify the graph.

const std::vector<WeightedEdge>& edges() const

Edges (i < j), in order of insertion of node j, then by i.

const std::vector<std::size_t>& signature_sizes() const

Number of voxels in each node signature.