EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

iitdpooja opened this issue · 0 comments

I am trying to put two videos in a single frame.
But I am getting Type Error. Please check below code.

import cv2
import numpy as np
cap1=cv2.VideoCapture('first.avi')
cap2=cv2.VideoCapture('fourth.avi')
fps = cap1.get(cv2.CAP_PROP_FPS)
global Video_h
global Video_w
Video_h = cap1.get(cv2.CAP_PROP_FRAME_HEIGHT)
Video_w = cap1.get(cv2.CAP_PROP_FRAME_WIDTH)
while (True):
frame=np.zeros([int(2Video_h),int(3Video_w),3], dtype=np.uint8)
ret,frame1=cap1.read()
ret,frame2=cap2.read()
frame[0:int(Video_h),0:int(Video_w)] = frame1
frame[0:int(Video_h),int(Video_w)-200:int(Video_w*2)-200] = frame2
cv2.namedWindow("window", cv2.WND_PROP_FULLSCREEN)
#cv2.setWindowProperty("window",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)
cv2.imshow("window", frame)
if cv2.waitKey(1) & 0xff == ord('q'):
break

below error is coming:
Traceback (most recent call last):
File "c:/Users/shiva/Documents/Python/test.py", line 15, in
frame[0:int(Video_h),int(Video_w)-200:int(Video_w*2)-200] = frame2
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'