patch_rasterize

버전 1.0.0.0 (2.2 KB) 작성자: Andrea Tagliasacchi
Rasterization of a 2D triangulation
다운로드 수: 467
업데이트 날짜: 2013/5/14

라이선스 보기

patch_rasterize Rasterization of a 2D triangulation
patch_rasterize rasterize a 2D triangulation into a image. The function
returns an image rasterizing the triangulation. This image is similar
to the one used for OpenGL's glSelectBuffer for fast "picking".

I = patch_rasterize(p) creates an image of size=max(p.vertices). If the
f-th triangle p.faces(f,:) contains the pixels at position (i,j) then
I(i,j)=f.

Once I has been computed, retrieving a the index of the triangle
containing the point (x,y) can be achieved by f = I( round(x), round(y) )

The function run without parameters executes Example 1.

Example 1:
clc, clear, close all;
% generate some data
P = gallery('uniformdata',[100 2],0);
DT = delaunayTriangulation(P);
p.faces = DT.ConnectivityList;
p.vertices = DT.Points * 300;
% rasterize it
I = patch_rasterize(p);
figure, hold on;
imagesc(I); axis image;
triplot(p.faces, p.vertices(:,1), p.vertices(:,2), 'color', 'white');

See also patch, triangulation,

인용 양식

Andrea Tagliasacchi (2024). patch_rasterize (https://www.mathworks.com/matlabcentral/fileexchange/41744-patch_rasterize), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2013a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Polygons에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0