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
3
votes
0 answers

How to detect fingers using OpenCV?

I'm trying to detect the hand and fingers in an image using OpenCV in python. This is the code I'm using: import cv2, random, math import numpy as np import matplotlib.pyplot as plt import time def calculateAngle(far, start, end): a =…
khadoudj
  • 143
  • 1
  • 1
  • 9
3
votes
3 answers

How to get uniformly distributed points in convex hull?

Given a set of points, points = np.random.randn(...) # n 3d points I would like to uniformly fill the volume defined by the convex hull in which they lie by a list (np.array of shape nx3) of 3d points. I can get the convex hull by hull =…
Gulzar
  • 23,452
  • 27
  • 113
  • 201
3
votes
1 answer

Li Chao tree vs Convex hull trick. Which should be preferred and when?

I am having difficulty understanding the Convex hull trick. Li chao tree is way easier to understand. Is it important to understand the Convex hull trick too?
Chaos
  • 33
  • 4
3
votes
1 answer

How to find a specific point on a contour in opencv/python

I have used opencv to create some contours, and I need to identify a specific point on a contour, which is usually the innermost point of a 'V' shape. In the attached image, the point I want to identify is shown by the green arrows. On the left is…
ennjaycee
  • 31
  • 4
3
votes
3 answers

Convex Hull For User-Drawn Circle

I'm working on a game in which I must find the convex hull for a set of points. I'm trying to choose the right algorithm. The sets of points are user-drawn shapes, so there is an order to them. Ideally, the user draws an ellipse, but they can draw…
retrovius
  • 782
  • 1
  • 10
  • 25
3
votes
1 answer

How Convexity Defect is calculated in OpenCV?

What is the algorithm used in OpenCV function convexityDefects() to calculate the convexity defects of a contour? Please, describe and illustrate the high-level operation of the algorithm, along with its inputs and outputs.
Crazy Cat
  • 186
  • 3
  • 13
3
votes
2 answers

Combine contours vertically and get convex hull - opencv - python

I have character images like this: After getting contours and convexHull the output is like this: For that I used following code: import cv2 img = cv2.imread('input.png', -1) ret, threshed_img = cv2.threshold(cv2.cvtColor(img,…
Ishara Madhawa
  • 3,549
  • 5
  • 24
  • 42
3
votes
1 answer

Vertices of the convex hull of n-dimensional point set

I have a given set of points in dimension n. Of these I want to find those, which are the vertices (corners) of the convex hull. I want to solve this with Python (but may call other programmes). Edit: All coordinates are natural numbers. As output I…
Hennich
  • 682
  • 3
  • 18
3
votes
1 answer

Hulls merging in opencv

Suppose you have two hulls H1 and H2 and you want to merge them into H. (See the picture). Is there an algorithm on that? Maybe opencv has one already built-in? Could anyone provide a code snippet? Thanks!!!
Laimonas Sutkus
  • 3,247
  • 2
  • 26
  • 47
3
votes
1 answer

how to compute convex hull image/volume in 3d numpy arrays

I wonder if there are any numpy based tools that can: given a binary input numpy image in 3D, find its convex hull; and return a list of indices or similar of the voxels (3D pixels) that are within this 3D convex hull. One possibility is to use…
galactica
  • 1,753
  • 2
  • 26
  • 36
3
votes
2 answers

How to find/create Convex hull of GPS points in Javascript

I have a GPS cluster (contains many GPS points which are close to each other) and I want to identify it as a place by creating a polygon around its outer points. One way is Convex Hull and I am looking for its implementation in Javascript. Any idea?
Zaheer
  • 374
  • 4
  • 20
3
votes
1 answer

Raster file with NAs as areas out of a environmental convex hull

I am asking for your R skills' support. For one of my papers, I am modelling the distribution of tree species in Amazonia using remote sensing variables (LT band 3, 4, 5, 7, DEM and NDVI) and I am planning to mask out all the sites out of the…
3
votes
1 answer

Concave Hull taking all points of the polygon on the boundary

In my work, I have to enclose some random group of points in a boundary. Convex hull was taking extra space and was not tightest shape so I modified it to relax the edges in following way: i) Draw convex hull for the given number of points. ii) Now…
Mojo Jojo
  • 356
  • 3
  • 14
3
votes
1 answer

Picture Convex hull in 3D Scatter Plot

I followed the tutorial about 3D visualization using the package "rgl" here So I was able to draw a 3D Scatter Plot with "iris" data and create an ellipsoid surrounding 95 % of the data points: library("rgl") data(iris) x <- sep.l <-…
ossesso
  • 33
  • 4
3
votes
1 answer

Identify and sort multiple circles on 2d plane using python

I have multiple points forming many circles on a 2d plane and need to identify and sort them for further calculation. I have the [x, y] co-ordinates of each point and a number representing each point. All point numbers in one circle should be sorted…