KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
kjb::Features_manager Class Reference

#include <features_manager.h>

Inheritance diagram for kjb::Features_manager:
kjb::Readable kjb::Writeable

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_setget_edges ()
 Returns a pointer to the edge set if available. More...
 
const Edge_segment_setget_edge_segments ()
 Returns a pointer to the edge segments set if available. More...
 
Manhattan_worldget_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...
 

Constructor & Destructor Documentation

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

Parameters
imgThe image to detect features from
idetect_edgesset it to true if you want edges to be detected
ifit_edge_segmentsset 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_worldset 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

Parameters
img_pathThe path to the image to detect features from
idetect_edgesset it to true if you want edges to be detected
ifit_edge_segmentsset 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_worldset 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

Parameters
iedgesa pointer to the edges
iedge_segmentsa pointer to the edge segments
imanhattan_worlda 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

Parameters
imgThe image to detect features from *
iblurring_sigmaGaussian blurring sigma. Determines scale of edges to detect.
ibegin_thresholdStarting edge threshold hysteresis in the Canny edge detection algorithm. Lower value gives more edges.
iend_thresholdEnding edge threshold for hysteresis in the Canny edge detection algorithm. Lower value gives longer edges.
ipaddingAmount 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_fourierSpecifies whether to use Fast Fourier transform for convolution or not
idetect_edgesset it to true if you want edges to be detected
ifit_edge_segmentsset 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_worldset it to true if you want Manahttan scene features to be detected (set of three orthogonal vanishing points)
ivanishing_point_detection_success_probabilityThe probability that Ransac will successfully detect the vanishing points
ioutlier_threshold_for_vanishing_points_assignmentthe 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
kjb::Features_manager::Features_manager ( std::istream &  in)
inline

Constructs a features manager by reading it from an input stream.

kjb::Features_manager::Features_manager ( const char *  filename)
inline

Constructs a features manager by reading it from a file.

kjb::Features_manager::~Features_manager ( )
inline

Member Function Documentation

bool kjb::Features_manager::edge_segments_available ( )
inline

Returns true if edge segments are available.

bool kjb::Features_manager::edges_available ( )
inline

Returns true if edges are available.

const Edge_segment_set& kjb::Features_manager::get_edge_segments ( )
inline

Returns a pointer to the edge segments set if available.

const kjb::Edge_set& kjb::Features_manager::get_edges ( )
inline

Returns a pointer to the edge set if available.

Manhattan_world& kjb::Features_manager::get_manhattan_world ( ) const
inline

Returns a pointer to Manhattan world if available.

double kjb::Features_manager::get_outlier_threshold_for_vanishing_points_assignment ( )
inline
bool kjb::Features_manager::manhattan_world_available ( )
inline

Returns true if Manhattan world is available.

void Features_manager::read ( std::istream &  in)
virtual

Reads this Features_manager from an input stream.

Implements kjb::Readable.

void kjb::Features_manager::read ( const char *  fname)
inlinevirtual

Reads this Readable from a file.

Parameters
fnameInput file to read from.
Exceptions
kjb::IO_errorCould not read from fname.
kjb::Illegal_argumentInvalid arguments in the file to read from.

Reimplemented from kjb::Readable.

void Features_manager::remove_frame_segments ( )
void kjb::Features_manager::reset_manhattan_world_vpts ( const std::vector< Vanishing_point > &  vpts,
double  focal 
)
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

Parameters
iblurring_sigmaGaussian blurring sigma. Determines scale of edges to detect.
ibegin_thresholdStarting edge threshold hysteresis in the Canny edge detection algorithm. Lower value gives more edges.
iend_thresholdEnding edge threshold for hysteresis in the Canny edge detection algorithm. Lower value gives longer edges.
ipaddingAmount 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_fourierSpecifies 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

Parameters
ivanishing_point_detection_success_probabilityThe probability that Ransac will successfully detect the vanishing points
ioutlier_threshold_for_vanishing_points_assignmentthe 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
void Features_manager::write ( std::ostream &  out) const
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.

void kjb::Features_manager::write ( const char *  fname) const
inlinevirtual

Writes this Writeable to a file.

Parameters
fnameOutput file to write to.
Exceptions
kjb::IO_errorCould not write to fname.

Reimplemented from kjb::Writeable.


The documentation for this class was generated from the following files: