KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
kjb::psi Namespace Reference

Namespaces

 metrics
 

Classes

struct  Action
 
struct  Action_descriptor
 
class  Entity_state
 
class  Simple_simulator
 
class  Deva_skeleton_boxes
 
class  File_format_exception
 
class  Bbox_pairwise_likelihood
 
class  Bbox_noise_likelihood
 
class  Frame_likelihood
 
class  Model_evaluator
 
class  Cylinder_world_likelihood
 
class  Track_frame_metrics
 
class  Track_metrics
 
struct  Model
 
struct  Person_flow_blob
 A class represent the blob detection based on the optical flow magnitude images. More...
 
struct  Progress_recorder
 
class  Psi_step_size
 
struct  Psi_body_part
 Body parts. More...
 
class  Psi_skeleton
 Skeleton class, a vector of body parts. More...
 
class  Skeleton_detection
 Skeleton class, a vector of body parts. More...
 
struct  Start_state
 
class  Cuboid
 
struct  Weighted_box
 

Typedefs

typedef Axis_aligned_rectangle_2d Bbox
 
typedef boost::bimap
< Body_part_entity,
std::string > 
Body_part_map
 
typedef Body_part_map::value_type Body_part_map_entry
 

Enumerations

enum  Action_type {
  NULL_ACTION, WALK_ACTION, WALK_IN_ARC_ACTION, WALK_THROUGH_POINTS_ACTION,
  FOLLOW_ACTION
}
 
enum  Body_part_entity {
  BODY, HEAD, CHEST, LEFT_ELBOW,
  LEFT_HAND, LEFT_KNEE, LEFT_FOOT, RIGHT_ELBOW,
  RIGHT_HAND, RIGHT_KNEE, RIGHT_FOOT
}
 
enum  Unit_type {
  UNKNOWN_UNIT, SPACIAL_UNIT, VSPACIAL_UNIT, ASPACIAL_UNIT,
  ANGLE_UNIT, VANGLE_UNIT, AANGLE_UNIT, TIME_UNIT,
  MASS_UNIT, LENGTH_UNIT, DISCRETE_UNIT, OTHER_UNIT
}
 
enum  Simulator_type { CARTWHEEL_SIMULATOR, CYLINDER_SIMULATOR }
 

Functions

void validate (Action_type a)
 check that action_type represents an actual descriptor. More...
 
std::istream & read_action_v0 (std::istream &ist, Action &action)
 
const std::string & get_name (Action_type t)
 Convert Action_type to string. More...
 
Action_type action_name_to_type (const std::string &name)
 Convert string to Action_type. More...
 
double get_action_duration (const Action &action)
 
Action make_walk_through_points_action (const std::vector< std::vector< double > > &points)
 Construct a walk along the trajectory specified by the points. More...
 
void validate (const Action &a)
 Check that an action is consistent (correct number of parameters, etc) More...
 
Unit_type get_units (Action_type a, size_t i)
 
std::ostream & operator<< (std::ostream &ost, const Action &action)
 serialize an action More...
 
std::istream & operator>> (std::istream &ist, Action &action)
 unserialize an action More...
 
Action parse_cli_action (const std::string &str)
 read an action that is specified using command-line-interface format More...
 
Action make_follow_action (double duration, size_t parent_type, size_t parent_index, double time_behind)
 
Action make_walk_action (double duration, double speed)
 Construct a walk action. More...
 
Action make_walk_in_arc_action (double duration, double speed, double angular_speed)
 Construct a walk-in-arc action. More...
 
Action make_null_action (double duration)
 Construct a null action. More...
 
size_t get_num_waypoints (size_t param_size)
 Get the number of waypoints from the size of the parameters parameters is in size of 3*num_waypoints+1. More...
 
size_t to_x_index (size_t i)
 Get the x index of the i'th point. More...
 
size_t to_z_index (size_t i)
 Get the z index of the i'th point. More...
 
size_t to_time_index (size_t i)
 Get the time point index of the i'th point. More...
 
void compute_median_background (const Video &video, Matrix &s_mat, Matrix &r_mat, Matrix &g_mat, size_t rate=1)
 Compute the background using the median value. More...
 
