Finding Top Left and Bottom Right Points (C++)

青春壹個敷衍的年華 提交于 2019-12-02 05:34:11

Based on your comment that bottom left is min(x+y) and top right is max(x+y)

Top left: min(x+max(y)-y)

Bottom right: max(max(x)-x+y)

Where the inner max is a constant.

Though this may not always give a result that agrees with your eyes.

Alternative metrics can be constructed based on the distance from the corners of the bounding box of your object, or the square of the distance, etc.

Another technique is to translate the polygon around the origin and then top left is the point furthest from the origin but in the top left quadrant... That gives a whole heap of choices as to where to put (0,0) could be average of all, could be weighted average based on some rule, etc. lot of variability in how you pick that, each may give results that differ for a very small number if polygons from what the eye would pick.

Finally you could always train a neural network to pick the answer.... That might result in something that is (insert confidence limits from training)% likely to give an answer you agree with... But you and I may disagree

Top left: min(x+max(y)-y)

Bottom right: min(max(x)-x+y)

Where the inner max is a constant.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!