2D alpha shape / concave hull problem in Python

I have a large set of 2D points that I’ve downsampled into a 44×2 numpy array (array defined later). I am trying to find the bounding shape of those points which are effectively a concave hull. In the 2nd image I’ve manually marked an approximate bounding shape that I am hoping to get.

points points+overlay

I have tried using alphashape and the Delauney triangulation method from here, both methods providing the same answer.

Unfortunately, I don’t seem to be able to achieve what I need, regardless of the alpha parameters. I’ve tried some manual settings and alphaoptimize, some examples of which are below.

alpha=0.1 alpha=0.5 alpha=1.0

Is there something critical I’m misunderstanding about alphashape? The documentation seems very clear, but obviously I’m missing something.

import numpy as np
import alphashape
from descartes import PolygonPatch
import matplotlib.pyplot as plt

points = np.array(

alpha = 0.1
alphashape = alphashape.alphashape(points, alpha)

fig = plt.figure()
ax = plt.gca()


The plots that you attached are misleading, since the scales on the x-axis and the y-axis are very different. If you set both axes to the same scale, you obtain the following plot:

point cloud.

Since differences between x-coordinates of points are on the average much larger than differences between y-coordinates, you cannot obtain an alpha shape resembling your desired result. For larger values of alpha points scattered along the x-axis will not be connected by edges, since alpha shape will use circles too small to connect these points. For values of alpha small enough that these points get connected you will obtain the long edges on the right-hand side of the plot.

You can fix this issue by rescaling y-coordinates of all points, effectively stretching the plot in the vertical direction. For example, multiplying y-coordinates by 7 and setting alpha = 0.4 gives the following picture:

alpha shape