Getting angles from convex points

I wrote an algorithm to extract the points shown in the image. They form a convex shape, and I know their order. How to extract angles from these points (upper and lower 3)? I am using opencv.

box

+3
source share
2 answers

if you already have a convex hull of the object, and the case includes corner points, then all you need to do is simplify the case until it has only 6 points.

There are many ways to simplify polygons, for example, you can simply use this simple algorithm used in this answer: How to find the angular coordinates of a rectangle in an image

do
   for each point P on the convex hull: 
       measure its distance to the line AB _ 
       between the point A before P and the point B after P, 
   remove the point with the smallest distance 
repeat until 6 points left

, ,

Ramer-Douglas-Peucker, , openCV cv:: approxPolyDP.

openCV, 6 4

+4

, , , , , ?

Harris. OpenCV cv:: cornerHarris.

, , ( x y).

2 2 structure, .

+1

All Articles