当前位置: 首页 > news >正文

网站代码 字体普洱市住房和城乡建设局信息公开网站

网站代码 字体,普洱市住房和城乡建设局信息公开网站,江苏建设准考证打印在哪个网站,西安专业做网站公司CGAL 从DSM到DTM-建筑物区域提取 生成的DSM被用作DTM计算的基础#xff0c;即地面表示为过滤掉非地面点后的另一个TIN。主要是去除一些建筑物和植被非地形点。 建筑物立面及连通区域提取 建筑物立面的特征是三角形面片的高度变化剧烈。 通过遍历每一个三角面片#xff0c;…CGAL 从DSM到DTM-建筑物区域提取 生成的DSM被用作DTM计算的基础即地面表示为过滤掉非地面点后的另一个TIN。主要是去除一些建筑物和植被非地形点。 建筑物立面及连通区域提取 建筑物立面的特征是三角形面片的高度变化剧烈。 通过遍历每一个三角面片计算顶点之间最大的高差face_height与事先设置的阈值spacing比较大于阈值或包含无限远点infinite_vertex标记为建筑物立面。 除去建筑物立面对剩下的三角面片使用洪水算法确定连通区域并标记对应的区域id取值范围[0component_size.size()]。 代码 #includeiostream#includeCGAL/Surface_mesh.h #includeCGAL/Surface_mesh/IO/PLY.h#include CGAL/Exact_predicates_inexact_constructions_kernel.h #include CGAL/Projection_traits_xy_3.h #include CGAL/Delaunay_triangulation_2.h #include CGAL/Triangulation_vertex_base_with_info_2.h #include CGAL/Triangulation_face_base_with_info_2.h#include CGAL/boost/graph/graph_traits_Delaunay_triangulation_2.h #include CGAL/boost/graph/copy_face_graph.h#include CGAL/compute_average_spacing.husing Kernel CGAL::Exact_predicates_inexact_constructions_kernel;using Projection_traits CGAL::Projection_traits_xy_3Kernel;using Point_3 Kernel::Point_3; using Mesh CGAL::Surface_meshPoint_3;using Concurrency_tag CGAL::Sequential_tag;using Vbi CGAL::Triangulation_vertex_base_with_info_2 Mesh::Vertex_index, Projection_traits; using Fbi CGAL::Triangulation_face_base_with_info_2int, Projection_traits; using TDS CGAL::Triangulation_data_structure_2Vbi, Fbi; using TIN_with_info CGAL::Delaunay_triangulation_2Projection_traits, TDS;int main() {Mesh mesh;CGAL::IO::read_PLY(./data/dsm.ply, mesh);auto idx_to_point_with_info [](const Mesh::Vertex_index idx) - std::pairPoint_3, Mesh::Vertex_index{return std::make_pair ( mesh.point(idx), idx);};TIN_with_info tin_with_info(boost::make_transform_iterator (mesh.vertices().begin(), idx_to_point_with_info),boost::make_transform_iterator (mesh.vertices().end(), idx_to_point_with_info));double spacing CGAL::compute_average_spacingConcurrency_tag(mesh.points(), 6);spacing * 2;auto face_height [](const TIN_with_info::Face_handle fh) - double{double out 0.;for (int i 0; i 3; i)out (std::max) (out, CGAL::abs(fh-vertex(i)-point().z() - fh-vertex((i1)%3)-point().z()));return out;};// Initialize faces info 初始化三角面附件信息int类型for (TIN_with_info::Face_handle fh : tin_with_info.all_face_handles())if (tin_with_info.is_infinite(fh) || face_height(fh) spacing) // Filtered faces are given info() -2fh-info() -2;else // Pending faces are given info() -1;fh-info() -1;// Flooding algorithmstd::vectorint component_size;for (TIN_with_info::Face_handle fh : tin_with_info.finite_face_handles()){if (fh-info() ! -1)continue;std::queueTIN_with_info::Face_handle todo;todo.push(fh);int size 0;while (!todo.empty()){TIN_with_info::Face_handle current todo.front();todo.pop();if (current-info() ! -1)continue;current-info() int(component_size.size()); size;for (int i 0; i 3; i)todo.push (current-neighbor(i));}component_size.push_back (size);}std::cerr component_size.size() connected component(s) found std::endl;Mesh tin_colored_mesh;//Mesh::Property_mapMesh::Face_index, CGAL::IO::Colorcolor_map tin_colored_mesh.add_property_mapMesh::Face_index, CGAL::IO::Color(f:color).first;CGAL::copy_face_graph (tin_with_info, tin_colored_mesh,CGAL::parameters::face_to_face_output_iterator(boost::make_function_output_iterator([](const std::pairTIN_with_info::Face_handle, Mesh::Face_index ff){// 灰色标记建筑物立面及待处理的其他非地面点if (ff.first-info() 0){color_map[ff.second] CGAL::IO::Color(128, 128, 128);// put(color_map, ff.second, CGAL::IO::Color(128, 128, 128));}else{// 其他标记随机颜色CGAL::Random r (ff.first-info());color_map[ff.second] CGAL::IO::Color (r.get_int(64, 192),r.get_int(64, 192),r.get_int(64, 192));/*put(color_map, ff.second, CGAL::IO::Color(r.get_int(64, 192),r.get_int(64, 192),r.get_int(64, 192)));*/}})));std::ofstream tin_colored_ofile (colored_tin.ply, std::ios_base::binary);CGAL::IO::set_binary_mode (tin_colored_ofile);CGAL::IO::write_PLY (tin_colored_ofile, tin_colored_mesh);tin_colored_ofile.close();return 0; }如下图所示灰色标记为建筑物立面其他联通区域标记随机颜色 构建编译运行 cmake -B build -S . -DCMAKE_TOOLCHAIN_FILED:\vcpkg\scripts\buildsystems\vcpkg.cmake cmake --build build --config Debug .\build\Debug\coloredTIN.exe参考 https://doc.cgal.org/latest/Manual/tuto_gis.html
http://www.w-s-a.com/news/993984/

