Displace X-Y on centroid [closed]
Hello! I'm doing a project where I want a robot to pick up a part on the middle of the biggest area of my part. I was hoping I could be lucky the the centroid returned from cv2.moments would return the center of mass on exactly this spot but I'm afraid that is not the case.
All my parts in the image are rotated different from one another. Can I somehow modify the Moments returned values in that way that I displace the centroid a set of pixles?
Red dot is the centroid
unfortunately, the center of mass seems to be entirely correctly calculated in your image.
maybe the problem is, that you did not want that ? (think of an U. the center of mass is not part of the letter)
Yes, I agree, it is correctly calculated. But is there a way to move the centroid, as like 20px in X and 30px in Y?
you would need to know the orientation then.