Bratmobile
Classes | Typedefs | Functions
sensor.h File Reference

Given points, makes rotated bounding box. More...

#include "brat_math.h"
Include dependency graph for sensor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Pointf
 Wrapper around cv::Point2f for customisation purposes. More...
 
struct  cv::traits::Depth< Pointf >
 
struct  cv::traits::Type< Pointf >
 

Typedefs

typedef std::set< PointfCoordinateContainer
 container for LIDAR coordinates
 

Functions

float length (cv::Point2f const &p)
 
float angle (cv::Point2f const &)
 
bool operator< (Pointf const &, Pointf const &)
 
bool operator> (const Pointf &, const Pointf &)
 
b2Vec2 getb2Vec2 (cv::Point2f)
 Gets an opencv point in b2VEc2 format. More...
 
template<typename T >
Pointf getPointf (T v)
 Get the Pointf object from a 2d point/vector. More...
 
Pointf Polar2f (float radius, float angle)
 Gets Pointf from polar coordinates. More...
 
template<typename T >
std::vector< T > set2vec (std::set< T > s)
 Casts a set to vector. More...
 
template<typename T >
std::vector< cv::Point2f > set2vec2f (std::set< T > s)
 Casts a set of 2d points/vectors to a vector of cv::Point2f. More...
 
template<typename T >
std::vector< b2Vec2 > cast_b2Vec2 (const std::vector< T > &v)
 Casts a vector of 2d points to a vector of box2d b2Vec2. More...
 
template<typename T >
std::vector< cv::Point2f > cast_Point2f (const std::vector< T > &v)
 Casts a vector of 2d points to a vector of cv::Point2f. More...
 
template<typename T >
std::set< T > vec2set (std::vector< T > vec)
 Casts a vector to set. More...
 
std::pair< bool, BodyFeaturesbounding_rotated_box (std::vector< cv::Point2f >nb)
 
template<class Pt >
std::pair< bool, BodyFeaturesbounding_box (std::vector< Pt > &nb)
 Makes an upright bounding box around points. More...
 

Detailed Description

Given points, makes rotated bounding box.

Parameters
nbpoints
Returns
std::pair <bool, BodyFeatures> : <are features valid?, features>

Function Documentation

◆ bounding_box()

template<class Pt >
std::pair<bool,BodyFeatures> bounding_box ( std::vector< Pt > &  nb)

Makes an upright bounding box around points.

Template Parameters
Pttemplate for point (Box2D, OpenCV or similar)
Parameters
nbpoints
Returns
std::pair<bool,BodyFeatures> (is the object valid, object)

◆ cast_b2Vec2()

template<typename T >
std::vector<b2Vec2> cast_b2Vec2 ( const std::vector< T > &  v)
inline

Casts a vector of 2d points to a vector of box2d b2Vec2.

Template Parameters
T2d point/2d vector
Parameters
v2d point or vector
Returns
std::vector<b2Vec2>

◆ cast_Point2f()

template<typename T >
std::vector<cv::Point2f> cast_Point2f ( const std::vector< T > &  v)
inline

Casts a vector of 2d points to a vector of cv::Point2f.

Template Parameters
T2d point/2d vector
Parameters
v2d point or vector
Returns
std::vector<b2Vec2>

◆ getb2Vec2()

b2Vec2 getb2Vec2 ( cv::Point2f  p)

Gets an opencv point in b2VEc2 format.

Returns
b2Vec2

◆ getPointf()

template<typename T >
Pointf getPointf ( v)

Get the Pointf object from a 2d point/vector.

Template Parameters
T
Parameters
v
Returns
Pointf

◆ Polar2f()

Pointf Polar2f ( float  radius,
float  angle 
)

Gets Pointf from polar coordinates.

Parameters
radius
angle
Returns
Pointf

◆ set2vec()

template<typename T >
std::vector<T> set2vec ( std::set< T >  s)

Casts a set to vector.

Template Parameters
T
Parameters
sset
Returns
std::vector<T>

◆ set2vec2f()

template<typename T >
std::vector<cv::Point2f> set2vec2f ( std::set< T >  s)

Casts a set of 2d points/vectors to a vector of cv::Point2f.

Template Parameters
T
Parameters
sset of points.vectors
Returns
std::vector<cv::Point2f>

◆ vec2set()

template<typename T >
std::set<T> vec2set ( std::vector< T >  vec)

Casts a vector to set.

Template Parameters
T
Parameters
vec
Returns
std::set<T>