show video and texts on single window
Hi, I would like to show a video stream and sensors data to same window. But video should be displayed in Left half of the LCD and Sensors data should be displayed on right half of the LCD.
I am using 800x480 resolution LCD to display. I could show video and text on same video using opencv. But I don't have idea about above thing.
Please be needful.
I am newbie to opencv, so might be couldn't explain you clearly. Please find below code till now.
import cv2
import sys
import numpy as np
import logging as log
import datetime as dt
from time import sleep
import imutils
log.basicConfig(filename='webcam.log',level=log.INFO)
b,g,r,a = 0,255,0,0
video_capture = cv2.VideoCapture(0)
anterior = 0
while True:
if not video_capture.isOpened():
print('Unable to load camera.')
sleep(5)
pass
# Capture frame-by-frame
ret, frame = video_capture.read()
frame = imutils.resize(frame, width=800,height=480)
text = "Hello"
cv2.putText(frame,text,(100,100),cv2.FONT_HERSHEY_SIMPLEX, 1.5, (b,g,r),1,cv2.LINE_AA)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# Display the resulting frame
cv2.imshow('Video', frame)
# When everything is done, release the capture
video_capture.release()
cv2.destroyAllWindows()
Thanks in advance. Jitendra