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

后端 未结 2 432
难免孤独
难免孤独 2021-01-24 05:33

I\'m looking for some help with a project I\'m working on.

What I\'m doing is a polygon approximation algorithm. I\'ve got all of the points of my boundary, but in orde

相关标签:
2条回答
  • 2021-01-24 06:04

    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

    0 讨论(0)
  • 2021-01-24 06:04

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

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

    Where the inner max is a constant.

    0 讨论(0)
提交回复
热议问题