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
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