Computing the upper convex hull in 3d using Qhull - computational-geometry

I am trying to compute the upper convex hull of a cloud of point in 3D using Qhull. I do not know if there is a simple way to do it.
I've looked into several options of the modules ConvexHull and Delaunay, 'Qu' furthest site, but i do not think it does what I want, as it seems to be a way of computing the Delaunay triangulation using lower/upper convex hulls.
Another way of engineering a solution could be for each simplice of the convex hull to compute the normal and the center point of the surface, as to introduce a new point close to the center following a translation upon the normal.
Having added this point I could just compute the convex hull of the original ensemble plus this point and see if this point is interior to the hull or not.
I could then deduce if the simplice belongs to the upper and/or the lower hull.

Related

Algorithm to add points at the edge of other points

Let's say the initial map has only the red dots. Then I want to add all the green dots. Note that the shape is not always circular.
Any idea how to do that?
I was thinking to consider all as a cluster and then get the edge (or approximation) of the cluster and add new dots.
One possibility that comes to mind would be to conmpute the convex hull polygon of the input, using one of the known algorithms for that. Next, the center of gravity of the convex hull polygon could be used to shift the points of the convex hull outwards, resulting in a dilation of the boundary. If more points for the boundary are needed, one could interpolate between the points of the convex hull polygon.

Convex Hull Algorithm application

For what purpose is Convex Hull algorithm used in Hand gesture recognition using image processing in MATLAB?
Gesture-recognition applications utilizes computational geometry features and algorithms. In mathematical description, Convex Hull is the smallest convex set that contains given set of points. So, you may think that; in "hand-gesture-recognition" domain the convex hull is used to find area of the hand on the given image or image stream.
Consider the example;
The example shows the formation of the hand when all fingers are open.
Then, think about other formations of the hand;
Basically; you can see that for different formations results in different convex hull geometry. By inspecting geometry you can count the number of fingers open etc.
For detailed information, see that paper.

computing 3D reduced convex hull

I'm looking for an algorithm that provides what I call a "shrunken convex hull" (as distinct from a "reduced convex hull") in 3D. I am defining the shrunken hull, H', as the volume of space that has, no less than D distance from some original convex hull, H.
Analytically, this can be formed by moving each plane of H inwards along its normal by D, then computing the convex hull (if it exists) of the resultant planes. The tricky bit is some planes might be trimmed or dropped, others may move past other planes, and get entirely "snipped" out due to normal reversal (if D is big enough). I’m a bit fuzzy on how to do the algorithm, but have some badly thought out ideas below.
I am doing this to to identify the subset of points in a dataset which are guaranteed to be no less than a given distance from the surface of the original point set (which is assumed to be convex, and I have this). This is to remove surface effects that are disrupting our signal in some calculations we are doing.
I'm really looking for a name, or examples of anyone doing this, or another way to compute this. Ideally some good-old open code would be great, but I think my problem is far too niche.
I found reduced convex hulls, but this seems to be a different idea. The current closest thing I can find is "Hausdorff Cores" - however this seems like the more complicated case of non-convex polygons, and is pretty damned dense.
Do not read beyond here, unless you really really want to.
Current, incomplete/badly thought out algorithm
The slow way (i.e. current way) of identifying the reduced point set it is to compute the signed distance for all points, and reject those that are less than a given distance. However, this is pretty damned slow, as the number of points can be up to 100M. I think operating on the original hull to generate the shrunken hull, and computing its AABB and spherical BB, then retaining only those inside the shrunken hull might be much faster (I hope -willing to accept comments saying this is stupid).
I think it should be possible, as I don't strictly need the full distance information for each point, just D_point > D. So once I know this I should be able to stop.
I can see how the shrunken hull might be done in 2D, where you look at each vertex, then use an analytical solution to a constant velocity Eikonal, then move the vertex along the vector derived from each corner.
However, the situation is more complex for the 3D version, afaics, as there are multiple facets (>2) for each vertex . My current plan is to look at each edge pair individually, then work from there to (somehow - create half spaces and union them?) to build this hull.
What your thinking of is downscaling the 3D convex hull, it works just like downscaling a 2D image, except for how the angle
Outline for the algorithm (in 2D) looks something like this:
1. Compute the convex hull.
2. For each point, P, in the convex hull:
3. Find the hull points before and after, P
4. Bisect the angle formed to obtain the angle, A, required.
5. Create a new point, P', along the angle A at a distance, D, from `P`.
7. Add P' to the scaled-down (shrunken) convex hull.
The only difference in 3D occurs in lines 3 and 4. In 3D, step 3 obtains 3 points. In step 4, a 3D angle is used. Thus you'll find a fair bit of benefit in using the 3D transforms in a graphics/geometry libary, as the math may be tricky.
If your objective is to remove surface effects, and it's not important that every surface of the convex hull be displaced by the same distance, you could instead
Identify a point known to be inside the hull (e.g. the centroid of the point cloud or the hull)
Scale the hull inward towards that point
Unless you scale infinitely (collapsing everything to a point), this operation should give an inwardly-displaced hull which has the same connectivity - no points added or removed.

check whether a point is visible from a face of a 2d convex hull

I am trying to implement the Bowyer-Watson algorithm for generating a Delaunay Triangulation of a set of points in a plane. The algorithm assumes a presence of a bounding super-triangle, but some alternatives like maintaining the convex hull of the set of points have also been mentioned.
Thus, when we decide to produce a delaunay triangulation of points by assuming a convex hull in an incremental algorithm, if a point lies outside the convex hull, we should draw vertices from the point to all the vertices on the convex hull which comprise the faces of the hull from which the point is visible.
I was wondering how could I approach this problem? Should I initially generate a convex hull of all the points or like in the incremental approach where points are added one at a time, should i maintain a convex hull in the form of a DCEL?
EDIT: In the image above, if I have the point P which is outside the convex hull of a set of points in a plane, I need to calculate the edges of the hull from which the point is visible. [The green edge of the hull]
I hope the image helps in clarifying the question.
Thanks in advance
The edges that see P are those that form a clockwise triangle with P when the hull is traversed counterclockwise (compute the signed area).

Numerical Integration of area defined by set of coordinates?

Suppose you have a general shape defined by a bunch of coordinate points that form something that looks like a circle, ellipse, or general closed curve - how do you find the area bounded by these points?
Find the convex hull of the set of points. Record down the points at the boundary.
Compute the area of the polygon bounded by those points.
If those points may not define a convex polygon, you need a concave hull algorithm in step 1.
you would typically use Monte Carlo integration or integration on the grid for multidimensional integration. you can adapt the same approach for flat surface as well.

Resources