openCV图像处理---边缘保留滤波

  1 #!/bin/python3
  2 
  3 import cv2 as cv
  4 import numpy as np
  5 
  6 
  7 #双线模糊
  8 def b1_demo(image):
  9     dst = cv.bilateralFilter(image,0,100,15)
 10     cv.imshow("bi_demo",dst)
 11 
 12 #均值模糊
 13 def shift_demo(image):
 14     dst = cv.pyrMeanShiftFiltering(image,10,50)
 15     cv.imshow("shift_demo",dst)
 16 
 17 
 18 
 19 print("----------Hello Python-----------------")
 20 src = cv.imread("/home/laohe/downloads/image.jpeg")
 21 cv.namedWindow("input image",cv.WINDOW_AUTOSIZE)
 22 cv.imshow("input image",src)
 23 b1_demo(src)
 24 shift_demo(src)
 25 cv.waitKey(0)
 26 
 27 cv.destroyAllWindows()
~                                                                                                                                             
~                                

 

上一篇:MATLAB灰度变换


下一篇:python——图像处理3(均值偏移、改变亮度、图像修复、图像融合)