KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Typedefs | Enumerations | Functions
flow_feature_set.h File Reference
#include <m_cpp/m_vector.h>
#include <gr_cpp/gr_2D_bounding_box.h>
#include <set>
#include <vector>
#include <string>
#include <utility>
#include <numeric>

Go to the source code of this file.

Classes

struct  kjb::Compare_flow_features
 Functor to compare two Feature_pair. More...
 

Namespaces

 kjb
 Classes and functions for dealing with trajectory files.
 

Typedefs

typedef std::pair< float, float > kjb::Feature
 
typedef std::pair< Vector, Vector > kjb::Feature_pair
 
typedef std::set< Feature_pair,
Compare_flow_features > 
kjb::Flow_feature_set
 

Enumerations

enum  kjb::MOVE_DIRECTION { kjb::COL_PLUS, kjb::COL_MINUS, kjb::ROW_PLUS, kjb::ROW_MINUS }
 Move direction of the 2D bounding box. More...
 

Functions

Flow_feature_set kjb::read_flow_features (const std::string &fname)
 Read in the procomputed optical flow from files. More...
 
std::vector< Feature_pairkjb::look_up_features (const Flow_feature_set &of_set, const Axis_aligned_rectangle_2d &box)
 Given the features and a bounding box at the same frame, find and return the detected features inside the bounding box. More...
 
std::vector< Feature_pairkjb::look_up_bg_features (const Flow_feature_set &of_set, const std::vector< Axis_aligned_rectangle_2d > &model_boxes)
 Given the features and all the model boxes at cur_frame, find all the background features. More...
 
Vector kjb::average_flow (const std::vector< Vector > &flows)
 Calculate the average optical flow for a vector of flow Vectors. More...
 
bool kjb::compare_flow_magnitude (const Vector &f_p, const Vector &f_n)
 Compare the optical flow magnitude. More...
 
std::vector< Vectorkjb::valid_flow (const std::vector< Feature_pair > &feature_pairs, double percentile=1.0)
 Get valid features. More...
 
std::vector< Vectorkjb::valid_flow (const std::vector< Feature_pair > &feature_pairs, const std::vector< size_t > &angle_hist)
 Get valid flow features that with angle alpha in the rangle (min_angle, max_angle) More...
 
std::vector< size_t > kjb::angle_histogram (const std::vector< Feature_pair > &feature_pairs, size_t num_bins=36)
 Compute the histogram of the flow vector angles. More...
 
Vector kjb::update_average_velocity (const Flow_feature_set &of_set, const Axis_aligned_rectangle_2d &old_model_box, const Vector &old_velocity, MOVE_DIRECTION dir, size_t unit=1)
 Update the average flow velocity based on the moving direction. More...
 
Vector kjb::update_average_velocity (const Flow_feature_set &of_set, const Axis_aligned_rectangle_2d &old_box, const Axis_aligned_rectangle_2d &new_box, const Vector &old_velocity)
 Update the average model velocity. More...
 
Vector kjb::lookup_feature (const Flow_feature_set &of_set, size_t x, size_t y, size_t subsample_sz=1)
 Looks up a feature in a feature set; deals with subsampling. More...
 
Vector kjb::total_flow (const Flow_feature_set &of_set, const Axis_aligned_rectangle_2d &box)
 Compute the average flow vector inside the bounding box. More...