KJB
|
#include <edge.h>
Public Member Functions | |
Edge_set () | |
Edge_set (kjb_c::Edge_set *in) | |
Constructs an Edge_set by reading it from an input stream. More... | |
Edge_set (const char *fname) | |
Constructs an Edge_set by reading it from an input file. More... | |
Edge_set (const std::string &fname) | |
Constructs an Edge_set by reading it from an input file. More... | |
Edge_set (const Edge_set &edge_in) | |
Edge_set (const std::vector< kjb_c::Edge_point > &edge_pts, int num_rows_in, int num_cols_in) | |
~Edge_set () | |
Edge_set & | operator= (const Edge_set &other) |
kjb_c::Edge_point & | operator() (size_t edge_num, size_t point_num) |
const kjb_c::Edge_point & | operator() (size_t edge_num, size_t point_num) const |
void | swap (Edge_set &other) |
Swaps the content of this edgeset with the edgeset provided in input. More... | |
kjb_c::Edge_point & | operator[] (size_t i) |
const kjb_c::Edge_point & | operator[] (size_t i) const |
size_t | num_edges () const |
size_t | size () const |
Edge | get_edge (unsigned int i) const |
returns the ith edge More... | |
void | set_edge_set (kjb_c::Edge_set *iedge_set) |
clear the previous edge set and makes this class point to the input c edge set More... | |
size_t | num_rows () const |
returns the number of rows in the image the edges were detected from More... | |
size_t | get_num_rows () const |
alias of num_rows() to comply with other KJB dimensioned objects. More... | |
size_t | num_cols () const |
returns the number of columns in the image the edges were detected from More... | |
size_t | get_num_cols () const |
alias of num_cols() to comply with other KJB dimensioned objects. More... | |
size_t | edge_length (size_t i_edge) const |
size_t | get_total_edge_points () const |
void | remove_short_edges (uint32_t min_length) |
Removes from the edge set all the edges whose length is shorter than min_length. More... | |
unsigned int | find_index (const kjb::Edge &iedge) const |
Finds the index where the Edge pointed by iedge is stored in the edge_set. Notice that this is based on pointers (the pointer address is compared, not the edge content) More... | |
void | remove_edge (unsigned int iindex) |
Removes the edge at index edge_id. More... | |
void | break_edges_at_corners (float thresh, uint32_t num_avg) |
For each edge, it finds the edge point with the largest gradient difference on either side, breaks the edge, and recurses on the two newly created edges. More... | |
void | sample_edge_set (float p) |
Randomly samples a subset of edge points from this set. More... | |
void | draw_edge (Image &img, float r, float g, float b, unsigned int edge_index) const |
draws the edge with index edge_index onto the input image, using color (r,g,b). This function expects color values between 0 and 255 More... | |
void | randomly_color_edge (Image &img, unsigned int edge_index) const |
draws the edge with index edge_index onto the input image, using a random color More... | |
void | draw (Image &img, float r, float g, float b) const |
draws all the edges onto the input image, using color (r,g,b). This function expects color values between 0 and 255 More... | |
void | randomly_color (Image &img) |
draws all the edges onto the input image, using color (r,g,b). Each edge is drawn using a different random color More... | |
void | save (const char *fname) const |
saves this edge set on a file More... | |
void | load (const char *fname) |
loads this edge set from a file More... | |
void | write (const char *fname) const |
writes this edge set to a file More... | |
void | read (const char *fname) |
reads this edge set from a file More... | |
bool | is_edge_set_consistenct () |
For debug purposes, checks that all the c++ wrappers are consistent with the underlying c structures. More... | |
const kjb_c::Edge_set * | c_ptr () const |
Returns a const pointer to the underlying c structure. More... | |
wraps the c structure Edge_set. The class will clean up the memory allocated for the underlying c structure upon destruction
|
inline |
|
inline |
Constructs an Edge_set by reading it from an input stream.
|
inline |
Constructs an Edge_set by reading it from an input file.
|
inline |
Constructs an Edge_set by reading it from an input file.
|
inline |
|
inline |
Construct an edge set from a vector of independent edge points. The result will be an edge set with a single edge, containing all the edge points.
|
inline |
|
inline |
For each edge, it finds the edge point with the largest gradient difference on either side, breaks the edge, and recurses on the two newly created edges.
edges | Edge set to break apart. |
i | The index in the edge set to recurse on. |
thresh | If the dot product of the averaged vectors is less than this threshold, the edge is broken. |
num_avg | Number of gradient vectors to average into one when computing the dot product. |
|
inline |
Returns a const pointer to the underlying c structure.
|
inline |
draws all the edges onto the input image, using color (r,g,b). This function expects color values between 0 and 255
|
inline |
draws the edge with index edge_index onto the input image, using color (r,g,b). This function expects color values between 0 and 255
|
inline |
number of edge points in edge i
|
inline |
Finds the index where the Edge pointed by iedge is stored in the edge_set. Notice that this is based on pointers (the pointer address is compared, not the edge content)
iedge | the edge to find in the edge_set |
|
inline |
returns the ith edge
|
inline |
alias of num_cols() to comply with other KJB dimensioned objects.
|
inline |
alias of num_rows() to comply with other KJB dimensioned objects.
|
inline |
total number of edge points over all edges in set
bool kjb::Edge_set::is_edge_set_consistenct | ( | ) |
For debug purposes, checks that all the c++ wrappers are consistent with the underlying c structures.
For debug purposes, checks that all the c++ wrappers are consistent with the underlying c structures
|
inline |
loads this edge set from a file
|
inline |
returns the number of columns in the image the edges were detected from
|
inline |
number of edges in set
|
inline |
returns the number of rows in the image the edges were detected from
|
inline |
Access edge points by edge index
|
inline |
Access edge points by edge index
|
inline |
Access edge points sequentially, with index 0 being the first point of the first edge
|
inline |
Access edge points sequentially, with index 0 being the first point of the first edge
|
inline |
draws all the edges onto the input image, using color (r,g,b). Each edge is drawn using a different random color
|
inline |
draws the edge with index edge_index onto the input image, using a random color
|
inline |
reads this edge set from a file
|
inline |
Removes the edge at index edge_id.
iindex | the index of the edge to remove |
|
inline |
Removes from the edge set all the edges whose length is shorter than min_length.
|
inline |
Randomly samples a subset of edge points from this set.
|
inline |
saves this edge set on a file
|
inline |
clear the previous edge set and makes this class point to the input c edge set
|
inline |
Alias of num_edges() to help comply with a random-access container concept
|
inline |
Swaps the content of this edgeset with the edgeset provided in input.
|
inline |
writes this edge set to a file