Last active
October 21, 2019 09:20
-
-
Save yptheangel/9cbdce42775afd1fe7a28a9e9c98a0e9 to your computer and use it in GitHub Desktop.
draw_text_with_background_opencv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
putText(yourMat, "Hello World", new Point(x1 + 2, y2 - 2), FONT_HERSHEY_DUPLEX, 1, RGB(0,0,0)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment