7 #include <glm/gtc/matrix_transform.hpp> 8 #include <opencv2/core/core.hpp> 9 #include <opencv2/imgcodecs/imgcodecs.hpp> 10 #include <opencv2/imgproc/imgproc.hpp> 16 const unsigned int cam_width = 320;
17 const unsigned int cam_height = 240;
18 const float cam_fx = 257.34;
19 const float cam_cx = 160;
20 const float cam_fy = 257.34;
21 const float cam_cy = 120;
24 obj.emplace(
"alien",
"./spaceinvader.obj");
26 SICAD si_cad(obj, cam_width, cam_height, cam_fx, cam_fy, cam_cx, cam_cy);
38 objpose_map.emplace(
"alien", obj_pose);
40 double cam_x[] = { 0, 0, 0};
41 double cam_o[] = {1.0, 0, 0, 0};
50 cv::Mat img = cv::imread(
"./space.png");
53 cv::imwrite(
"./spaceinvader.jpg", img);
std::unordered_map< std::string, std::string > ModelPathContainer
void setBackgroundOpt(bool show_background)
bool superimpose(const ModelPoseContainer &objpos_map, const double *cam_x, const double *cam_o, cv::Mat &img) override
Render the mesh models in the pose specified in objpos_map and move the virtual camera in cam_x posit...
std::vector< double > ModelPose
A Superimpose derived class to superimpose mesh models on images.
std::multimap< std::string, ModelPose > ModelPoseContainer