15 lines
507 B
Plaintext
Executable File
15 lines
507 B
Plaintext
Executable File
# 创建环境
|
||
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)
|
||
|