Go to the documentation of this file.
8 #include <opencv2/highgui/highgui.hpp>
19 std::cout <<
"Usage: ed_fitter IMAGE-FILE-OR-DIRECTORY WORLDMODEL_NAME ENTITY_ID" <<
std::endl;
27 int main(
int argc,
char **argv)
60 std::cerr <<
"Entity '" << entity_id <<
"' could not be found in world model '" << model_name <<
"'." <<
std::endl;
76 bool estimateEntityPose = fitter.
estimateEntityPose(fitterdata, *world_model, entity_id, e->pose(), fitted_pose);
84 cv::Mat rgbcanvas = snapshot.
image->getRGBImage();
85 cv::imshow(
"RGB", rgbcanvas);
88 cv::Mat canvas =
visualizeFitting(entity_2d, sensor_pose2d, entity_pose2d, fitted_pose2d, fitterdata, estimateEntityPose);
89 cv::imshow(
"Fitting", canvas);
90 char key = cv::waitKey();
113 cv::destroyAllWindows();
The Snapshot struct, of a camera image taken at a single point in time.
geo::Pose3D sensor_pose_xya
bool estimateEntityPose(const FitterData &data, const ed::WorldModel &world, const ed::UUID &id, const geo::Pose3D &expected_pose, geo::Pose3D &fitted_pose, double max_yaw_change=M_PI) const
estimateEntityPose performs the entity pose estimation. Basically, tries to call estimateEntityPoseIm...
ed::WorldModelPtr loadWorldModel(const std::string &model_name)
The FitterData struct contains the downprojected (hence 2D) sensor readings as well as the sensor pos...
The EntityRepresentation2D struct contains the (downprojected) shape that is used for the fitting.
shared_ptr< const Entity > EntityConstPtr
EntityRepresentation2D GetOrCreateEntity2D(const ed::EntityConstPtr &e) const
GetOrCreateEntity2D returns the downprojected shape of the entity. If it's already in the cache,...
void next()
next, proceed to next index of the snapshot list. If index is out of bounds, try to load a new snapsh...
shared_ptr< WorldModel > WorldModelPtr
cv::Mat visualizeFitting(EntityRepresentation2D entity, geo::Transform2 sensor_pose, geo::Transform2 entity_pose, geo::Transform2 fitted_pose, FitterData fitterdata, bool estimateEntityPose)
void configureBeamModel(const image_geometry::PinholeCameraModel &cammodel)
configure the beam model (nr of data points and focal length) according to the camera you are using.
void processSensorData(const rgbd::Image &image, const geo::Pose3D &sensor_pose, FitterData &data) const
processSensorData pre-processes sensor data, i.e., performs a downprojection of the input depth image...
The Fitter class contains the algorithm to do the 2D fit of an entity.
int main(int argc, char **argv)
main executable to visualise the fitting process of stored images.
void usage()
usage, print how the executable should be used and explain the input
const char * what() const