相关文章:

  • 海外留学网站建设方案门户网站的发布特点
  • 网站建设不赚钱net112企业建站系统
  • 网站建设团队管理模板贵州省住房和城乡建设部网站
  • 曲沃网站建设网上学编程的有哪些比较好的网站
  • 厦门网站建设慕枫学做网站需要多久
  • 爱奇艺做任务领vip网站设计广告图片
  • 中科汇联网站建设手册上海公司名称注册查询网
  • 网站建设电子商务课总结和体会关于做网站书籍
  • 仪征网站建设公司哪家好简单网页制作素材图片
  • 甘肃第九建设集团公司网站潍坊个人做网站
  • 如何做后台网站的教程网站建设 关于我们
  • 极速网站建设哪家好连云港百度推广网站建设
  • 医院网站建设的目标wordpress中英文网站模板
  • 门户型网站开发难度网站导航栏有哪些
  • 推荐做任务网站软件定制开发哪家好
  • 邯郸兄弟建站第三方仓储配送公司
  • 商丘家具网站建设wordpress 添加代码
  • 基础建设的网站有哪些内容成都科技网站建设咨询电话
  • 券多多是谁做的网站招聘网站开发模板
  • 网站主机一般选哪种的企业数字展厅
  • 网站建设该如何学衡水建设局网站首页
  • 高校网站建设工作总结番禺网站开发哪家好
  • 苏州 网站的公司wordpress主页代码
  • 怎么用html做图片展示网站外贸网站建设推广费用
  • 可以做本地生活服务的有哪些网站中油七建公司官网
  • 如何建设谷歌网站网站建设优点
  • 做网站的目标是什么产品宣传片制作公司
  • 柳州建设公司网站辽宁建设工程信息网评标专家入库
  • 合肥建设学校官方网站excel导入wordpress
  • 禹城网站设计做网站需要考虑哪些