I have a set of boundary points of an object.
I want to draw it using opencv as contour.
I have no idea that how to convert my points to contour representation.
To add to Cherif KAOUA's answer, I found I had to convert to list and zip my numpy array. Reading in an array of points from a text file:
contour = []
with open(array_of_points,'r') as f:
next(f) // line one of my file gives the number of points
for l in f:
row = l.split()
numbers = [int(n) for n in row]
contour.append(numbers)
ctr = np.array(contour).reshape((-1,1,2)).astype(np.int32)
ctr = ctr.tolist()
ctr = zip(*[iter(ctr)]*len(contour))