Error: (- 215: assertion failed)
Source code:
import cv2
img = cv2.imread('D:\Work\study\jaffe\train\happy\KA.HA1.29.tiff')
cv2.namedWindow("Image")
cv2.imshow('Image', img)
cv2.waitKey (0)
Error:
traceback (most recent call last):
file “d”:/work/study/study_ cv.py ”, line 6, in
cv2.imshow(‘Image’, img)
cv2.error: OpenCV(3.4.2) C:\Miniconda3\conda-bld\opencv-suite_ 1534379934306\work\modules\highgui\src\ window.cpp:356 : error: (-215:Assertion failed) size.width> ;0 && size.height> ;0 in function ‘cv::imshow’
Reason:
it can be seen from pychar that
here is understood as escape character
Correction:
import cv2
img = cv2.imread('D:\Work\study\jaffe\\train\happy\KA.HA1.29.tiff')
cv2.namedWindow("Image")
cv2.imshow('Image', img)
cv2.waitKey (0)
Read More:
- Unity 3D – assertion failed: assertion failed on expression: ‘! Getmaineditorwindow()’ error
- Assertion failed: Assertion failed on expression: ‘pred(* previous, *i)’
- error: (-215:Assertion failed) !ssize.empty() in function ‘resize‘
- PCL Programming Notes — assertion ` PX! = 0 ‘failed
- [Solved] Unity Error: Assertion failed on expression: ‘m_ErrorCode == MDB_MAP_RESIZED
- cv2.error: OpenCV(3.4.2) error: (-215:Assertion failed) !empty() in function ‘detectMultiScale‘
- Debug Assertion Failed! Detailed solution
- Unit error assertion failed on expression
- Opencv problem: opencv error: assertion failed (! Empty()) in detectmultiscale
- Successfully solved opencv error: assertion failed (SCN = = 3 | SCN = = 4) in CV:: cvtcolor
- OpenCV error: (-215:Assertion failed) !_src.empty() in function ‘cv::cvtColor‘
- RT-thread assertion failed at function:rt_application_init
- Information contained in Debug Assertion Failed of Microsoft Visual C++ Runtime Library
- (-215:Assertion failed) 0 <= contourIdx && contourIdx < (int)last in function ‘cv::drawContours‘
- Wrong classification of Python — assertion cur_ Target is greater than or equal to 0 and cur_ Target is less than n_ classes failed
- Assertion `input_val >= zero && input_val <= one` failed