void compute_median_background (const Video &video, const pt::Box_trajectory_map &btrajs, Matrix &s_mat, Matrix &s_count, Matrix &r_mat, Matrix &r_count, Matrix &g_mat, Matrix &g_count)
 Compute the background using median value after excluding the regions where there are tracks. More...
 
void append_cylinder_capsule_keypoints (const kjb::Vector &center1, const kjb::Vector &center2, double radius, bool capsule, std::vector< kjb::Vector > &result, size_t points_on_circle, double scale_long=1.0, double angle_short=0.0)
 
void append_cylinder_keypoints (const kjb::Cylinder &cylinder, std::vector< kjb::Vector > &result, size_t points_on_circle, double scale_long=1.0, double angle_short=0.0)
 
void append_capsule_keypoints (const kjb::Vector &center1, const kjb::Vector &center2, double radius, std::vector< kjb::Vector > &result, size_t points_on_circle)
 
std::vector< kjb::Vectorcylinder_to_3d_points (const kjb::Cylinder &cylinder, double scale_long, double angle_short)
 
Bbox get_bounding_box (const std::vector< kjb::Vector > &points_3d, const kjb::Perspective_camera &cam)
 
std::vector< Bboxget_bounding_boxes (const std::vector< kjb::Cylinder > &cylinders, const kjb::Perspective_camera &cam)
 
kjb::Color_histogram compute_color_histogram_from_box (const Bbox &box, const kjb::Image &img, unsigned int num_bins)
 
std::vector< kjb::Vectorbox_to_3d_points (const Cuboid &box)
 
Bbox get_bounding_box (const kjb::Cylinder &cylinder, const kjb::Perspective_camera &cam, double scale_long=1.0, double angle_short=0.0)
 
Bbox get_bounding_box (const Cuboid box, const kjb::Perspective_camera &cam)
 
kjb::Vector project_point (const kjb::Perspective_camera &cam, const kjb::Vector &x)
 
Bbox get_bounding_box (const Entity_state &entity, const kjb::Perspective_camera &cam)
 
std::vector< Deva_skeleton_boxesparse_deva_skeletons (std::istream &is)
 
std::vector< std::vector
< Deva_skeleton_boxes > > 
parse_deva_skeleton_tracks (std::istream &is, size_t num_frames)
 
void standardize (Deva_skeleton_boxes &boxes, double cam_width, double cam_height)
 move coordinate ssystem origin to center of image More...
 
Bbox estimate_body_box (const Bbox &face_box, bool standardized=true)
 Create a body bounding box based on the detected face box. More...
 
Matrix create_gaze_cone_pts (double height, double radius, const Vector &location, double pitch, double yaw, double roll, const Perspective_camera &camera)
 Create a cone whose tip is at the location, and the direction of the tip is specified by directio. More...
 
Matrix create_body_part_cone_pts (double cone_length, const Bbox &part_box, const Perspective_camera &camera)
 Create a cone for the body parts specified by the body_box and the direction of the tip is specified by direction. More...
 
Matrix create_cylinder_pts (double radius, double height, const Vector &location)
 Create a cylinder for the body and return the points on the cylinder. More...
 
bool get_corresponding_entity (const Bbox &face_box, const pt::Box_trajectory_map &trajectories, pt::Entity_id &entity_id, size_t index, double overlapping_threshold=0.4)
 Get the corresponding person based on the location of the face. More...
 
bool get_corresponding_body_box (const Bbox &face_box, Bbox &corr_body_box, const std::vector< Bbox > &body_boxes, double overlapping_threshold=0.4)
 Find the corresponding person box based on the location of the face. More...
 
bool get_corresponding_face (const std::vector< Face_detection > &faces, const Bbox &body_box, Face_detection &matched_face, double overlapping_threshold=0.4)
 Get the corresponding face based on the location of the body box. More...
 
bool face_inside_body_box (const Face_detection &face, const Bbox &body_box, double face_area_threshold=0.7, double body_area_threshold=0.07)
 Check if the face box belongs to the body bounding box Note: the Face_detection face_box is in image coordinate Assume the body_box is also in image coordiantes. More...
 
void standardize_face_boxes (std::vector< Face_detection > &faces, double image_width, double image_height)
 Standardize face boxes. More...
 
