Struct Edge

Struct Documentation

struct Edge

Represents an edge between adjacent pixels in the image.

The edge is encoded by the indices of the two pixels. Edge cost is proportional to the difference in local orientations.

Public Functions

Edge() = default
inline Edge(int pid0, int pid1, int cost)
inline bool operator<(const Edge &other) const

Compare edges based on cost.

Public Members

int pid0
int pid1
int cost = -1

Public Static Functions

static int EdgeCost(float theta0, float theta1, float mag1)

EdgeCost Cost of an edge between two adjacent pixels; -1 no edge An edge exists between adjacent pixels if the magnitude of the intensity gradient at both pixels is above threshold. The edge cost is propportional to the difference in the local orientation at the two pixels. Lower cost is better. A cost of -1 means there is no edge here.

Parameters:
  • theta0

  • theta1

  • mag1

Returns:

Public Static Attributes

static constexpr float kMinMag = 0.06f
static constexpr float kMaxThetaDiff = 25.f * M_PI / 180.f
static constexpr int kWeightScale = 100
static constexpr float kThetaThresh = 100
static constexpr float kMagThresh = 150