21 #ifndef KJB_FLOW_FEATURE_SET_H
22 #define KJB_FLOW_FEATURE_SET_H
52 return feature_pair_1.first < feature_pair_2.first;
63 const std::string& fname
83 const std::vector<Axis_aligned_rectangle_2d>& model_boxes
93 const std::vector<Vector>& flows
100 ave_flow = total_flow/flows.
size();
121 const std::vector<Feature_pair>& feature_pairs,
122 double percentile = 1.0
132 const std::vector<Feature_pair>& feature_pairs,
133 const std::vector<size_t>& angle_hist
139 const std::vector<Feature_pair>& feature_pairs,
150 const Axis_aligned_rectangle_2d& old_model_box,
151 const Vector& old_velocity,
163 const Axis_aligned_rectangle_2d& old_box,
164 const Axis_aligned_rectangle_2d& new_box,
165 const Vector& old_velocity
174 size_t subsample_sz = 1
183 const Axis_aligned_rectangle_2d& box
std::vector< Feature_pair > 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.
Definition: flow_feature_set.cpp:127
size_type size() const
Alias to get_length(). Required to comply with stl Container concept.
Definition: m_vector.h:510
Class that represents an axis-aligned 2D rectangle. It is defined in terms of its (2D) center...
Definition: gr_2D_bounding_box.h:51
double accumulate(const Matrix_d< R, C, T > &mat, double init)
Definition: m_matrix_d.impl.h:432
Definition: flow_feature_set.h:37
std::vector< size_t > angle_histogram(const std::vector< Feature_pair > &feature_pairs, size_t num_bins=36)
Compute the histogram of the flow vector angles.
Definition: flow_feature_set.cpp:241
Definition: flow_feature_set.h:37
std::set< Feature_pair, Compare_flow_features > Flow_feature_set
Definition: flow_feature_set.h:56
Definition: flow_feature_set.h:37
This class implements vectors, in the linear-algebra sense, with real-valued elements.
Definition: m_vector.h:87
std::vector< Feature_pair > 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...
Definition: flow_feature_set.cpp:80
bool compare_flow_magnitude(const Vector &f_p, const Vector &f_n)
Compare the optical flow magnitude.
Definition: flow_feature_set.h:110
Vector 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.
Definition: flow_feature_set.cpp:598
Vector total_flow(const Flow_feature_set &of_set, const Axis_aligned_rectangle_2d &box)
Compute the average flow vector inside the bounding box.
Definition: flow_feature_set.cpp:700
x
Definition: APPgetLargeConnectedEdges.m:100
MOVE_DIRECTION
Move direction of the 2D bounding box.
Definition: flow_feature_set.h:37
Value_type magnitude() const
Return this vector's magnitude.
Definition: m_vector.h:1490
Definition: flow_feature_set.h:37
std::pair< Vector, Vector > Feature_pair
Definition: flow_feature_set.h:40
Vector 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.
Definition: flow_feature_set.cpp:269
Class representing an axis-aligned, 2D rectangle.
std::vector< Vector > valid_flow(const std::vector< Feature_pair > &feature_pairs, double percentile=1.0)
Get valid features.
Definition: flow_feature_set.cpp:172
Functor to compare two Feature_pair.
Definition: flow_feature_set.h:43
Vector average_flow(const Matrix &x_flows, const Matrix &y_flows, const Axis_aligned_rectangle_2d &roi)
Get the average optical flow inside a rectangle region.
Definition: flow_dense.cpp:30
Definition for the Vector class, a thin wrapper on the KJB Vector struct and its related functionalit...
Flow_feature_set read_flow_features(const std::string &fname)
Read in the procomputed optical flow from files.
Definition: flow_feature_set.cpp:41
std::pair< float, float > Feature
Definition: flow_feature_set.h:39