Hi,
I am giving a video file as an input to detectnet-video.py.
It works fine if I give an .avi file which has resolution of 320x240.
But it is not working for the same file which is in .mp4 file format. I am getting the below error,
frame_rgba = cv2.cvtColor(frame, cv2.COLOR_BGR2RGBA)
cv2.error: OpenCV(4.2.0-dev) /home/jetbot/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function ‘cvtColor’
Let me know if there is a limitation to use only .avi file?
What is the solution for the above error?
Below is my code.
cam= cv2.VideoCapture(“/home/jetbot/models/research/object_detection/easy.mp4”)
while display.IsOpen():
ret, frame = cam.read()
print('frame:',ret,frame)
frame_rgba = cv2.cvtColor(frame, cv2.COLOR_BGR2RGBA)
width = frame.shape[1]
height = frame.shape[0]
img = jetson.utils.cudaFromNumpy(frame_rgba)
detections = net.Detect(img, width, height, opt.overlay)