Questions tagged [convex-hull]

Convex-hull of a set of points X in a Euclidean space is the convex set with smallest area that contains all points of X.

538 questions
5
votes
2 answers

How do I compute, in O(n) time, a convex hull of a set of points which are sorted by x-coordinate?

I read about algorithms to compute convex hulls. Most of them take O(n*log(n)) time, where n is the number of input points. Let S = {p_1, p_2, ..., p_n} be a set of points which are sorted by x-coordinates, that is, p_1.x <= p_2.x <= ... <= p_n.x.…
5
votes
1 answer

Computing the distance to a convex hull

I am using the ConvexHull class of scipy to construct a convex hull for a set of points. I am interested in a way to compute the minimum distance of a new point P from the convex hull. With the help of the internet and a little tweaking by myself I…
Woltan
  • 13,723
  • 15
  • 78
  • 104
5
votes
3 answers

Query volume of artifical blocks inside a convex hull

Problem: I have a three-dimensional point cloud each centroid of a block representing a block. For simplicity this example is just two dimensional. As illustrated in the picture I want to include blocks of interest, based on a parameter. In the…
KiW
  • 593
  • 3
  • 20
5
votes
0 answers

How to plot spherical polygons in Python using matplotlib?

I have a numpy array vertices of shape (N,3) containing the N vertices of a spherical polygon in 3D, i.e. all these points lie on the surface of a sphere. The center and radius of the sphere is known (take the unit sphere for example). I would like…
Meneldur
  • 215
  • 1
  • 5
5
votes
3 answers

Polygons from line segments

I have a list of line segments in no particular order. I want to find all enclosed spaces (polygons) formed by the segments. Is there an efficient algorithm or method that I could use to do this? The following image illustrates the problem. How can…
Tyson
  • 1,226
  • 1
  • 10
  • 33
5
votes
3 answers

How to sort points in a Google maps polygon so that lines do not cross?

I am trying to make a map where a user can outline any shape they would like. But I am running into an issue where users can select points that will make the lines of the polygon cross and exclude area's that I would like to include. To see what…
Abe Miessler
  • 82,532
  • 99
  • 305
  • 486
5
votes
1 answer

collision prediction using minkowski sum

I want to use the minkowski sum to predict the exact point of collision between two convex shapes. By my understanding the point where the velocity vector intersects with the minkowski sum is the amount I have to move my object along the vector so…
5
votes
6 answers

Convex Hull on Java Android Opencv 2.3

Please help me, I have a problem for Convex Hull on Android. I use Java and OpenCV 2.3. Before I made it on Java, I made it on C++ with Visual Studio 2008. This code can running successfully on C++. Now, i want to convert it from C++ to Java on…
Jenang
  • 91
  • 1
  • 2
  • 4
5
votes
2 answers

get the perimeter of a 2D set of points

I have a set of points in 2D ( coordinates for x and y ), now I need to discard all the points that are not meaningful to me, and what I mean by that is that I'm only interested in the area that this points are tracing. In short, this it's supposed…
pgf
  • 65
  • 1
  • 6
5
votes
2 answers

What's the point in QPainter::drawConvexPolgon

From the docs: QPainter offers two methods of painting QPolygons: drawPolygon and drawConvexPolygon. Nowhere in the documentation is it made clear what the difference between them is. Additionally, the drawConvexPolygon docs state If the supplied…
Nils Werner
  • 34,832
  • 7
  • 76
  • 98
5
votes
4 answers

finding convexity defects in opencv? [crashes depending on the given input image..]

I have a program that calculates the convex hull of an image. I'm trying to use this information in order to count the number of fingers that are present in an input image. From some surfing I found out that the way to do this (count fingers) is…
silent
  • 2,836
  • 10
  • 47
  • 73
4
votes
1 answer

How to understand Shamos algorithm?

I wanted to find shortest time algorithm for finding the diameter of a convex hull, so I found Shamos algorithm on wikipedia: GetAllAntiPodalPairs(p[1..n]) i0 = n i = 1 j = i + 1 while (Area(i, i + 1, j + 1) > Area(i, i + 1, j)) …
user17539547
4
votes
1 answer

Vanilla JavaScript Convex Hull unexpected polygon shape on Google maps

I am having issues creating a complex Convex Hull. If I change to s simple polygon with 10 points or so, it works great, but when I have 20-30 points over a large area, it creates a "split" in the polygon. Whereas the math says it should be…
Zak
  • 6,976
  • 2
  • 26
  • 48
4
votes
1 answer

Convex hull not working with zoom/pan

I am trying to include the Convex Hull implentation by @bumbeishvili ( https://bl.ocks.org/bumbeishvili/f027f1b6664d048e894d19e54feeed42) into my customize d3 force but unfortunately I cannot update the convex hulls after panning or zooming...Any…
ddomingo
  • 913
  • 1
  • 11
  • 14
4
votes
1 answer

Count protuberances in dendrite with openCV (python)

I'm trying to count dendritic spines (the tiny protuberances) in mouse dendrites obtained by fluorescent microscopy, using Python and OpenCV. Here is the original image, from which I'm starting: Raw picture: After some preprocessing (code below)…