Sunday, June 19, 2022

Resolve OPENCV PYTHON Problem for your Environment Project

Several opencv problem and the resolve:

_____

- Problem:

cannot start Anaconda environment in windows

- Resolve: 

C:\Users\webiot>D:/Anaconda/Scripts/activate

_____

- Problem:

cv2.error: OpenCV(3.4.17) D:\a....\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:383: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'

- Resolve: 

camera=cv2.VideoCapture(0) #check for input device, maybe 0 or 1 etc.

_____

- Problem:

faces=detector.detectMultiScale(frame,1.1,7)

cv2.error: OpenCV(3.4.17) D:\a\opencv-python\opencv-python\opencv\modules\objdetect\src\cascadedetect.cpp:1729: error: (-215:Assertion failed) !empty() in function 'cv::CascadeClassifier::detectMultiScale'

- Resolve: 

run python as your path in the code

_____

- Problem:

sqlite3.OperationalError: no such column: 

- Resolve: 

check your parameter and add the value with single Quote each.

_____

- Problem:

sqlite3.OperationalError: database is locked

- Resolve: 

close all opened db browser

_____

- Problem:

CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -2147483638

- Resolve: 

downgrade your opencv-python with:

(base) C:\Users\webiot>pip uninstall opencv-python

(base) C:\Users\webiot>pip install opencv-python==3.4.17.63

(base) C:\Users\webiot>pip install opencv-contrib-python==3.4.17.63

_____


ANATHOR PROBLEM IN PYTHON

- Problem:

ModuleNotFoundError: No module named 'mysql.connector'; 'mysql' is not a package

- Resolve: 

if you have install the mysql connector by: pip install mysql-connector-python

You make sure or rename your py file not as mysql.py

_____

- Problem:

Redirect has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header

- Resolve: 

Add this extension on chrome browser:

Allow CORS: Access-Control-Allow-Origin

_____



No comments:

Post a Comment