0
我已经使用在Matlab R2010b
中计算了Delaunay三角剖分。现在我想将三角形的一个子集(即12200个三角形)刻录到矩阵(Raster)中。有没有快速/有效的方式来做到这一点?在Matlab中光栅化Delaunay三角剖分
我已经尝试使用poly2mask()
和inpolygon()
来选择三角形内的像素,但这很慢。
我已经使用在Matlab R2010b
中计算了Delaunay三角剖分。现在我想将三角形的一个子集(即12200个三角形)刻录到矩阵(Raster)中。有没有快速/有效的方式来做到这一点?在Matlab中光栅化Delaunay三角剖分
我已经尝试使用poly2mask()
和inpolygon()
来选择三角形内的像素,但这很慢。
我实现了这个快速的解决方案:
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;