本文整理汇总了C++中Mat_::bindAll方法的典型用法代码示例。如果您正苦于以下问题:C++ Mat_::bindAll方法的具体用法?C++ Mat_::bindAll怎么用?C++ Mat_::bindAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mat_
的用法示例。
在下文中一共展示了Mat_::bindAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update_cams_mesh
void update_cams_mesh(Mesh &cams, Mat_<double> extrinsics, Mat_<double> extrinsics_rel, Mat_<double> lines)
{
cams = mesh_cam().scale(20);
for(auto pos : Idx_It_Dims(extrinsics_rel,"channels","cams")) {
//cv::Vec3b col(0,0,0);
//col[ch%3]=255;
Eigen::Vector3d trans(extrinsics_rel(3,pos.r("channels","cams")),extrinsics_rel(4,pos.r("channels","cams")),extrinsics_rel(5,pos.r("channels","cams")));
Eigen::Vector3d rot(extrinsics_rel(0,pos.r("channels","cams")),extrinsics_rel(1,pos.r("channels","cams")),extrinsics_rel(2,pos.r("channels","cams")));
//FIXME must exactly invert those operations?
Mesh cam = mesh_cam().scale(20);
cam -= trans;
cam.rotate(-rot);
cams.merge(cam);
//cam_writer.add(cam_left,col);
//printf("extr:\n");
//std::cout << -rot << "\n trans:\n" << -trans << std::endl;
//printf("%.3f ", trans.norm());
Mesh line_mesh;
for(auto line_pos : Idx_It_Dims(lines,"x","y")) {
if (line_pos["x"] % 4 != 0)
continue;
if (line_pos["y"] % 4 != 0)
continue;
Mat_<double> l = lines.bindAll(-1,line_pos["x"],line_pos["y"],pos["channels"],pos["cams"]);
Eigen::Vector3d origin(l(0),l(1),0.0);
Eigen::Vector3d dir(l(2),l(3),-1.0);
Mesh line = mesh_line(origin,origin+dir*1000.0);
line_mesh.merge(line);
}
line_mesh -= trans;
line_mesh.rotate(-rot);
cams.merge(line_mesh);
//viewer.data.add_edges(P1,P2,Eigen::RowVector3d(r,g,b);
}
//printf("\n");
for(auto pos : Idx_It_Dim(extrinsics, "views")) {
Eigen::Vector3d trans(extrinsics(3,pos["views"]),extrinsics(4,pos["views"]),extrinsics(5,pos["views"]));
Eigen::Vector3d rot(extrinsics(0,pos["views"]),extrinsics(1,pos["views"]),extrinsics(2,pos["views"]));
Mesh plane = mesh_plane().scale(1000);
plane -= trans;
plane.rotate(-rot);
cams.merge(plane);
}
}