i created an AR aruco marker programm. My table has four markers in every corner one. Now i want to create a rectangle which bounds the four markers. I already have the coordinates of every point i want to connect them. Problem ist when i use cv2.createpolyline the function does not connect them in the right order. I now wanted to create a numpy array which inserts the coordinates of the marker if it is detected. And when all four a detected the polyline should be drawn. This is my code so far:
if id == [0]:
outline_poly = np.insert(outline_poly, 0, tl)
if id == [1]:
outline_poly = np.insert(outline_poly, 1, tr)
if id == [2]:
outline_poly = np.insert(outline_poly, 2, bl)
if id == [3]:
outline_poly = np.insert(outline_poly, 3, br)
For example: if marker with the ID = 0 is detected the coordinates of the point top left (tl) are inserted to the array. The code above is part of an loop which only checks one ID in every loop. So it would be awesome when ID0 is detected the coordinates of that point are in the first row ID1 in the second, id2 in the third,...
Hopefully that is understandable. Thank you very much.