简体   繁体   中英

2d triangulation given a set of boundary points

Suppose I have a binary image, and I detect the boundary pixels. Based on the boundary pixels, I want to do triangulation as shown below.

在此处输入图片说明

What is the keyword I should look up for this algorithm? I looked up Delaunay Triangulation but based on my understanding I need the interior points as well in order for it to work.

This figure is originated from this paper . They called this "adaptive triangular mesh" and claimed to use CGAL to generate it, but I googled "adaptive triangular mesh" and looked all over CGAL's documentation but couldn't find anything relevant. Can someone please point me in the right direction?

I think what you are looking for is a Constrained Delaunay Triangulation (CDT), but you may also see it referred to as a Conforming Delaunay Triangulation (which is a shortening of "conforming constrained..."). I've posted a page describing the CDT at https://github.com/gwlucastrig/Tinfour/wiki/About-the-Constrained-Delaunay-Triangulation . The polygon you specify would serve as a constraint on the overall placement of edges in the Delaunay. There is also some more information on the kind of thing you're trying to do at https://github.com/gwlucastrig/Tinfour/wiki/Tutorial-Using-Polygon-Based-Constraints . The second article may be useful as a source of ideas, but some of its discussion is tied to a specific API.

The polygon in the image you posted appears to be convex. The bounds of a Delaunay will be convex. So if your polygon is convex, no edges will be placed outside your polygon. However, if your polygon includes some concavities, then there will be edges outside the polygon. Any decent implementation of a Delaunay API will allow your code to distinguish whether an edge is inside the constraints or not.

The picture you posted appears to have undergone some kind of Delaunay Refinement, a process in which vertices are inserted into the mesh to create more robust triangles. You'll notice that there are no "skinny" triangles in your picture and that there are a lot of small triangles near the boundary. Those features are typical of a refinement technique. If you use an API that doesn't include a refinement method, you will still get a valid Delaunay but it may not be so pleasing in an aesthetic sense. In lieu of a refinement implementation, you could simply have your code look for skinny triangles and insert their circumcircle centers into the mesh.

Well, I start by pointing out that a conforming CDT is already Delaunay. The refinement algorithm just improves the general shape of the triangles. Refinement has advantages when the mesh is to be used for certain numerical calculations. But it's not absolutely required for every application. For example, I use a non-refined mesh for computing the volume and surface area of lakes and reservoirs, and it works just fine (see https://github.com/gwlucastrig/Tinfour/wiki/Using-the-Delaunay-to-Compute-Lake-Volume-Part-1 ).

There are two major algorithms for Delaunay Refinement: Ruppert's and Chew's Second Algorithm. Both operate by inserting artificial points into the mesh at favorable locations. Ruppert's is the older of the two and guarantees that Delaunay criterion is met by all triangles. Chew's produces somewhat better triangles but, I think, does not guarantee Delaunay.

I found an article about Chew's algorithm at http://2011.cccg.ca/PDFschedule/papers/paper91.pdf Figure 6 gives a good visual notion of what refinement does.

I've got plans to implement Delaunay Refinement in my own software library using Ruppert's algorithm. There are some technical challenges that are slowing me down. I believe that if you look for Jonathan Shewchuk's truly excellent Triangle package, or maybe the CGAL library, or the Java Topology Suite ( https://locationtech.github.io/jts/ ) you will find some implementations.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM