Fixing index out of range

This commit is contained in:
Endre Simo
2019-02-05 06:52:56 +02:00
parent e211d446ef
commit 4d56440cb9

View File

@@ -52,10 +52,8 @@ while(True):
ret, frame = cap.read()
pixs = numpy.ascontiguousarray(frame[:, :, 1].reshape((frame.shape[0], frame.shape[1])))
# Check if camera is intialized by checking if pixel array is not empty.
if not numpy.any(pixs):
continue
# Verify if camera is intialized by checking if pixel array is not empty.
if numpy.any(pixs):
dets = process_frame(pixs) # pixs needs to be numpy.uint8 array
if dets is not None:
for det in dets: