Just figured out that the function cap.read()
-where cap = cv2.VideoCapture(0)
returns not only a boolean but also an array as well packaged up with the boolean in a list.
I ran this:
import cv2
cap = cv2.VideoCapture(0).read()
print(cap)
and it outputted:
(True, array([[[ 36, 44, 41],
[ 38, 46, 39],
[ 42, 49, 38],
...,
[142, 138, 128],
[143, 138, 131],
[144, 139, 132]],
[[ 38, 46, 43],
[ 38, 46, 39],
[ 40, 47, 36],
...,
[144, 140, 130],
[143, 138, 131],
[142, 137, 130]],
[[ 31, 38, 37],
[ 35, 43, 38],
[ 38, 47, 36],
...,
[142, 143, 131],
[141, 142, 130],
[139, 140, 128]],
...,
[[ 87, 87, 87],
[ 89, 89, 89],
[ 87, 87, 87],
...,
[ 11, 13, 3],
[ 13, 15, 5],
[ 13, 15, 5]],
[[ 87, 89, 91],
[ 87, 89, 91],
[ 87, 89, 91],
...,
[ 9, 11, 1],
[ 9, 14, 3],
[ 9, 14, 3]],
[[ 87, 89, 91],
[ 86, 88, 90],
[ 87, 89, 91],
...,
[ 8, 10, 0],
[ 9, 14, 3],
[ 10, 15, 4]]], dtype=uint8))