void draw_hull (const Matrix &hull_pts, const Matrix &camera_matrix, double win_width, double win_height, Image &image, const Image::Pixel_type &vertex_pix, const Image::Pixel_type &facet_pix)
 Draw hull for debugging purposes. More...
 
void draw_standardized_face_box (const Face_detection &fd, Image &img, Image::Pixel_type pixel, int line_width)
 
double lfactorial (int n)
 Compute log(n!) More...
 
double get_depth (const Vector &pt, const Perspective_camera &cam)
 
std::vector< Bboxsort_by_depth (std::vector< std::pair< double, Bbox > > &boxes)
 
std::istream & read_model (std::istream &ist, size_t version, Model &m)
 
std::istream & read_model_v0 (std::istream &ist, Model &m)
 
std::istream & read_model_v1 (std::istream &ist, Model &m)
 
std::istream & read_model_v2 (std::istream &ist, Model &m)
 
std::istream & read_model_v3 (std::istream &ist, Model &m)
 
std::istream & read_model_v4 (std::istream &ist, Model &m)
 
std::ostream & operator<< (std::ostream &ost, const Model &m)
 
std::istream & operator>> (std::istream &ist, Model &m)
 
const std::vector< std::vector
< Start_state > > & 
to_start_state (const Model &m)
 
const std::vector< std::vector
< std::vector< Action > > > & 
to_actions (const Model &m)
 Construct cartwheel actions from. More...
 
double model_prior (const Model &m)
 
const std::vector< Weighted_boxto_boxes (const Model &m)
 
Person_flow_blob parse_person_blob (const std::string &line)
 Parse the optical flow blob. More...
 
std::vector< Person_flow_blobparse_person_blobs (const std::string &fname)
 
void update_model_parameter (Model &m, int dimension, double delta)
 
size_t get_model_dimension (const Model &m)
 
double get_model_parameter (const Model &m, size_t i)
 
kjb::Vector get_model_upper_bounds (const Model &m)
 
kjb::Vector get_model_lower_bounds (const Model &m)
 
std::ostream & operator<< (std::ostream &out, const Psi_skeleton &skeleton)
 read in Psi_body_part from stream More...
 
std::vector< Psi_skeletonparse_skeleton (std::istream &ist)
 read skeleton from stream More...
 
std::ostream & operator<< (std::ostream &ost, const Psi_body_part &part)
 writes part into out stream More...
 
std::vector< Skeleton_detectionparse_skeleton_detection (std::istream &ist)
 
std::ostream & operator<< (std::ostream &ost, const Skeleton_detection &skeleton)
 writes part into out stream More...
 
std::ostream & operator<< (std::ostream &ost, const Start_state &start_state)
 
std::istream & operator>> (std::istream &ist, Start_state &start_state)
 
Start_state parse_cli_start_state (const std::string &str)
 
const std::string & get_name (Simulator_type type)
 
std::istream & operator>> (std::istream &ist, Simulator_type &type)
 
std::ostream & operator<< (std::ostream &ost, Simulator_type type)
 
void standardize (Deva_detection &boxes, double cam_width, double cam_height)
 move coordinate ssystem origin to center of image More...
 
void prune_by_height (std::vector< Deva_detection > &deva_boxes, double screen_width, double screen_height, const Perspective_camera &camera, double avereage_height)
 Prune the deva boxes based on the average entity height. More...
 
kjb::Perspective_camera make_camera (double height, double tilt, double focal_length)
 
Vector project_and_unstandarize (const Vector &x, const Matrix &P, double w, double h)
 Project the 3D point x to image coordinate using camera matrix P and make the top left as the origin. More...
 
void render_ground_plane ()
 
std::vector< Vectorget_corners (const Cuboid &c)
 
void render (const Cuboid &c)
 
std::ostream & operator<< (std::ostream &ost, const Weighted_box &box)
 
std::istream & operator>> (std::istream &ist, Weighted_box &box)
 
Weighted_box parse_cli_weighted_box (const std::string &line)
 

Variables

const std::vector
< Action_descriptor
action_descriptors
 
const double AVG_HUMAN_HEIGHT = 1.778
 
const double AVG_HUMAN_WIDTH = 0.61
 
const Body_part_map body_part_map
 
