In my project I am using orientated Bounding Box to fit it to my objects in my binary image.
The oriented bounding box is taken from the algorythm in this link :
And on my images it looks like this:
In my project i need to find the coordinates of the each corner of each bounding Box.
So i set coordinates from the function i mentioned to the output of the function, and i saved them in a structure and it looks like this:
And [ vx(k),vy(k)] are the coordinates of 4 corners of bounding box.
But my problem is, for different images the order of coordinates is changing. What i mean is , in one case the first coordinate [vx(1),vy(1)] is the coordinate of top left corner of bounding box, second coordinate is the coordinate of top right, etc..
But in the other case, the first coordinate can be the coordinate of bottom right corner, second coordinate can be coordinate of the top left, etc..
My question is, how can i determine the output of the function so that these coordinates are regular, so that first coordinate ALWAYS responds to one corner, second ALWAYS to the other , third and fourt too.
If anyone has idea how to perform it, I'd be very grateful.
Other solution could be using some mathematical conditions based on the values of both x and y, but its quite hard for me to work out.