【问题标题】:Rasterizing Delaunay triangulation in Matlab在 Matlab 中栅格化 Delaunay 三角剖分
【发布时间】:2023-03-30 04:40:01
【问题描述】:

我在Matlab R2010b 中使用DelaunayTri() 计算了Delaunay 三角剖分。现在我想将三角形​​的一个子集(即 12200 个三角形)烧成一个矩阵(光栅)。有什么快速/有效的方法吗?

我尝试使用poly2mask()inpolygon() 来选择三角形内的像素,但这相当慢。

【问题讨论】:

    标签: matlab triangulation delaunay rasterizing


    【解决方案1】:

    我实现了这个快速解决方案:

    qrypts=[xgridcoords, ygridccords]; %grid x and y coordinates
    triids = pointLocation(dt, qrypts); %associate each grid point to its Delaunay triangle
    Lia = ismember(triids,dtsubset); %keep subset of points contained in the desired triangles (dtsubset contains the indices of desired triangles)
    IM=false(size(grid)); 
    IM(Lia)=1;
    

    【讨论】:

      猜你喜欢
      • 2014-07-29
      • 2015-01-07
      • 1970-01-01
      • 2019-04-18
      • 2017-09-01
      • 2021-05-27
      • 2019-09-28
      • 2021-05-14
      • 2013-05-12
      相关资源
      最近更新 更多