convex-hull

The minimum perimeter convex hull of a subset of a point set

ⅰ亾dé卋堺 提交于 2019-12-03 15:41:35
问题 Given n points on the plane. No 3 are collinear. Given the number k. Find the subset of k points, such that the convex hull of the k points has minimum perimeter out of any convex hull of a subset of k points. I can think of a naive method runs in O(n^k k log k). (Find the convex hull of every subset of size k and output the minimum). I think this is a NP problem, but I can't find anything suitable for reduction to. Anyone have ideas on this problem? An example, the set of n=4 points {(0,0),

C++-ObjC OpenCV Constrained Delaunay

喜欢而已 提交于 2019-12-03 14:06:51
问题 I succesfully implemented a Delaunay triangulation of a contour in OpenCV 2.3.1. With cvPointPolygonTest I can get all the triangles in the convex hull, then I tried to perform another cvPointPolygonTest on triangles centroid to know if they are in the main contour or not , so I can have the constrained triangulation of the contour. But, it doesn't work well, as some triangles are (eg. with a walking man who has his two legs distant) 'over' a hole . Does anyone know a way to perform a

convex hull algorithm for 3d surface z = f(x, y)

故事扮演 提交于 2019-12-03 08:52:07
I have a 3D surface given as a set of triples (x_i, y_i, z_i), where x_i and y_i are roughly on a grid, and each (x_i, y_i) has a single associated z_i value. The typical grid is 20x20 I need to find which points belong to the convex hull of the surface, within a given tolerance. I'm looking for an efficient algorithm to perform the computation (my customer has provided an O(n³) version, which takes ~10s on a 400 point dataset...) There's quite a lot out there, didn't you search? Here are a couple with O( n log h ) runtime, where n is number of input points and h is number of vertices of the

Convex hull in higher dimensions, finding the vertices of a polytope

扶醉桌前 提交于 2019-12-03 06:56:17
Suppose I have a point cloud given in 6-dimensional space, which I can make as dense as needed. These points turn out to lie on the surface of a lower-dimensional polytope (i.e. the point vectors (x1, x2, ... x6) appear to be coplanar). I would like to find the vertices of this unknown polytope and my current attempt makes use of the qhull algorithm, via the scipy interface in Python. In the beginning I would only get error messages, apparently caused by the lower dimensional input and/or the many degenerate points. I have tried a couple of brute-force methods to eliminate the degenerate

The minimum perimeter convex hull of a subset of a point set

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 05:12:31
Given n points on the plane. No 3 are collinear. Given the number k. Find the subset of k points, such that the convex hull of the k points has minimum perimeter out of any convex hull of a subset of k points. I can think of a naive method runs in O(n^k k log k). (Find the convex hull of every subset of size k and output the minimum). I think this is a NP problem, but I can't find anything suitable for reduction to. Anyone have ideas on this problem? An example, the set of n=4 points {(0,0), (0,1), (1,0), (2,2)} and k=3 Result: {(0,0),(0,1),(1,0)} Since this set contains 3 points the convex

Convex hull of (longitude, latitude)-points on the surface of a sphere

强颜欢笑 提交于 2019-12-03 05:00:32
问题 Standard convex hull algorithms will not work with (longitude, latitude)-points, because standard algorithms assume you want the hull of a set of Cartesian points. Latitude-longitude points are not Cartesian, because longitude "wraps around" at the anti-meridian (+/- 180 degrees). I.e., two degrees east of longitude 179 is -179. So if your set of points happens to straddle the anti-meridian, you will compute spurious hulls that stretch all the way around the world incorrectly. Any suggestions

C++-ObjC OpenCV Constrained Delaunay

坚强是说给别人听的谎言 提交于 2019-12-03 04:04:21
I succesfully implemented a Delaunay triangulation of a contour in OpenCV 2.3.1. With cvPointPolygonTest I can get all the triangles in the convex hull, then I tried to perform another cvPointPolygonTest on triangles centroid to know if they are in the main contour or not , so I can have the constrained triangulation of the contour. But, it doesn't work well, as some triangles are (eg. with a walking man who has his two legs distant) 'over' a hole . Does anyone know a way to perform a constrained triangulation. I thought about convexityDefects, but can't manage to understand how to begin with

qhull Library - C++ Interface

我是研究僧i 提交于 2019-12-03 02:11:08
The qhull library ( qhull.org) has several examples to start in his website, but all the information regarding to the C++ is not very useful to me. I am trying to make a simple convex Hull of 3D points that I read from a file, I can´t use the technique that is suggested in the website of calling the qhull.exe as an external application because I need to make several convex hull from some modifications that I made in the data points. I can´t find a simple example for doing this, can someone give me some help in this task? Any information would be useful. Thanks Since I had a hard time using

Finding largest subset of points forming a convex polygon

邮差的信 提交于 2019-12-03 02:01:29
I'm looking for an algorithm for finding largest subset of points (by largest i mean in number) that form a convex polygon from the given set of point. I think this might be solvable using DP but i'm not sure. Is it possible to do this in O(n^3) ? Actually i just need the size of the largest subset, so it doesn't need to have unique solution Edit : just to keep this simple, Given input : a set of points in 2D Desired output : maximum number of points that form a convex polygon, like in the example the output is 5 (ABHCD is one of the possible convex polygon) There's a similar problem spoj.com

OpenCV C++ cv::convexityDefects error

混江龙づ霸主 提交于 2019-12-02 18:52:25
问题 vector<Point> hull; vector<Point> defects; convexHull(Mat(largest),hull,false); convexityDefects(largest,hull,defects); * largest is my largest contour in the image But the convexityDefects gives me this error "Assertion failed (hull.checkVector(1, CV_32S) > 2)". Someone please help me, I do not want to resort to using C solution. EDITED vector<int> hull; vector<Point> defects; convexHull(Mat(largest),hull,false); vector<vector<int>> testhull; testhull.push_back(hull); convexityDefects