You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry, but leptonica doesn't support rotated boxes. An unrotated box has 4 parameters (e.g, UL and LR corners, or UL corner, width and height); a rotated box has 5 because it also has to specify the rotation angle.
You could find the rotation angle for each box separately by choosing rotation angles as with the skew detection function, and doing the search, finding the angle that minimizes the area of the bounding rectangle.
The only data structure in leptonica that can be used to hold arbitrary quadrilaterals is a Pta, where 4 points are used to store each quad. This is used in some functions in boxfunc4.c, but it doesn't directly help with rotated rectangles.
I want to get a compact box of the black pixs in the pic below:
It is easier to get horizontal boxes using leptonica like this, but it is not compact.
the pic below is what I want:
opencv provide a function: cv::minAreaRect to achieve this, but how can I implement it with leptonica?
The text was updated successfully, but these errors were encountered: