cap = cv2.VideoCapture(0)
while True:
success, img = cap.read()
imgRGB = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
cv2.imshow("Application", img)
cv2.waitKey(1)
it works well.
but it is throwing an error when I run same code with the help of droidcam
I change code to
cap = cv2.VideoCapture("http://192.168.43.1:4747/mjpegfeed?640x480")
and When I try to run my CV2 python code with droidcam I am getting error which is:
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Traceback (most recent call last):
File "test.tracker.py", line 29, in <module>
imgRGB = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
cv2.error: OpenCV(4.5.3) /tmp/pip-req-build-afu9cjzs/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
and I am using Ubuntu(Linux)
so Thank you in advance
for your help