std::map< std::string,
Simulator_type
simulator_name_map
 

Typedef Documentation

typedef boost::bimap<Body_part_entity, std::string> kjb::psi::Body_part_map
typedef Body_part_map::value_type kjb::psi::Body_part_map_entry

Enumeration Type Documentation

Action representation.

The design implemented here is somewhat of an experiment. It's basically object oriented code written in the style of C. The motivation for this is as follows:

(a) All actions need to be handled by a uniform way through a single type (b) We'll never need interact with a single specific type of action, so having sub-classes for each action will largely be unused. (c) We'd like to add new actions without needing to create new classes for them (d) We need to know the type of action at run-time, and prefer to avoid the inelegance of using dynamic_cast and typeid().

State is represented by structs, polymorphism is implemented using a type index, and objects are constructed by calling non-member functions. However, we still leverage useful features of C++, like function overloading, pass-by-const-reference, return-by-value, etc.

The overall design could be pushed more toward an object-oriented interface in the future, but I'm curious to see what pitfalls (if any) strike us by using a more C-style interface. Object oriented coding can add unwanted complexity, and I've heard anecdotes extoling the virtues of a more C-style approach inside C++ code. I have a theory that the overall programmer experience will be improved by using a less sophisticated interface... we'll see.

Enumerator
NULL_ACTION 
WALK_ACTION 
WALK_IN_ARC_ACTION 
WALK_THROUGH_POINTS_ACTION 
FOLLOW_ACTION 
Enumerator
BODY 
HEAD 
CHEST 
LEFT_ELBOW 
LEFT_HAND 
LEFT_KNEE 
LEFT_FOOT 
RIGHT_ELBOW 
RIGHT_HAND 
RIGHT_KNEE 
RIGHT_FOOT 
Enumerator
CARTWHEEL_SIMULATOR 
CYLINDER_SIMULATOR 
Enumerator
UNKNOWN_UNIT 
SPACIAL_UNIT 
VSPACIAL_UNIT 
ASPACIAL_UNIT 
ANGLE_UNIT 
VANGLE_UNIT 
AANGLE_UNIT 
TIME_UNIT 
MASS_UNIT 
LENGTH_UNIT 
DISCRETE_UNIT 
OTHER_UNIT 

Function Documentation

Action_type kjb::psi::action_name_to_type ( const std::string &  name)

Convert string to Action_type.

void kjb::psi::append_capsule_keypoints ( const kjb::Vector center1,
const kjb::Vector center2,
double  radius,
std::vector< kjb::Vector > &  result,
size_t  points_on_circle 
)
inline
void kjb::psi::append_cylinder_capsule_keypoints ( const kjb::Vector center1,
const kjb::Vector center2,
double  radius,
bool  capsule,
std::vector< kjb::Vector > &  result,
size_t  points_on_circle,
double  scale_long = 1.0,
double  angle_short = 0.0 
)
Parameters
capsuleIf false, treat this like a cylinder
void kjb::psi::append_cylinder_keypoints ( const kjb::Cylinder cylinder,
std::vector< kjb::Vector > &  result,
size_t  points_on_circle,
double  scale_long = 1.0,
double  angle_short = 0.0 
)
inline
std::vector<kjb::Vector> kjb::psi::box_to_3d_points ( const Cuboid &  box)
inline
kjb::Color_histogram kjb::psi::compute_color_histogram_from_box ( const Bbox &  box,
const kjb::Image img,
unsigned int  num_bins 
)
void kjb::psi::compute_median_background ( const Video &  video,
Matrix &  s_mat,
Matrix &  r_mat,
Matrix &  g_mat,
size_t  rate 
)

Compute the background using the median value.

void kjb::psi::compute_median_background ( const Video &  video,
const pt::Box_trajectory_map &  btrajs,
Matrix &  s_mat,
Matrix &  s_count,
Matrix &  r_mat,
Matrix &  r_count,
Matrix &  g_mat,
Matrix &  g_count 
)

Compute the background using median value after excluding the regions where there are tracks.

Matrix kjb::psi::create_body_part_cone_pts ( double  cone_length,
const Bbox &  part_box,
const Perspective_camera &  camera 
)
inline

Create a cone for the body parts specified by the body_box and the direction of the tip is specified by direction.

