I want to calculate the ratio of detected rectangle from many images by two detector based on deep learning. for example with below picture, firstly, the first detector detects big circles (c1 and c2), and the second detector detects small circles (d1 and d2). Now, first detector returns the coordinates of c1 and c2, second detector also those of d1 and d2.
So I want to make the function and code that can calculate the ratio d1/ c1 and d2 / c2 automatically. so, my idea is that if coordinate of small one(e.g. d1, d2) is included in corresponding big one (e.g. c1, c2), they are matched for calculation of ratio.
c1 coordinate (xmin, ymin, xmax, ymax) : (10, 10, 30, 30) d1 coorinate : (13, 15, 20, 23)
c2 coordinate : (20, 20, 40, 40) d2 coordinate : (25, 24, 32, 33)
But, I don't know many function of OpenCV and python. Could you please make some code, function or recommend library?
Thank you