Files
2026-05-20 15:05:35 +08:00

15 lines
507 B
Plaintext
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 创建环境
conda create -n Deal_pics python=3.8
sudo apt install imagemagick
# 安装包
conda activate Deal_pics
pip install --upgrade pip
pip install opencv-python
# 解决BUG
# 命令python cv2.Canny(image, 50, 150)
# 错误cv2.error: OpenCV(4.5.5) /io/opencv/modules/imgproc/src/canny.cpp:829: error: (-215:Assertion failed) _src.depth() == CV_8U in function 'Canny'
# 错误原因Canny函数只对0~255起作用对0~1不起作用
# 解决方案image = (image*255).astype(np.uint8)