Midpoint on my line is wrong
Hey guys, i'm trying to get the midpoint of my line using this code but it seems wrong. Can anyone advice me please?
M = cv2.moments(ske)
centroid_x = int(M['m10']/M['m00'])
centroid_y = int(M['m01']/M['m00'])
cv2.circle(ske,(centroid_x,centroid_y), 5, (127,0,0), -1)
why do you think, this is the wrong result ?
hey, i tried reducing the circle to radius 1 but it shows that my midpoint is above the white pixel line
the center of mass of a line (that's what you calculate) is not nessecarily on the line (think of an U or an O)
(mass center != midpoint)
Is there another way i can find midpoint of the line? please advice