Skip to content

Instantly share code, notes, and snippets.

@yptheangel
Created October 21, 2019 08:44
Show Gist options
  • Save yptheangel/8a02f429f3a5aa127bfdcafc3d5d155f to your computer and use it in GitHub Desktop.
Save yptheangel/8a02f429f3a5aa127bfdcafc3d5d155f to your computer and use it in GitHub Desktop.
draw_text_with_background_opencv
int baseline[]={0};
Size textSize=getTextSize("Hello World", FONT_HERSHEY_DUPLEX, 1,1,baseline);
int textwidth=textSize.get(0);
int textheight=textSize.get(1);
rectangle(yourMat, new Point(x1 + 2, y2 - 2), new Point(x1 + 2+textwidth, y2 - 2-textheight),RGB(255,255,0), FILLED,0,0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment