KJB
|
#include <features_manager.h>
Public Member Functions | |
Features_manager (const kjb::Image &img, bool idetect_edges=true, bool ifit_edge_segments=true, bool icreate_manhattan_world=true) | |
Constructs a features manager. All options are set to default values All the requested features will be detected. More... | |
Features_manager (bool read_image, const std::string &img_path, bool idetect_edges=true, bool ifit_edge_segments=true, bool icreate_manhattan_world=true) | |
Constructs a features manager. All options are set to default values All the requested features will be detected. More... | |
Features_manager (kjb::Edge_set *edges, Edge_segment_set *edge_segments, Manhattan_world *manhattan_world) | |
Constructs a features manager. If one input pointer is NULL, it will be assumed that that feature is not available. More... | |
Features_manager (const kjb::Image &img, float iblurring_sigma, float ibegin_threshold, float iend_threshold, unsigned int ipadding, bool iuse_fourier, double ivanishing_point_detection_success_probability=FM_DEFAULT_VP_SUCCESS_PROBABILITY, double ioutlier_threshold_for_vanishing_points_assignment=FM_DEFAULT_VP_ASSIGNMENT_THRESHOLD, bool idetect_edges=true, bool ifit_edge_segments=true, bool icreate_manhattan_world=true) | |
Constructs a features manager. All the requested features will be detected. More... | |
Features_manager (std::istream &in) | |
Constructs a features manager by reading it from an input stream. More... | |
Features_manager (const char *filename) | |
Constructs a features manager by reading it from a file. More... | |
~Features_manager () | |
void | set_edge_detection_parameters (float iblurring_sigma, float ibegin_threshold, float iend_threshold, unsigned int ipadding, bool iuse_fourier) |
Sets the parameters needed for edge detection. More... | |
void | set_manhattan_world_parameters (double ivanishing_point_detection_success_probability, double ioutlier_threshold_for_vanishing_points_assignment) |
Sets the parameters needed to detect Manhattan world features (vanishing points for three orthogonal directions) More... | |
void | read (std::istream &in) |
Reads this Features_manager from an input stream. More... | |
void | read (const char *fname) |
Reads this Readable from a file. More... | |
void | write (std::ostream &out) const |
Writes this Features_manager to an output stream. More... | |
void | write (const char *fname) const |
Writes this Writeable to a file. More... | |
const kjb::Edge_set & | get_edges () |
Returns a pointer to the edge set if available. More... | |
const Edge_segment_set & | get_edge_segments () |
Returns a pointer to the edge segments set if available. More... | |
Manhattan_world & | get_manhattan_world () const |
Returns a pointer to Manhattan world if available. More... | |
bool | edges_available () |
Returns true if edges are available. More... | |
bool | edge_segments_available () |
Returns true if edge segments are available. More... | |
bool | manhattan_world_available () |
Returns true if Manhattan world is available. More... | |
void | set_manhattan_focal_length (double ifocal) |
void | set_manhattan_world (Manhattan_world *mw) |
double | get_outlier_threshold_for_vanishing_points_assignment () |
void | remove_frame_segments () |
void | reset_manhattan_world_vpts (const std::vector< Vanishing_point > &vpts, double focal) |
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... | |
Features_manager::Features_manager | ( | const kjb::Image & | img, |
bool | idetect_edges = true , |
||
bool | ifit_edge_segments = true , |
||
bool | icreate_manhattan_world = true |
||
) |
Constructs a features manager. All options are set to default values All the requested features will be detected.
Constructs a features manager. All options are set to default values. All the requested features will be detected
img | The image to detect features from |
idetect_edges | set it to true if you want edges to be detected |
ifit_edge_segments | set it to true if you want to fit line segments to the detected edges. It will raise an exception if no edges are available |
icreate_manhattan_world | set it to true if you want Manahttan scene features to be detected (set of three orthogonal vanishing points) |
Features_manager::Features_manager | ( | bool | read_image, |
const std::string & | img_path, | ||
bool | idetect_edges = true , |
||
bool | ifit_edge_segments = true , |
||
bool | icreate_manhattan_world = true |
||
) |
Constructs a features manager. All options are set to default values All the requested features will be detected.
Constructs a features manager. All options are set to default values. All the requested features will be detected
img_path | The path to the image to detect features from |
idetect_edges | set it to true if you want edges to be detected |
ifit_edge_segments | set it to true if you want to fit line segments to the detected edges. It will raise an exception if no edges are available |
icreate_manhattan_world | set it to true if you want Manahttan scene features to be detected (set of three orthogonal vanishing points) |
Features_manager::Features_manager | ( | kjb::Edge_set * | iedges, |
Edge_segment_set * | iedge_segments, | ||
Manhattan_world * | imanhattan_world | ||
) |
Constructs a features manager. If one input pointer is NULL, it will be assumed that that feature is not available.
Constructs a features manager. If one input pointer is NULL, it will be assumed that that feature is not available. No deep copy will be done, the memory management for the input objects will be transfered to this class
iedges | a pointer to the edges |
iedge_segments | a pointer to the edge segments |
imanhattan_world | a pointer to the Manhattan world |
Features_manager::Features_manager | ( | const kjb::Image & | img, |
float | iblurring_sigma, | ||
float | ibegin_threshold, | ||
float | iend_threshold, | ||
unsigned int | ipadding, | ||
bool | iuse_fourier, | ||
double | ivanishing_point_detection_success_probability = FM_DEFAULT_VP_SUCCESS_PROBABILITY , |
||
double | ioutlier_threshold_for_vanishing_points_assignment = FM_DEFAULT_VP_ASSIGNMENT_THRESHOLD , |
||
bool | idetect_edges = true , |
||
bool | ifit_edge_segments = true , |
||
bool | icreate_manhattan_world = true |
||
) |
Constructs a features manager. All the requested features will be detected.
Constructs a features manager. All the requested features will be detected
img | The image to detect features from * |
iblurring_sigma | Gaussian blurring sigma. Determines scale of edges to detect. |
ibegin_threshold | Starting edge threshold hysteresis in the Canny edge detection algorithm. Lower value gives more edges. |
iend_threshold | Ending edge threshold for hysteresis in the Canny edge detection algorithm. Lower value gives longer edges. |
ipadding | Amount of padding to add to images before detecting edges. Images are padded by repeating the values occurring at image boundaries. Adding padding can prevent edges detected at image boundary, but often this is set to zero (default). |
iuse_fourier | Specifies whether to use Fast Fourier transform for convolution or not |
idetect_edges | set it to true if you want edges to be detected |
ifit_edge_segments | set it to true if you want to fit line segments to the detected edges. It will raise an exception if no edges are available |
icreate_manhattan_world | set it to true if you want Manahttan scene features to be detected (set of three orthogonal vanishing points) |
ivanishing_point_detection_success_probability | The probability that Ransac will successfully detect the vanishing points |
ioutlier_threshold_for_vanishing_points_assignment | the threshold above which a line segment is considered an outlier. We try to assign each segment to a vanishing point, and if none of them gives a penalty smaller than the threshold the segment will be considered as an outlier |
|
inline |
Constructs a features manager by reading it from an input stream.
|
inline |
Constructs a features manager by reading it from a file.
|
inline |
|
inline |
Returns true if edge segments are available.
|
inline |
Returns true if edges are available.
|
inline |
Returns a pointer to the edge segments set if available.
|
inline |
Returns a pointer to the edge set if available.
|
inline |
Returns a pointer to Manhattan world if available.
|
inline |
|
inline |
Returns true if Manhattan world is available.
|
virtual |
Reads this Features_manager from an input stream.
Implements kjb::Readable.
|
inlinevirtual |
Reads this Readable from a file.
fname | Input file to read from. |
kjb::IO_error | Could not read from fname. |
kjb::Illegal_argument | Invalid arguments in the file to read from. |
Reimplemented from kjb::Readable.
void Features_manager::remove_frame_segments | ( | ) |
|
inline |
void Features_manager::set_edge_detection_parameters | ( | float | iblurring_sigma, |
float | ibegin_threshold, | ||
float | iend_threshold, | ||
unsigned int | ipadding, | ||
bool | iuse_fourier | ||
) |
Sets the parameters needed for edge detection.
Sets the parameters needed for edge detection
iblurring_sigma | Gaussian blurring sigma. Determines scale of edges to detect. |
ibegin_threshold | Starting edge threshold hysteresis in the Canny edge detection algorithm. Lower value gives more edges. |
iend_threshold | Ending edge threshold for hysteresis in the Canny edge detection algorithm. Lower value gives longer edges. |
ipadding | Amount of padding to add to images before detecting edges. Images are padded by repeating the values occurring at image boundaries. Adding padding can prevent edges detected at image boundary, but often this is set to zero (default). |
iuse_fourier | Specifies whether to use Fast Fourier transform for convolution or not |
void Features_manager::set_manhattan_focal_length | ( | double | ifocal | ) |
void Features_manager::set_manhattan_world | ( | Manhattan_world * | mw | ) |
void Features_manager::set_manhattan_world_parameters | ( | double | ivanishing_point_detection_success_probability, |
double | ioutlier_threshold_for_vanishing_points_assignment | ||
) |
Sets the parameters needed to detect Manhattan world features (vanishing points for three orthogonal directions)
Sets the parameters needed for extracting Manhattan features
ivanishing_point_detection_success_probability | The probability that Ransac will successfully detect the vanishing points |
ioutlier_threshold_for_vanishing_points_assignment | the threshold above which a line segment is considered an outlier. We try to assign each segment to a vanishing point, and if none of them gives a penalty smaller than the threshold the segment will be considered as an outlier |
|
virtual |
Writes this Features_manager to an output stream.
Writes this Features_manager to an output stream. For now it writes everything in the same file. I'll add the capability to write each feature on a different file shortly.
Implements kjb::Writeable.
|
inlinevirtual |
Writes this Writeable to a file.
fname | Output file to write to. |
kjb::IO_error | Could not write to fname. |
Reimplemented from kjb::Writeable.