import cv2

img = cv2.imread('MAYI1.jpg', 0)#读取初始图片

ret, yuzhi = cv2.threshold(img, 116, 255, cv2.THRESH_BINARY)
mohu = cv2.GaussianBlur(yuzhi, (8, 8), 0)#阈值和模糊处理

试图运行此段代码,报错

修改高斯模糊内核大小之后

import cv2

img = cv2.imread('MAYI1.jpg', 0)#读取初始图片

ret, yuzhi = cv2.threshold(img, 116, 255, cv2.THRESH_BINARY)
mohu = cv2.GaussianBlur(yuzhi, (9, 9), 0)#阈值和模糊处理

原来内核大小只支持奇数

解决!

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
  • 2021-11-27
  • 2021-05-11
猜你喜欢
  • 2021-11-01
  • 2021-09-02
  • 2022-01-04
  • 2021-11-04
  • 2021-07-07
  • 2021-08-13
  • 2021-09-11
相关资源
相似解决方案