Convexity Defects is a feature extraction technique that can be used to help in human action recognition by computing silhouettes of subjects using a morphological algorithm.
Questions tagged [convexity-defects]
22 questions
14
votes
4 answers
How to crop away convexity defects?
I'm trying to detect and fine-locate some objects in images from contours. The contours that I get often include some noise (maybe form the background, I don't know). The objects should look similar to rectangles or squares like:
I get very good…

Micka
- 19,585
- 4
- 56
- 74
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)…

Lucas Miranda
- 80
- 8
4
votes
0 answers
Why is my convexity defect OpenCV in Android getting error?
I'm beginner in Android development and newbie in OpenCV too. I have project about hand gesture recognition in Android. I want to do convexity defect on it. Before I do convexity defect, I should have done finding contour and convex hull. I have…

ichaka
- 37
- 3
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
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
2
votes
1 answer
Python's cv2 convex defects distances are too large?
UPDATE: it seems like the ratio between the distances I calculate myself and the distances returned by cv2 is exactly 256. This is not surprising, since looking at their code (line 394 here) shows the distances in pixels get multiplied by 256. I…

liorr
- 764
- 5
- 21
2
votes
0 answers
The best fit triangle in cv2
TLDR: I am looking to fit a triangle to a boomerang-shaped object in order to detect its "head", potentially using python's opencv.
I have a collection of boomerang-shape objects (see image below), whose size and internal angles vary. Additionally,…

liorr
- 764
- 5
- 21
1
vote
0 answers
Image Processing: Quantifying roughness of a shape compared to a smooth shape
I am trying to find the roughness of shapes in an image. I have found the contours and used simplification.cutil.simplify_coords_vwp(contour,1000) to calculate a polygon that I want to use as the "smooth" shape (this is similar to the more commonly…

Cameron Greenwalt
- 47
- 8
1
vote
1 answer
Metric for concavity of objects in skimage or in general in python
I have a code where at some point I get a set of 2D binary numpy arrays to represent the objects which are mainly ellipses and circles (cell nuclei)
I need a metric about how rough (jagged) the edges are. There is nuclear contour index in…

Uğur Dinç
- 303
- 3
- 16
1
vote
1 answer
Opencv:convexityDefects on largest contour gives error
I am getting this error :
OpenCV Error: Assertion failed (hpoints > 0) in cv::convexityDefects, file C:\projects\opencv-python\opencv\modules\imgproc\src\convhull.cpp, line 284
Traceback (most recent call last):
File…

TechieBoy101
- 284
- 1
- 3
- 16
1
vote
1 answer
OpenCV convexityDefects drawing
Hi. I have the above image and use the "findContours" function.
And then I use the "convexity defects" functions to find the corner points.
The result is as follows.
The problem with this code is that it can not find the rounded corners.You can…

kasra
- 55
- 7
1
vote
0 answers
How can I make convexHull work for smaller intervals?
I'm trying to find an edge defect. I'm using the pre-made function convexHull, but it skips past the defect I'm searching for. Like this:
I want the convexHull function to act in smaller intervals so that it doesn't skip past possible defects on…

Tasch
- 19
- 3
1
vote
0 answers
OpenCV: Dealing with contour vector indexing
Using the function convexityDefects takes the blob from a binary image and creates a vector with all the points surrounding my hand. This vector always begins at the Point at the highest Y location on my blob which is interfering with my ability to…

wprins
- 846
- 2
- 19
- 35
1
vote
0 answers
How to count number of fingers out of convexity defects in C++ OpenCV
I have created a program in C++ with OpenCV which is now able to recognize skin and successfully creating convex hull and convexity defects. Now I want to count the number of fingers and also is there any way to improve this code ?
What I am doing…

Deepanshu
- 488
- 6
- 18
1
vote
2 answers
OpenCV Java convexity defects (Computer Vision)
I have a problem with putting my convexity defects on the frame. To calculate them, I modified c++ source and this is what i archived:
mConvexityDefectsMatOfInt4 = new MatOfInt4();
if(contours.size() > 0 && convexHullMatOfInt.rows() > 0)
…

Marek
- 3,935
- 10
- 46
- 70