This code generates (index error: invalid index to scalar variable) at line i = i 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’ ..
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 ..
I have a file that has X lines of Y hex codes, like this: FFFFFF 123456 453623 …. 354352 5AB12A 123789 …. …… …… …… …. My final goal is to transform it in Python into OpenCV image a.k.a. NumPy array. I am also using pandas read_table as it is faster than reading via python ..
I have this picture and i want to make a binary mask from it. The main (the biggest) rectangular should be white and other parts of picture shound be black. Like this: To solve this problem I want to find a contour of main rectangular. My plan is to find all external contours. Then get ..
I have this picture and I want to make a binary mask from it. The main (the biggest) rectangular should be white and other parts of the picture shound be black. Like this: To solve this problem I want to find a contour of main rectangular. My plan is to find all external contours. Then ..
I have this code which records your screen. But I want to record what happened a few seconds ago. for example, 30 seconds ago. How do I do that? I want it to be like the function which happens when you press win key + alt + g import pyautogui import cv2 import numpy as ..
I would be grateful if someone can make it clear for me how to use cv2 functions like rectangle, instead of matplotlib functions like mpatches.Rectangle in this code: I’m a little bit confused about how to show this video using cv2 at the end. fig = plt.figure() area =  ax1f8 = fig.add_subplot(111) ax1f8.imshow(frame, cmap="gray") ..
I have a code that can identify the faces in an image file by storing the face in "osama_image" and then using that to check for the face in the image file. I need to convert it into a code that uses the same method but detects the faces in a video file using CV2 ..
I’m working on MacBook photoboith project in python (since I’m on Windows) Source: Python..
enter image description here I am new in python. Source: Python..