zoukankan      html  css  js  c++  java
  • 9、OpenCV Python 边缘保留滤波

     1 __author__ = "WSX"
     2 import cv2 as cv
     3 import numpy as np
     4 # 边缘保留滤波 十分重要(美颜的核心)
     5 # 高斯双边模糊(考虑到了像素之间差异)
     6 
     7 #双边模糊 , 边缘差距大的保留
     8 def bi(img):  #美颜滤镜
     9     dst = cv.bilateralFilter(img , 0, 100 , 15) #第三个参数大一点(color),第四个小一点(space)
    10     cv.imshow("bi" , dst)
    11 
    12 def Shift( img ): #均值迁移 处理的边缘。。。
    13     dst = cv.pyrMeanShiftFiltering(img , 10 ,50)
    14     cv.imshow("Shift", dst)
    15 def main():
    16     img = cv.imread("1.JPG")
    17     cv.namedWindow("Show", cv.WINDOW_AUTOSIZE)
    18     cv.imshow("Show" ,img)
    19     bi(img)
    20     cv.waitKey(0)
    21     cv.destroyAllWindows()
    22 main()
  • 相关阅读:
    Redis 补充
    python 魔法方法补充(__setattr__,__getattr__,__getattribute__)
    Mongodb 补充
    Mysql补充
    HTML
    优秀工具
    优秀文章收藏
    MySQL
    爬虫
    Python
  • 原文地址:https://www.cnblogs.com/WSX1994/p/9151424.html
Copyright © 2011-2022 走看看