In this post, i will present you the new progress of object recognition using openCV—angle recognition.
Actually, this is just a small step further than the last one which is rectangles’ recognition. From the four outlines of rectangle as well as the four corner points, we can get two relative points to calculat the angle between them. As inllustrated below, i chosed two points which are most left and right. Once the position of these two points are captured, the SINE value of the angle can be calculated like this
SIN (angle) = abs(p1.y-p2.y)/sqrt( (p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y))
So, that’s it.
25 Comments On “ Angle recognition using openCV”