Class Quad

Class Documentation

class Quad

Represents four segments that form a loop, and might be a tag.

Public Functions

Quad(const std::vector<cv::Point2f> &p)
cv::Point2f Interpolate(const cv::Point2f &p) const

interpolate Interpolate given that the lower left corner of the lower left cell is (-1, -1) and the upper right corner of the upper right cell is at (1,1)

Parameters:

p

Returns:

cv::Point2f Interpolate01(const cv::Point2f &p) const

interpolate01 Interpolate between 0~1 instead of -1~1

Parameters:

p

Returns:

code_t ToTagCode(const FloatImage &image, unsigned dimension_bits, unsigned black_border) const

Public Members

std::vector<cv::Point2f> p

p Points for the quad in pixel coordinates, in couter clockwise order. These points are the intersectiosn of segments

std::vector<Segment*> segments

segments Segments composing this quad

float obs_perimeter

obs_perimeter Total length in pixels of the acutal perimeter observed for the quad. This is in contrast to the geometric perimeter, some of which may not have been directly observed but rather inferred by tintersecting segments. Quads with more observed perimeter are preferred over others.

Public Static Functions

static void Search(std::vector<Segment*> &path, Segment &parent, int depth, std::vector<Quad> &quads)

search Searches through a vector of segments to form Quads

Parameters:
  • path

  • parent

  • depth

  • quads

Public Static Attributes

static const int kMinEdgeLength = 6

kMinEdgeLength Minimum size of a tag (in pixels) as measured along edges and diagonals

static constexpr float kMaxQuadAspectRatio = 32.0

kMaxQuadAspectRatio Early pruning of quads with insane ratios