반응형
** 파이썬에서 opencv를 이용하여 이미지에 text를 삽입하는 방법!! **
See the following cold.
cv2.putText(image, "Hello. world!!", bottomLeftOrigin, fontFace, fontScale, textcolor)
. image : numpy array of size [img_height, img_width, img_depth]
. "Hello. world!!" : This will be displayed.
. bottomLeftOrigin : for example, if you set (10, 10), bottom left corner of "H" character will be placed at (10, 10).
. fontFace : Possible choices
cv2.FONT_HERSHEY_COMPLEX
cv2.FONT_HERSHEY_COMPLEX_SMALL
cv2.FONT_HERSHEY_DUPLEX
cv2.FONT_HERSHEY_PLAIN
cv2.FONT_HERSHEY_SCRIPT_COMPLEX
cv2.FONT_HERSHEY_SCRIPT_SIMPLEX
cv2.FONT_HERSHEY_SIMPLEX
cv2.FONT_HERSHEY_TRIPLEX
cv2.FONT_ITALIC
. fontScale: 1 is the basic size. If you set 2, the characters of size (the basic size x 2) will be displayed.
. textcolor: put some integer value.
'Opencv' 카테고리의 다른 글
how to read/save an image as bmp in python (0) | 2017.08.11 |
---|---|
how to put text message on images using opencv library on C (0) | 2017.08.10 |
How to use SEEDS for superpixel segmentation (0) | 2017.07.19 |
[opencv] how to install opencv on ubuntu (0) | 2017.07.18 |
[opencv] how to install opencv for python under anaconda+window10 (0) | 2017.07.18 |