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
Is your feature request related to a problem? Please describe.
When using draw_boxes with a prediction that has a y value that is close to the top of the box the text will either get clipped or disappear entirely.
Describe the solution you'd like
Only when this happens should the text be rendered on the inside of the box.
Describe alternatives you've considered
I have copied the function to my code and addressed this which is a workaround, but I think the library should generally support this case:
# If the box is too close to the top of the frame, draw the text# on the inside of the box instead of the outsidetext_x_anchor=points[0, 0] -thickness//2text_y_anchor=points[0, 1] -thickness//2-1iftext_y_anchor<0:
text_dimensions, _=cv2.getTextSize(text, cv2.FONT_HERSHEY_SIMPLEX, text_size, text_thickness)
text_y_anchor=points[0, 1] +thickness//2+int(text_dimensions[1]) +1text_anchor= (text_x_anchor, text_y_anchor)
frame=Drawer.text(
frame,
text,
position=text_anchor,
size=text_size,
color=obj_text_color,
thickness=text_thickness,
)
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
When using draw_boxes with a prediction that has a
y
value that is close to the top of the box the text will either get clipped or disappear entirely.Describe the solution you'd like
Only when this happens should the text be rendered on the inside of the box.
Describe alternatives you've considered
I have copied the function to my code and addressed this which is a workaround, but I think the library should generally support this case:
The text was updated successfully, but these errors were encountered: