-
Notifications
You must be signed in to change notification settings - Fork 922
Open
Description
I have the following code:
def getImg(url):
request = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})
return cv2.imdecode(np.frombuffer(request.read(), dtype=np.uint8), cv2.IMREAD_GRAYSCALE)
However, I'm encountering the following error whenever cv2.imdecode()
is used.
OpenCV(4.12.0) D:\a\opencv-python\opencv-python\opencv\modules\flann\src\miniflann.cpp:338: error: (-5:Bad argument) Only continuous arrays are supported in function 'cv::flann::buildIndex_'
This doesn't happen when an image file is passed instead. The process is almost identical wherein a file buffer is passed to cv2.imdecode()
. Am I missing something?
Metadata
Metadata
Assignees
Labels
No labels