KJB
|
Class to manipulate a set of line segments. More...
#include <line_segment_set.h>
Public Member Functions | |
Line_segment_set () | |
Line_segment_set (const std::vector< Line_segment > &isegments) | |
Line_segment_set (std::istream &in) | |
Line_segment_set (const char *file_name) | |
Line_segment_set (const Line_segment_set &src) | |
Line_segment_set & | operator= (const Line_segment_set &iseg) |
~Line_segment_set () | |
void | read_from_Kovesi_format (const std::string path_to_file) |
void | read_from_Kovesi_formatb (const std::string path_to_file) |
const std::vector< Line_segment > & | get_segments () |
Returns a vector containing the fitted line segments. More... | |
unsigned int | size () const |
Returns the number of segments in this set. More... | |
void | add_segment (const Line_segment &isegment) |
Adds a line segment to this collection. More... | |
const Line_segment & | get_segment (unsigned int i) const |
returns the ith fitted line segment More... | |
void | draw (kjb::Image &img, double ir, double ig, double ib, double width=1.0) const |
Draws this line segment set. More... | |
void | randomly_color (kjb::Image &img, double width=1.0) const |
Randomly colors this line segment set on an image. More... | |
void | read (std::istream &in) |
Reads this Edge_segment_set from an input stream. More... | |
void | write (std::ostream &out) const |
Writes this Edge_segment_set to an output stream. More... | |
void | read (const char *fname) |
Reads this Edge_segment_set from an input file. More... | |
void | write (const char *fname) const |
Writes this Edge_segment_set to a file. More... | |
kjb::Edge_set * | convert_to_edge_set (unsigned int num_rows, unsigned int num_cols) |
void | remove_frame_segments (unsigned int num_rows, unsigned int num_cols) |
Public Member Functions inherited from kjb::Readable | |
virtual | ~Readable () |
Deletes this Readable. More... | |
Public Member Functions inherited from kjb::Writeable | |
virtual | ~Writeable () |
Deletes this Writeable. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from kjb::Readable | |
static const char * | read_field_value (std::istream &in, const char *field_name, char *field_buf, size_t buf_len, char separator=':') |
Reads a line off in into a buffer and returns a pointer to the field value in the buffer. More... | |
static const char * | read_field_value (std::istream &in, const char *field_name, char separator=':') |
Reads a line off in into an internal buffer and returns a pointer to the field value in the buffer. More... | |
Class to manipulate a set of line segments.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Adds a line segment to this collection.
kjb::Edge_set * Line_segment_set::convert_to_edge_set | ( | unsigned int | num_rows, |
unsigned int | num_cols | ||
) |
void Line_segment_set::draw | ( | kjb::Image & | img, |
double | ir, | ||
double | ig, | ||
double | ib, | ||
double | width = 1.0 |
||
) | const |
Draws this line segment set.
Draws the line segment on an image
img | the image |
ir | the red channel |
ig | the green channel |
ib | the blue channel |
width | the width of the segment to be drawn (in pixel) |
|
inline |
returns the ith fitted line segment
|
inline |
Returns a vector containing the fitted line segments.
|
inline |
void Line_segment_set::randomly_color | ( | kjb::Image & | img, |
double | width = 1.0 |
||
) | const |
Randomly colors this line segment set on an image.
Draws the line segment set using a different random color for each segment
img | the image |
width | the width of the segment to be drawn (in pixel) |
|
virtual |
Reads this Edge_segment_set from an input stream.
Read an edge segment set from an input stream. The input edge_set is necessary to bind the fitted segments to the original detected edges
edge_set | set of edges fitted to the line segments to be read |
in | the input stream to read this edge segment set from |
Implements kjb::Readable.
|
inlinevirtual |
Reads this Edge_segment_set from an input file.
Reimplemented from kjb::Readable.
void Line_segment_set::read_from_Kovesi_format | ( | const std::string | path_to_file | ) |
void Line_segment_set::read_from_Kovesi_formatb | ( | const std::string | path_to_file | ) |
void Line_segment_set::remove_frame_segments | ( | unsigned int | num_rows, |
unsigned int | num_cols | ||
) |
|
inline |
Returns the number of segments in this set.
|
virtual |
Writes this Edge_segment_set to an output stream.
Implements kjb::Writeable.
|
inlinevirtual |
Writes this Edge_segment_set to a file.
Reimplemented from kjb::Writeable.