skip to Main Content

Visual Studio Code – Can't run code in VSCode but can outside it

import cv2 data_cara = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') """imagem = cv2.imread('cara.jpg')""" camera = cv2.VideoCapture(0) while True: leitura_frame_sucesso, frame = camera.read() frame = cv2.flip(frame, 1) imagem_cinza = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) coordenadas_cara = data_cara.detectMultiScale(imagem_cinza) for (x, y, w, h) in coordenadas_cara: cv2.rectangle(frame, (x, y), (x+w, y+h),…

VIEW QUESTION

cv2.waitKey(0) blocks the program – Ubuntu

Here is a simple script: import cv2 img = cv2.imread("img.png", 0) cv2.imshow("Test", img) print("Before") cv2.waitKey(0) print("After") After closing the Test window, the output of terminal was like: $ python test.py Before It seems that cv2.waitKey(0) blocks the program and I…

VIEW QUESTION

How to build Opencv code in a docker file

I want to build and run a c++ opencv code using docker. Here is my dockerfile: FROM nvidia/cuda:11.5.0-cudnn8-runtime-ubuntu20.04 FROM ubuntu ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y g++ git wget cmake sudo RUN apt-get install -y build-essential cmake…

VIEW QUESTION
Back To Top
Search