Matrix kjb::psi::create_cylinder_pts ( double  radius,
double  height,
const Vector location 
)

Create a cylinder for the body and return the points on the cylinder.

Matrix kjb::psi::create_gaze_cone_pts ( double  height,
double  radius,
const Vector location,
double  pitch,
double  yaw,
double  roll,
const Perspective_camera camera 
)

Create a cone whose tip is at the location, and the direction of the tip is specified by directio.

std::vector< kjb::Vector > kjb::psi::cylinder_to_3d_points ( const kjb::Cylinder cylinder,
double  scale_long,
double  angle_short 
)
void kjb::psi::draw_hull ( const Matrix hull_pts,
const Matrix camera_matrix,
double  win_width,
double  win_height,
Image image,
const Image::Pixel_type vertex_pix,
const Image::Pixel_type facet_pix 
)

Draw hull for debugging purposes.

void kjb::psi::draw_standardized_face_box ( const Face_detection &  fd,
Image &  img,
Image::Pixel_type  pixel,
int  line_width 
)
inline

Draw face box

Bbox kjb::psi::estimate_body_box ( const Bbox face_box,
bool  standardized = true 
)

Create a body bounding box based on the detected face box.

bool kjb::psi::face_inside_body_box ( const Face_detection face,
const Bbox body_box,
double  face_area_threshold = 0.7,
double  body_area_threshold = 0.07 
)

Check if the face box belongs to the body bounding box Note: the Face_detection face_box is in image coordinate Assume the body_box is also in image coordiantes.

double kjb::psi::get_action_duration ( const Action &  action)
Bbox kjb::psi::get_bounding_box ( const kjb::Cylinder cylinder,
const kjb::Perspective_camera cam,
double  scale_long = 1.0,
double  angle_short = 0.0 
)
inline
Bbox kjb::psi::get_bounding_box ( const Cuboid  box,
const kjb::Perspective_camera cam 
)
inline
Bbox kjb::psi::get_bounding_box ( const Entity_state &  entity,
const kjb::Perspective_camera cam 
)
inline
Bbox kjb::psi::get_bounding_box ( const std::vector< kjb::Vector > &  points_3d,
const kjb::Perspective_camera cam 
)
std::vector< Bbox > kjb::psi::get_bounding_boxes ( const std::vector< kjb::Cylinder > &  cylinders,
const kjb::Perspective_camera cam 
)
std::vector< Vector > kjb::psi::get_corners ( const Cuboid &  c)
bool kjb::psi::get_corresponding_body_box ( const Bbox face_box,
Bbox corr_body_box,
const std::vector< Bbox > &  body_boxes,
double  overlapping_threshold = 0.4 
)

Find the corresponding person box based on the location of the face.

bool kjb::psi::get_corresponding_entity ( const Bbox face_box,
const pt::Box_trajectory_map trajectories,
pt::Entity_id &  entity_id,
size_t  index,
double  overlapping_threshold = 0.4 
)

Get the corresponding person based on the location of the face.

bool kjb::psi::get_corresponding_face ( const std::vector< Face_detection > &  faces,
const Bbox body_box,
Face_detection matched_face,
double  overlapping_threshold = 0.4 
)

Get the corresponding face based on the location of the body box.

double kjb::psi::get_depth ( const Vector &  pt,
const Perspective_camera &  cam 
)
inline

Get the depth of a point from the camera.

Parameters
ptPoint in world coordinates
camCamera representing the viewpoint
size_t kjb::psi::get_model_dimension ( const Model &  m)
inline
kjb::Vector kjb::psi::get_model_lower_bounds ( const Model &  m)
inline
double kjb::psi::get_model_parameter ( const Model &  m,
size_t  i 
)
inline
kjb::Vector kjb::psi::get_model_upper_bounds ( const Model &  m)
inline
const std::string & kjb::psi::get_name ( Simulator_type  type)
const std::string & kjb::psi::get_name ( Action_type  t)

Convert Action_type to string.

size_t kjb::psi::get_num_waypoints ( size_t  param_size)
inline

Get the number of waypoints from the size of the parameters parameters is in size of 3*num_waypoints+1.

Unit_type kjb::psi::get_units ( Action_type  a,
size_t  i 
)
double kjb::psi::lfactorial ( int  n)

