How to check if four points form a rectangle

后端 未结 4 1796
隐瞒了意图╮
隐瞒了意图╮ 2021-02-14 15:52

I am working on a shape recognition app. At this moment a set of points (x,y) is determined by corner detector (red points, img. 2.). Four of these points (in red frames, img. 2

4条回答
  •  无人共我
    2021-02-14 16:27

    Consider you should have got number 8 but you got number 7, then you are going to add number 1 (called delta or error correction) to correct it.

    In a similar manner have a delta rectangle coordinates to correct the rectangle. Check that point(coordinate) falls inside delta rectangle.

    The rectangle coordinates are as mentioned below:

    x+delta,y+delta
    x-delta,y+delta
    x+delta,y-delta
    x-delta,y-delta
    

    Let me know if this works fine for you or if you find a better solution

提交回复
热议问题