ageitgey / ageitgey/face_recognition

opencv读取图像报错:352 环境为win10+pycharm+python3.7+opencv4.1.0 ,希望得到解决

Open
#902 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
56.8k
Forks
13.7k
PR merge metrics
No merged PRs in 30d

Description

import cv2 as cv
import numpy as np

print("-------hello python---------")
scr = cv.imread(r"C://Users//ASUS//Pictures//Saved Pictures//d.jpg")
cv.namedWindow("input image", cv.WINDOW_AUTOSIZE)
cv.imshow("input image", scr)
cv.waitKey(0)

cv.destroyAllWindows()

报错:cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the provided Python snippet in the stated Windows, Python 3.7, and OpenCV 4.1.0 environment, starting with the cv.imread call and the resulting value passed to cv.imshow. Done means identifying why the image cannot be displayed and documenting a verified resolution; no repository file or test is named.

Written by the indexing model from the issue text.

Assessment

Tech stack
opencv, python
Domain
computer-vision
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.