Skip to content

A python wrapper for the minimal area enclosing triangle algorithm included in OpenCV

License

Notifications You must be signed in to change notification settings

Nicolas-bch/pymintriangle

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pymintriangle

A python wrapper for the minimal area enclosing triangle algorithm available here, which was included in OpenCV. This wrapper is adapted from the OpenCV implementation.

Prerequisites

  • python >= 3.6
  • pybind11 >= 2.3.0

Install

pip install .

Usage

In python import the module and use the compute method to compute the minimal area enclosing triangle.

import numpy as np
import pymintriangle
from scipy.spatial import ConvexHull

points = np.random.rand(20, 2)
convex_hull = ConvexHull(points)
triangle = pymintriangle.compute(points[convex_hull.vertices])

Documentation

compute

Computes the minimal area triangle of set of points making a convex hull.

Parameters

convexHull : (Mx2) array
The coordinates of the points making the convex hull.

Returns

triangle : (3x2) array
The coordinates of the points of the triangle.

About

A python wrapper for the minimal area enclosing triangle algorithm included in OpenCV

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 92.2%
  • Python 7.8%