Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
ObjectDetectorProvider Class Reference

#include <ObjectDetectorProvider.h>

List of all members.

Public Member Functions

void init ()
 ObjectDetectorProvider (const ros::NodeHandle &node_handle)
 ObjectDetectorProvider (const ros::NodeHandle &node_handle, const CameraBridge &camera)
bool ServiceSearchFor (re_vision::SearchFor::Request &req, re_vision::SearchFor::Response &res)
void SetDebugMode (bool onoff, const std::string &dir="")
void SetVisualizationMode (bool onoff)
void TopicCameraInfo (const sensor_msgs::CameraInfo::ConstPtr &caminfo)
void TopicNewModel (const std_msgs::String::ConstPtr &msg)
virtual ~ObjectDetectorProvider ()

Protected Types

typedef std::map< std::string,
ObjectDetectorMethod * > 
tAlgorithmMap
typedef std::map< std::string,
ObjectModel * > 
tModelMap

Protected Member Functions

void createDetectionAlgorithms ()
bool debugMode () const
void detectObjects (const std::vector< std::string > &objects, const cv::Mat &image, int max_points_per_object, std::vector< re_msgs::DetectedObject * > &ret)
void emptyResponse (const re_vision::SearchFor::Request &req, re_vision::SearchFor::Response &res) const
const CameraBridgegetCamera () const
cv::Mat getImage (const re_vision::SearchFor::Request &req)
void getValidObjects (const std::vector< std::string > &objects, std::vector< std::string > &valid_objects, std::vector< re_msgs::DetectedObject > &detections, std::vector< re_msgs::DetectedObject * > &pointers) const
void learnNewModel (const std::string &path)
void processRequest (const re_vision::SearchFor::Request &req, const cv::Mat &image, re_vision::SearchFor::Response &res)
void rectifyDetections (std::vector< re_msgs::DetectedObject > &detections, int W, int H, int max_points_per_object) const
void removeModel (const std::string &name)
void removeSomePoints (re_msgs::DetectedObject &detection, int max_points) const
void showRequestInformation (const re_vision::SearchFor::Request &req, const cv::Mat &image) const

Protected Attributes

tAlgorithmMap m_algorithms
sensor_msgs::CvBridge m_bridge
CameraBridge m_camera
bool m_camera_info_got
ros::Subscriberm_camera_info_sub
bool m_debug
tModelMap m_models
ros::Subscriber m_new_model_sub
ros::NodeHandle m_node_handle
ros::ServiceServer m_service
bool m_visualization
ros::Publisher m_visualization_pub
VisualizationManagerm_visualizer

Detailed Description

Definition at line 58 of file ObjectDetectorProvider.h.


Member Typedef Documentation

typedef std::map<std::string, ObjectDetectorMethod*> ObjectDetectorProvider::tAlgorithmMap [protected]

Definition at line 237 of file ObjectDetectorProvider.h.

typedef std::map<std::string, ObjectModel*> ObjectDetectorProvider::tModelMap [protected]

Definition at line 233 of file ObjectDetectorProvider.h.


Constructor & Destructor Documentation

Creates the provider with the name of the topic to listen to to obtain the camera parameters

Parameters:
node_handle

Definition at line 66 of file ObjectDetectorProvider.cpp.

ObjectDetectorProvider::ObjectDetectorProvider ( const ros::NodeHandle node_handle,
const CameraBridge camera 
)

Creates the provider with a predefined camera

Parameters:
node_handle
camerapredefined camera parameters

Definition at line 77 of file ObjectDetectorProvider.cpp.

Definition at line 233 of file ObjectDetectorProvider.cpp.


Member Function Documentation

Instantiates the object detection algorithms

Definition at line 88 of file ObjectDetectorProvider.cpp.

bool ObjectDetectorProvider::debugMode ( ) const [inline, protected]

Definition at line 176 of file ObjectDetectorProvider.h.

void ObjectDetectorProvider::detectObjects ( const std::vector< std::string > &  objects,
const cv::Mat &  image,
int  max_points_per_object,
std::vector< re_msgs::DetectedObject * > &  ret 
) [protected]

Definition at line 442 of file ObjectDetectorProvider.cpp.

void ObjectDetectorProvider::emptyResponse ( const re_vision::SearchFor::Request req,
re_vision::SearchFor::Response res 
) const [inline, protected]

Definition at line 362 of file ObjectDetectorProvider.cpp.

const CameraBridge& ObjectDetectorProvider::getCamera ( ) const [inline, protected]

Definition at line 179 of file ObjectDetectorProvider.h.

Definition at line 373 of file ObjectDetectorProvider.cpp.

void ObjectDetectorProvider::getValidObjects ( const std::vector< std::string > &  objects,
std::vector< std::string > &  valid_objects,
std::vector< re_msgs::DetectedObject > &  detections,
std::vector< re_msgs::DetectedObject * > &  pointers 
) const [protected]

Definition at line 253 of file ObjectDetectorProvider.cpp.

Definition at line 172 of file ObjectDetectorProvider.cpp.

void ObjectDetectorProvider::learnNewModel ( const std::string &  path) [protected]

Adds the model located in the given path to the list of models

Parameters:
path

Definition at line 399 of file ObjectDetectorProvider.cpp.

void ObjectDetectorProvider::processRequest ( const re_vision::SearchFor::Request req,
const cv::Mat &  image,
re_vision::SearchFor::Response res 
) [protected]

Definition at line 291 of file ObjectDetectorProvider.cpp.

void ObjectDetectorProvider::rectifyDetections ( std::vector< re_msgs::DetectedObject > &  detections,
int  W,
int  H,
int  max_points_per_object 
) const [protected]

Distorts the 2d points detected in the rectified image to match the location of the points in the original input image. This also removes those points whose distorted (x,y) end up outside the image

Parameters:
detectionsdetections
W
H,:width and height of the input image

Definition at line 494 of file ObjectDetectorProvider.cpp.

void ObjectDetectorProvider::removeModel ( const std::string &  name) [protected]

Removes the given object from the list of recognizable objects

Parameters:
name

Definition at line 429 of file ObjectDetectorProvider.cpp.

void ObjectDetectorProvider::removeSomePoints ( re_msgs::DetectedObject detection,
int  max_points 
) const [protected]

Removes from detection some points if there are more than max_points

Parameters:
detection
max_points

Definition at line 565 of file ObjectDetectorProvider.cpp.

Callback function of the SearchFor service

Definition at line 96 of file ObjectDetectorProvider.cpp.

void ObjectDetectorProvider::SetDebugMode ( bool  onoff,
const std::string &  dir = "" 
)

Sets the debug mode

Parameters:
onoffdebug mode iif true
dirif given, directory to store debug files (must exist)

Definition at line 220 of file ObjectDetectorProvider.cpp.

Sets the visualization mode

Parameters:
onoff

Definition at line 197 of file ObjectDetectorProvider.cpp.

void ObjectDetectorProvider::showRequestInformation ( const re_vision::SearchFor::Request req,
const cv::Mat &  image 
) const [protected]

Definition at line 531 of file ObjectDetectorProvider.cpp.

void ObjectDetectorProvider::TopicCameraInfo ( const sensor_msgs::CameraInfo::ConstPtr &  caminfo)

Callback function of the camera_info topic

Definition at line 124 of file ObjectDetectorProvider.cpp.

void ObjectDetectorProvider::TopicNewModel ( const std_msgs::String::ConstPtr &  msg)

Callback function of the new_model topic

Definition at line 115 of file ObjectDetectorProvider.cpp.


Member Data Documentation

Definition at line 238 of file ObjectDetectorProvider.h.

Definition at line 216 of file ObjectDetectorProvider.h.

Definition at line 220 of file ObjectDetectorProvider.h.

Definition at line 221 of file ObjectDetectorProvider.h.

Definition at line 214 of file ObjectDetectorProvider.h.

Definition at line 224 of file ObjectDetectorProvider.h.

Definition at line 234 of file ObjectDetectorProvider.h.

Definition at line 213 of file ObjectDetectorProvider.h.

Definition at line 211 of file ObjectDetectorProvider.h.

Definition at line 212 of file ObjectDetectorProvider.h.

Definition at line 228 of file ObjectDetectorProvider.h.

Definition at line 215 of file ObjectDetectorProvider.h.

Definition at line 227 of file ObjectDetectorProvider.h.


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


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:34:15