Category : cv2

This code generates (index error: invalid index to scalar variable) at line i = i[0] import cv2 import numpy as np thres = 0.45 # Threshold to detect object nms_threshold = 0.2 cap = cv2.VideoCapture(0) classNames = [] classFile = ‘coco.names’ with open(classFile, ‘rt’) as f: classNames = f.read().rstrip(‘n’).split(‘n’) configPath = ‘ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt’ weightsPath = ‘frozen_inference_graph.pb’ ..

Read more

I am learning the basics of OpenCV and while running the following piece of code in google colab, it gives an error. from google.colab.patches import cv2_imshow import cv2 img=cv2.imread("geeks14.png") cv2_imshow(img) The error is AttributeError Traceback (most recent call last) in () 2 import cv2 3 img=cv2.imread("geeks14.png") —-> 4 cv2_imshow(img) /usr/local/lib/python3.7/dist-packages/google/colab/patches/init.py in cv2_imshow(a) 20 image. 21 ..

Read more