I am pretty new to using openCV and this might be a silly question.
I will talk in reference to the picture above. So my problem statement is to draw bounding boxes around all the text elements. Conveniently I can get that information from the json file of the image. So I can get x, y, w and h from json and use cv2.rectangle(img1, (x, y), (x + w, y + h), (255, 255, 255), 2)
The issues is in the json file, for rotated text, it just provides the rotation angle and not the co-ordinates for the rotated rectangle. For example from the image above, for 'yourwebsite.com', x, y, w and h is given and rotation is -90 degrees. I did some basic w, h = h, w to get the bounding box for that. But what should I do when the degrees is like 60 ro 80. Is there any function or method to get the coordinates of rotated bounding boxes?
In this case the flash sale is tilted at an angle of -22 degrees. But the x, y, w and h is provided for the white rectangle on top not covering anything. It needs to be tilted by a particular angle as mentioned in the json file to be over the FLASH SALE area. x and y always represents the top left corner of the bounding box.
Thank you in advance!