I am assuming that you are using delaunay triangulation on a black & white image.
1) Find the indices of the 'ones' in your b/w image- (Note- the 'ones' are also called as control points)-
[r c v] = find(BW==1);
2) Feed the r and c vectors to the function 'DelaunayTri()'-
dt = DelaunayTri(r,c);
3) dt(1,:) represents the indices of the 1'st triangle, dt(2,:) for the 2nd triangle, and so on.
4) Co-ordinates of the vertices of the 1st triangle are given by-
First vertex -
[ r(dt(1,1)) c(dt(1,1)) ]
Second Vertex -
[ r(dt(1,2)) c(dt(1,2)) ]
Third Vertex -
[ r(dt(1,3)) c(dt(1,3)) ]
5) and so on for other triangles.
Hope that helped.
m
are given byTRI(m, 1)
,TRI(m, 2)
andTRI(m, 3)
. The indices refer to the input vectorsX
andY
, so the coordinates of the first point of trianglem
areX(TRI(m,1))
andY(TRI(m,1))
– beaker