I'm trying to draw a convex hull on random points but I have to do this using with opencv - not convexhull command or scpiy
or hull
lib)
First step, I create random points between 14 - 20 numbers.
However, I need something like this.
How can I save the plt.show() resultant graphic and draw convex hull like that?
Here's my code:
import random
import matplotlib.pyplot as plt
import cv2
points = []
points_limit = 12+random.randint(0, 7)
print(points_limit)
for x in range(points_limit):
points.append([random.randint(0, 9),random.randint(0, 9)])
print(points)
for point in points:
plt.scatter(point[0],point[1], color='k', s=100)
print(points)
plt.show()