Compute log(n!)

kjb::Perspective_camera kjb::psi::make_camera ( double  height,
double  tilt,
double  focal_length 
)
inline

/\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\

Action kjb::psi::make_follow_action ( double  duration,
size_t  parent_type,
size_t  parent_index,
double  time_behind 
)
inline

Construct a follow action

Parameters
walkerthe actor to be followed
time_behindthe distance behind the actor
Action kjb::psi::make_null_action ( double  duration)
inline

Construct a null action.

Action kjb::psi::make_walk_action ( double  duration,
double  speed 
)
inline

Construct a walk action.

Action kjb::psi::make_walk_in_arc_action ( double  duration,
double  speed,
double  angular_speed 
)
inline

Construct a walk-in-arc action.

Action kjb::psi::make_walk_through_points_action ( const std::vector< std::vector< double > > &  points)

Construct a walk along the trajectory specified by the points.

double kjb::psi::model_prior ( const Model &  m)

Currently an improper uniform distribution, with zero probability for durations < 0.

std::ostream & kjb::psi::operator<< ( std::ostream &  out,
const Psi_skeleton &  skeleton 
)

read in Psi_body_part from stream

writes skeleton into out stream

std::ostream& kjb::psi::operator<< ( std::ostream &  ost,
const Skeleton_detection &  skeleton 
)
inline

writes part into out stream

std::ostream& kjb::psi::operator<< ( std::ostream &  ost,
const Start_state &  start_state 
)
inline
std::ostream & kjb::psi::operator<< ( std::ostream &  ost,
Simulator_type  type 
)
std::ostream& kjb::psi::operator<< ( std::ostream &  ost,
const Psi_body_part &  part 
)
inline

writes part into out stream

std::ostream& kjb::psi::operator<< ( std::ostream &  ost,
const Weighted_box &  box 
)
inline
std::ostream & kjb::psi::operator<< ( std::ostream &  ost,
const Model &  m 
)
std::ostream & kjb::psi::operator<< ( std::ostream &  ost,
const Action &  action 
)

serialize an action

std::istream& kjb::psi::operator>> ( std::istream &  ist,
Start_state &  start_state 
)
inline
std::istream & kjb::psi::operator>> ( std::istream &  ist,
Simulator_type &  type 
)
std::istream& kjb::psi::operator>> ( std::istream &  ist,
Weighted_box &  box 
)
inline
std::istream & kjb::psi::operator>> ( std::istream &  ist,
Model &  m 
)
std::istream & kjb::psi::operator>> ( std::istream &  ist,
Action &  action 
)

unserialize an action

Action kjb::psi::parse_cli_action ( const std::string &  str)

read an action that is specified using command-line-interface format

similar format to reading from istream, except num-parameters is not explicitly specified, but is implied from token count, making hand-writing easy, but parsing slightly harder.

e.g.: "WALK_ACTION 5 0.5" would construct a walk action with duration 5 and speed 0.5

Start_state kjb::psi::parse_cli_start_state ( const std::string &  str)
inline
Weighted_box kjb::psi::parse_cli_weighted_box ( const std::string &  line)
inline
std::vector< std::vector< Deva_skeleton_boxes > > kjb::psi::parse_deva_skeleton_tracks ( std::istream &  is,
size_t  num_frames 
)

Parse the output from Deva skeleton tracks into a vector of vector of Deva_skeleton_boxes.

std::vector< Deva_skeleton_boxes > kjb::psi::parse_deva_skeletons ( std::istream &  is)

Parse the output from Deva skeleton detectors into a vector of Deva_skeleton_boxes.

Person_flow_blob kjb::psi::parse_person_blob ( const std::string &  line)

Parse the optical flow blob.

/\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\

std::vector< Person_flow_blob > kjb::psi::parse_person_blobs ( const std::string &  fname)

/\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\

std::vector< Psi_skeleton > kjb::psi::parse_skeleton ( std::istream &  ist)

read skeleton from stream

std::vector< Skeleton_detection > kjb::psi::parse_skeleton_detection ( std::istream &  ist)
Vector kjb::psi::project_and_unstandarize ( const Vector &  x,
const Matrix &  P,
double  w,
double  h 
)
inline

