This file contains hidden or 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
import cv2 | |
class DrawText: | |
def __init__(self, img, text, font_scale = 1, posX = 10, posY = 10, font = cv2.FONT_HERSHEY_PLAIN, bgColor = (255, 255, 255), textColor = (0, 0, 0), fontThickness = 1, padding = 2): | |
self.font_scale = font_scale | |
self.font = font | |
rectangle_bgr = bgColor | |
# set some text | |
self.text = text | |
# get the width and height of the text box |
This file contains hidden or 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
# install dependencies | |
sudo apt-get update | |
sudo apt-get install -y build-essential | |
sudo apt-get install -y cmake | |
sudo apt-get install -y libgtk2.0-dev | |
sudo apt-get install -y pkg-config | |
sudo apt-get install -y python-numpy python-dev | |
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev | |
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev | |