I'm trying to find the pixel values of the corners of these triangles. I can use Harris corners and obtain a numpy array of all the x,y for the corners. I want these corner values to be stored in a 2D list called corners like [[x1,y1], [x2,y2], [x3,y3]].
Also, when I use Harris corners on a black triangle(code posted below), white background, the results are as such (array([121, 121, 122, 122, 123, 123, 124, 124, 359, 359, 359, 359, 359, 359, 360, 360, 360, 360], dtype=int64), array([240, 241, 240, 241, 240, 241, 240, 241, 121, 122, 123, 358, 359,360, 121, 122, 359, 360], dtype=int64)). I need to create the 2D list of 3 corners from this list.
img = cv2.imread(filePath)
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
gray = numpy.float32(gray)
dst = cv2.cornerHarris(gray,2,3,0.04)
x,y = numpy.nonzero(dst > 0.01 * dst.max())
connectedComponentsWithStats(). - alkasm