Project the 3D point x to image coordinate using camera matrix P and make the top left as the origin.

kjb::Vector kjb::psi::project_point ( const kjb::Perspective_camera cam,
const kjb::Vector x 
)
inline
void kjb::psi::prune_by_height ( std::vector< Deva_detection > &  deva_boxes,
double  screen_width,
double  screen_height,
const Perspective_camera &  camera,
double  average_height 
)

Prune the deva boxes based on the average entity height.

std::istream & kjb::psi::read_action_v0 ( std::istream &  ist,
Action &  action 
)
std::istream & kjb::psi::read_model ( std::istream &  ist,
size_t  version,
Model &  m 
)
std::istream & kjb::psi::read_model_v0 ( std::istream &  ist,
Model &  m 
)
std::istream & kjb::psi::read_model_v1 ( std::istream &  ist,
Model &  m 
)
std::istream & kjb::psi::read_model_v2 ( std::istream &  ist,
Model &  m 
)
std::istream & kjb::psi::read_model_v3 ( std::istream &  ist,
Model &  m 
)
std::istream & kjb::psi::read_model_v4 ( std::istream &  ist,
Model &  m 
)
void kjb::psi::render ( const Cuboid &  c)
void kjb::psi::render_ground_plane ( )
std::vector< Bbox > kjb::psi::sort_by_depth ( std::vector< std::pair< double, Bbox > > &  boxes)
inline
void kjb::psi::standardize ( Deva_detection &  boxes,
double  cam_width,
double  cam_height 
)

move coordinate ssystem origin to center of image

void kjb::psi::standardize ( Deva_skeleton_boxes &  boxes,
double  cam_width,
double  cam_height 
)

move coordinate ssystem origin to center of image

void kjb::psi::standardize_face_boxes ( std::vector< Face_detection > &  faces,
double  image_width,
double  image_height 
)

Standardize face boxes.

const std::vector< std::vector< std::vector< Action > > > & kjb::psi::to_actions ( const Model &  m)

Construct cartwheel actions from.

const std::vector<Weighted_box> kjb::psi::to_boxes ( const Model &  m)
const std::vector< std::vector< Start_state > > & kjb::psi::to_start_state ( const Model &  m)
size_t kjb::psi::to_time_index ( size_t  i)
inline

Get the time point index of the i'th point.

size_t kjb::psi::to_x_index ( size_t  i)
inline

Get the x index of the i'th point.

size_t kjb::psi::to_z_index ( size_t  i)
inline

Get the z index of the i'th point.

void kjb::psi::update_model_parameter ( Model &  m,
int  dimension,
double  delta 
)
inline
void kjb::psi::validate ( Action_type  a)

check that action_type represents an actual descriptor.

void kjb::psi::validate ( const Action &  a)

Check that an action is consistent (correct number of parameters, etc)

Variable Documentation

const std::vector<Action_descriptor> kjb::psi::action_descriptors

The following array contains metadata for all action types. Creating a new action consists of (a) adding a new name to the Action_type enum, and (b) creating a new entry to this array.

Most functions that follow rely on this structure to get the necessary information.

const double kjb::psi::AVG_HUMAN_HEIGHT = 1.778
const double kjb::psi::AVG_HUMAN_WIDTH = 0.61
const Body_part_map kjb::psi::body_part_map
Initial value:
= boost::assign::list_of
Definition: psi_skeleton.h:41
Body_part_map::value_type Body_part_map_entry
Definition: psi_skeleton.cpp:34
Definition: psi_skeleton.h:41
Definition: psi_skeleton.h:41
Definition: psi_skeleton.h:41
Definition: psi_skeleton.h:41
Definition: psi_skeleton.h:41
Definition: psi_skeleton.h:41
Definition: psi_skeleton.h:41
Definition: psi_skeleton.h:41
Definition: psi_skeleton.h:41
Definition: psi_skeleton.h:41
std::map<std::string, Simulator_type> kjb::psi::simulator_name_map
Initial value:
= boost::assign::map_list_of
(static_cast<std::string>("cartwheel"), CARTWHEEL_SIMULATOR)
("cylinder", CYLINDER_SIMULATOR)
Definition: psi_util.h:122
Definition: psi_util.h:122