catalogue
The following operations are carried out under the windows environment.
one Change single slash to double slash
2. The modified path is in English
3. Delete CV2. Imshow ()
When I use CV2 to save pictures to a new price asking folder, I report an error CV2. Error: opencv (4.5.1) C: \ users \ appveyor \ appdata \ local \ temp \ 1 \ PIP req build
The solution is as follows:
The following operations are carried out under the windows environment.
one Change single slash to double slash
Some people on the Internet say that the path reading error is caused by the number in the path. Correction method: change the single slash in the path into double slash.
For example:
cv2.imwrite(save_dir + '\\' + img_name, img)
However, the same error is reported later, so read the following comments for 2 operations:
2. The modified path is in English
I reported a similar error here because Chinese appears in the quoted picture path. If you change the picture path to an all English path, there will be no problem.
for i in ori_imgs_single:
img_name = i.split('\\')[-1]
img = cv2.imread(i)
cv2.imwrite(save_dir + '\\' + img_name, img)
print('save OK!')
OK:
3. Delete CV2. Imshow ()
Maybe there is something wrong with my environment. If you still report an error, try deleting CV2. Imshow (). If I delete it, it will be OK:
OK:
Read More:
- scalac: Token not found: C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2020.3\compile-server\to
- Cnpm appears in the vscode terminal: unable to load the file C: \ “users \” gkk \ “appdata \” roaming \ “NPM \” cnpm
- Record the location and cleaning of chrome junk files under appdata of Disk C
- Opencv, CV2. Puttext() usage
- Undeclared identifier CV in opencv4.2.0_ WINDOW_ AUTOSIZE
- OpenCV error: (-215:Assertion failed) !_src.empty() in function ‘cv::cvtColor‘
- Opencv does not define identifier cv_ CAP_ PROP_ FRAME_ COUNT
- cv2.error: OpenCV(3.4.2) error: (-215:Assertion failed) !empty() in function ‘detectMultiScale‘
- Unable to resolve sequelize package in C:\Users\
- Imshow() reports an error after C + + opencv 4.5.1 configures the environment
- Successfully solved opencv error: assertion failed (SCN = = 3 | SCN = = 4) in CV:: cvtcolor
- File C:\Users\admin\Documents\WindowsPowerShell\profile.ps1 cannot be loaded because running scripts
- [Solved] ERROR Failed to compile with 3 errors These dependencies were not found: * pdfjs-dist/es5/buil
- AttributeError: module ‘cv2.cv2‘ has no attribute ‘face‘
- Invalid Drive:H:\ (subst X: %TEMP%)
- Opencv problem: opencv error: assertion failed (! Empty()) in detectmultiscale
- Opencv perfect configuration strategy 2015 (win7 + opencv 2.4.9 + vs 2013)
- [opencv + openvino] opencv-vino4.5.1 + opencv contrib installation