ageitgey / ageitgey/face_recognition
OpenCV(4.2.0) /Users/travis/build/skvark/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp:730: error: (-215:Assertion failed) !buf.empty() in function 'imdecode_'
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 56.8k
- Forks
- 13.7k
- PR merge metrics
- No merged PRs in 30d
Description
- face_recognition version:
- Python version:
- Operating System:
I am trying to Process Android phone live stream using OpenCV and Python
This is my code:
import requests
import cv2
import numpy as np
url = "http://192.168.1.14:8080/shot.jpg"
while True:
img_resp = requests.get(url)
img_array = np.array(bytearray(img_resp.content), dtype=np.uint8)
img = cv2.imdecode(img_array, -1)
cv2.imshow("Wireless Attendance Recorder Cam", img)
if cv2.waitkey(1)==27:
break
This is my error:
error Traceback (most recent call last)
in
9 img_resp = requests.get(url)
10 img_array = np.array(bytearray(img_resp.content), dtype=np.uint8)
---> 11 img = cv2.imdecode(img_array, -1)
12
13 cv2.imshow("Wireless Attendance Recorder Cam", img)
error: OpenCV(4.2.0) /Users/travis/build/skvark/opencv-python/opencv/modules/imgcodecs/src/loadsave.cpp:730: error: (-215:Assertion failed) !buf.empty() in function 'imdecode_'
Please help me!!!!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the requests.get and cv2.imdecode calls shown in the issue, checking whether the Android stream response contains image data before decoding. Reproduce the request against the provided URL and determine whether the response is empty or not an image. The issue is done only when the source of the failed decode is identified and a project-relevant fix or clear reproduction is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- opencv, python
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100