While executing the code for nose detection using opencv a error occured :
cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\objdetect\src\cascadedetect.cpp:569: error: (-2:Unspecified error) in function ‘bool _cdecl cv::HaarEvaluator::Feature::read(const class cv::FileNode &,const class cv::Size &)’
Invalid HAAR feature (expected: ‘rw.r.x + rw.r.width <= W’), where
‘rw.r.x + rw.r.width’ is 16
must be less than or equal to
‘W’ is 15
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “C:\Users\Dibakar Chaudhary\Desktop\nose.py”, line 8, in
nose = cv2.CascadeClassifier(r"C:\Users\Dibakar Chaudhary\Desktop\third-party\Nose18x15.xml")
SystemError: <class ‘cv2.CascadeClassifier’> returned a result with an error set
[ WARN:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (674) SourceReaderCB::~SourceReaderCB terminating async callback
[Finished in 1.8s with exit code 1]
[shell_cmd: python -u “C:\Users\Dibakar Chaudhary\Desktop\nose.py”]
[dir: C:\Users\Dibakar Chaudhary\Desktop]
[path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\Git\cmd;C:\Users\Dibakar Chaudhary\AppData\Local\Programs\Python37;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files\nodejs;C:\Program Files (x86)\Yarn\bin;C:\Users\Dibakar Chaudhary\AppData\Local\Programs\Python\Python38\Scripts;C:\Users\Dibakar Chaudhary\AppData\Local\Programs\Python\Python38;C:\Users\Dibakar Chaudhary\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\PyCharm Community Edition 2019.2.3\bin;C:\Users\Dibakar Chaudhary\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Dibakar Chaudhary\AppData\Local\GitHubDesktop\bin;C:\Users\Dibakar Chaudhary\AppData\Roaming\npm;C:\Users\Dibakar Chaudhary\AppData\Local\Yarn\bin]