Questions tagged [convex]

Anything related to convex geometric shapes. A shape in an Euclidean space is convex if, given two points A and B, every point of the segment AB belongs to the shape, i.e. AB is a subset of the shape.

Anything related to convex geometric shapes.

A shape in an Euclidean space is convex if, given two points A and B, every point of the segment AB belongs to the shape, i.e. AB is a subset of the shape.

See Wikipedia on:

139 questions
2
votes
1 answer

Concave mask to convex

I'm detecting an object in an image and create a mask from the contours. The mask is then dilated and smoothed. For example, from an image like this: I end up with a mask like this: When I crop the image (chair) using the mask, I lose the…
akinuri
  • 10,690
  • 10
  • 65
  • 102
2
votes
2 answers

Discrete Convex Hull

In python, given m random points in an n x n grid, how do I calculate a (roughly) convex hull where the hull can only be created using the points on the discrete grid rather than a continuous point? modules like scipy.spatial only give continuous…
2
votes
0 answers

efficiently reusing/updating julia convex constraints

I'm using Julia (with Convex) to solve a convex problem many times with the same constraint structure. Right now, I have something like the following simplified structure: using Convex N = Int16(1e4) x = Variable(N) t = Variable() obj =…
jjjjjj
  • 1,152
  • 1
  • 14
  • 30
2
votes
1 answer

Is there a function for computing the N-dimensional convex hull in Julia?

Does such a function exist yet? If so, where can I find it? Basically, I'm looking for the equivalent of Matlab's convhulln() function. It takes as its input a data set (with N dimensions) and returns the data points that belong to the convex hull…
Zack
  • 181
  • 1
  • 11
2
votes
0 answers

MATLAB linear separation of point sets

So I have a set of points V, which are the vertices of a convex polytope, and a separate point p. Basically, I want to check whether p is contained in V. To do so, I set up a linear program that checks whether there exists a hyperplane such that all…
Jochen
  • 21
  • 2
2
votes
2 answers

Draw arbitrary convex shape knowing the lengths of its sides

I've got a list of values, which are the lengths of the sides of an arbitrary convex shape (polygon). How can I draw this shape? What algorithm can help me with this task? For example, I have a list: 2, 5, 2, 3. The drawing has to look like this:
netgoblin
  • 659
  • 5
  • 11
2
votes
1 answer

Dynamic and/or Static Rectilinear/Orthogonal/X-Y Convex Hull

I'm looking for an efficient algorithm for handling 2D dynamic rectilinear convex hulls. I've coded up a static algorithm, but while it works in most cases, it doesn't work in all, so I'm also looking for resources on static rectilinear convex…
Nuclearman
  • 5,029
  • 1
  • 19
  • 35
2
votes
0 answers

online convex programming software

I am looking for a software which does convex optimization in an online learning way. When I have a new observation I don't want to run the optimization program from the beginning, but to update the current model based on the new observation. A…
peng
  • 33
  • 3
2
votes
1 answer

Convex optimization in Matlab

I want to solve the following optimization problem: Non-Latex: Given x and mu, find argmin_p ||x-p||_2 s.t. ||p||_2 < mu. Latex: Given $\mathbf{x}$ and $\mu$, find $\mathrm{argmin}_p \|\mathbf{x}-\mathbf{p}\|_2 \;\; \mathrm{s.t.}\;\;\|\mathbf{p}\|_2…
AnonSubmitter85
  • 933
  • 7
  • 14
1
vote
2 answers

C - Convex Polygon - Sort Point (Clockwise)

I have a convex polygon expressed by points. Points are expressed by array of x-coordinates and array of y-coordinates. For example: X = {6, 1, 5, 0, 3} Y = {4, 0, 0, 4, 6} How can I sort this points by clockwise? Number of points is not always the…
Nanik
  • 603
  • 1
  • 12
  • 19
1
vote
0 answers

What is the need of this outer while loop while finding upper tangent of two convex Hull

Below is the code, where inda and indb are rightmost point of polygon a and leftmost point of polygon b accordingly. Both the polygons are sorted in counter clockwise. Orientation is a function that checks orientation of 3 point. bool done =…
Sneh Raval
  • 21
  • 2
1
vote
1 answer

PolyData with nonconvex polygons

Just to replicate the error, let's consider the succession of points describing a nonconvex polygon: [0. , 0. , 0. ], [1. , 0. , 0. ], [1. , 0.5, 0. ], [0.5, 0.5, 0. ], [0.5, 1. , 0. ], [1. , 1. , 0. ], [1. , 1.5, 0. ], [0. , 1.5, 0. ] This data…
Franco Milanese
  • 402
  • 3
  • 7
1
vote
0 answers

Optimal Way of Verifying a 3D Mesh Convex

There are numerous questions on stack overflow similar to this problem already, but most are creating a convex hull, or checking in 2D Space. I already have created an algorithm to create a 3D Convex Hull given the original Mesh's vertices, and…
1
vote
2 answers

Determine if mouse is moving clockwise/counterclockwise, OR NOT, beyond a given threshold

Using a polygon area calculation, it's incredibly simple to determine if a buffer of x,y mouse coords is technically, mathematically moving clockwise, or counterclockwise: let dir = Math.sign(coords.reduce((prev, coord, i) => prev + …
queviva
  • 11
  • 2
1
vote
0 answers

how to initiate a convex set in matrix given its limit points?

Suppose I have a n-d matrix representing the space and elements set is representing the limit points of a convex set. How to set all elements in this convex set (i.e. pt as convex combination of elements set already) efficiently? My current approach…
1 2
3
9 10