The "estimate_orientation" contains some bugs #1616
Replies: 1 comment
-
Hi @WalidHadri-Iron 👋, If you test with rotated samples i highly suggest to test it with one of the We are always happy about new contributors so if you have optimizations in mind would you like to open a PR where we can iterate on ? :) FYI: The current workflow works only for rotations in range -90 - 90 (no upside down) but we have already started to work on that support (only waiting for the TF models atm) --> https://github.com/mindee/doctr/pull/1553/files Best regards, |
Beta Was this translation helpful? Give feedback.
-
Hi,
I was looking at the estimate_orientation function, I took the segmentation map for words given by a detector (db_restnet) passed it to the
estimate_orientation
but didn't get the correct angle even on easy examples. So I did some digging in the function, I found out that are some issues (I might be wrong or misunderstood things):_, (w, h), angle = cv2.minAreaRect(contour)
, we assume after that w>h for horizontal lines, which is not all the time True, as thecv2.minAreaRect
for the same countour could return w, h flipped with an angle difference of 90.Let me know if you need more details or clarification, but to my findings the first point and second point are really messing up the function.
Beta Was this translation helpful? Give feedback.
All reactions